--
-----------------------------------------------------------------------------
-module Data.Generics.Aliases (
-
- -- * Combinators to \"make\" generic functions via cast
- mkT, mkQ, mkM, mkMp, mkR,
- ext0, extT, extQ, extM, extMp, extB, extR,
-
- -- * Type synonyms for generic function types
- GenericT,
- GenericQ,
- GenericM,
- GenericB,
- GenericR,
+module Data.Generics.Aliases (
+
+ -- * Combinators to \"make\" generic functions via cast
+ mkT, mkQ, mkM, mkMp, mkR,
+ ext0, extT, extQ, extM, extMp, extB, extR,
+
+ -- * Type synonyms for generic function types
+ GenericT,
+ GenericQ,
+ GenericM,
+ GenericB,
+ GenericR,
Generic,
Generic'(..),
GenericT'(..),
GenericQ'(..),
GenericM'(..),
- -- * Inredients of generic functions
- orElse,
+ -- * Inredients of generic functions
+ orElse,
- -- * Function combinators on generic functions
- recoverMp,
- recoverQ,
- choiceMp,
- choiceQ,
+ -- * Function combinators on generic functions
+ recoverMp,
+ recoverQ,
+ choiceMp,
+ choiceQ,
- -- * Type extension for unary type constructors
- ext1T,
- ext1M,
- ext1Q,
- ext1R
+ -- * Type extension for unary type constructors
+ ext1T,
+ ext1M,
+ ext1Q,
+ ext1R
) where
------------------------------------------------------------------------------
--
--- Combinators to "make" generic functions
--- We use type-safe cast in a number of ways to make generic functions.
+-- Combinators to "make" generic functions
+-- We use type-safe cast in a number of ways to make generic functions.
--
------------------------------------------------------------------------------
, Typeable b
)
=> (b -> b)
- -> a
+ -> a
-> a
mkT = extT id
)
=> r
-> (b -> r)
- -> a
+ -> a
-> r
(r `mkQ` br) a = case cast a of
Just b -> br b
, Typeable b
)
=> (b -> m b)
- -> a
+ -> a
-> m a
mkM = extM return
------------------------------------------------------------------------------
--
--- Type synonyms for generic function types
+-- Type synonyms for generic function types
--
------------------------------------------------------------------------------
------------------------------------------------------------------------------
--
--- Type extension for unary type constructors
+-- Type extension for unary type constructors
--
------------------------------------------------------------------------------
------------------------------------------------------------------------------
--
--- Type constructors for type-level lambdas
+-- Type constructors for type-level lambdas
--
------------------------------------------------------------------------------