constant :: Typeable t => String -> Exp t -> Action (Exp t)
constant name x = do x <- constant_ x; xx <- x; addScope name xx; return x

-- | Create a constant with no name, ensuring the expression is shared.
--   Equivalent to @'share' 'return'@.
constant :: Typeable t => String -> Exp t -> Action (Exp t)
constant name x = do x <- constant_ x; xx <- x; addScope name xx; return x

-- | Create a constant with no name, ensuring the expression is shared.
--   Equivalent to @'share' 'return'@.
constant name x = do x <- constant_ x; xx <- x; addScope name xx; return x

-- | Create a constant with no name, ensuring the expression is shared.
--   Equivalent to @'share' 'return'@.