ether-0.1.0.0: Monad transformers and classes

Safe HaskellNone
LanguageHaskell2010

Control.Ether.TH

Description

Template haskell utilities.

Synopsis

Documentation

ethereal :: String -> String -> DecsQ Source

Creates a tag and a value-level proxy for it.

ethereal "Foo" "foo" generates the following code:

data Foo
foo :: Proxy Foo
foo = Proxy

fmapN :: Int -> ExpQ Source

Compose fmap n times.

$(fmapN 5) = fmap.fmap.fmap.fmap.fmap

deepN :: Int -> ExpQ -> ExpQ Source

fmap a function n levels deep.

$(deepN 3 [| f |]) = $(fmapN 3) f ($(fmapN 2) f ($(fmapN 1) f id))