unbound-generics-0.3: Support for programming with names and binders using GHC Generics

Copyright(c) 2014, Aleksey Kliger
LicenseBSD3 (See LICENSE)
MaintainerAleksey Kliger
Safe HaskellNone
  • MonoLocalBinds
  • TypeFamilies
  • DeriveGeneric
  • KindSignatures
  • ExplicitNamespaces



The pattern Embed t contains a term t.



newtype Embed t Source

Embed allows for terms to be embedded within patterns. Such embedded terms do not bind names along with the rest of the pattern. For examples, see the tutorial or examples directories.

If t is a term type, then Embed t is a pattern type.

Embed is not abstract since it involves no binding, and hence it is safe to manipulate directly. To create and destruct Embed terms, you may use the Embed constructor directly. (You may also use the functions embed and unembed, which additionally can construct or destruct any number of enclosing Shifts at the same time.)


Embed t 


Subst c a => Subst c (Embed a) Source 
Eq t => Eq (Embed t) Source 
Ord t => Ord (Embed t) Source 
Show a => Show (Embed a) Source 
Generic (Embed t) Source 
NFData t => NFData (Embed t) Source 
Alpha t => Alpha (Embed t) Source 
IsEmbed (Embed t) Source 
type Rep (Embed t) Source 
type Embedded (Embed t) = t Source 

class IsEmbed e where Source

Associated Types

type Embedded e :: * Source

The term type embedded in the embedding e


embedded :: (Profunctor p, Functor f) => p (Embedded e) (f (Embedded e)) -> p e (f e) Source

Insert or extract the embedded term. If you're not using the lens library, see embed and unembed otherwise embedded is an isomorphism that you can use with lens. embedded :: Iso' (Embedded e) e