ether-0.1.0.0: Monad transformers and classes
Control.Ether.TH
Description
Template haskell utilities.
Synopsis
ethereal :: String -> String -> DecsQ Source
Creates a tag and a value-level proxy for it.
ethereal "Foo" "foo" generates the following code:
ethereal "Foo" "foo"
ethereal
data Foo foo :: Proxy Foo foo = Proxy
fmapN :: Int -> ExpQ Source
Compose fmap n times.
fmap
n
$(fmapN 5) = fmap.fmap.fmap.fmap.fmap
fmapN
deepN :: Int -> ExpQ -> ExpQ Source
fmap a function n levels deep.
$(deepN 3 [| f |]) = $(fmapN 3) f ($(fmapN 2) f ($(fmapN 1) f id))
deepN