Safe Haskell | None |
---|---|
Language | Haskell2010 |
The HList library
(C) 2004, Oleg Kiselyov, Ralf Laemmel, Keean Schupke
Result-type-driven operations on typeful heterogeneous lists.
Synopsis
- class HOccursNot2 (b :: Bool) e (l :: [k]) (l0 :: [k])
- class HOccursNot1 (e :: k) (xs :: [k]) (xs0 :: [k])
- class HOccursOpt' e l where
- hOccursOpt' :: HList l -> Maybe e
- class HOccurs' e l (l0 :: [*]) where
- data TypeNotFound e
- class HOccursMany' e l where
- hOccursMany' :: HList l -> [e]
- class HOccursMany e (l :: [*]) where
- hOccursMany :: HList l -> [e]
- class HOccurrence' (b :: Bool) (e1 :: *) (l :: [*]) (l' :: [*]) | b e1 l -> l' where
- hOccurrence' :: Proxy b -> Proxy e1 -> HList l -> HList l'
- class HOccurrence (e1 :: *) (l :: [*]) (l' :: [*]) | e1 l -> l' where
- hOccurrence :: Proxy e1 -> HList l -> HList l'
- hOccursMany1 :: forall e l l'. (HOccurrence e l (e ': l'), HOccursMany e l') => HList l -> (e, [e])
- hOccursFst :: forall e l l'. HOccurrence e l (e ': l') => HList l -> e
- hOccursRest :: forall l r (v :: [Type]) (v' :: [Type]). (HOccurs l (r v), HDeleteAtLabel r l v v') => r v -> (l, r v')
- hOccursOpt :: forall e l l'. (HOccurrence e l l', HOccursOpt' e l') => HList l -> Maybe e
Documentation
class HOccursNot2 (b :: Bool) e (l :: [k]) (l0 :: [k]) Source #
Instances
HOccursNot1 e l l0 => HOccursNot2 'False (e :: k) (l :: [k]) (l0 :: [k]) Source # | |
Defined in Data.HList.HOccurs | |
Fail (ExcessFieldFound e l0) => HOccursNot2 'True (e :: k1) (l :: [k2]) (l0 :: [k2]) Source # | |
Defined in Data.HList.HOccurs |
class HOccursNot1 (e :: k) (xs :: [k]) (xs0 :: [k]) Source #
Instances
HOccursNot1 (e :: k) ('[] :: [k]) (l0 :: [k]) Source # | |
Defined in Data.HList.HOccurs | |
(HEq e e1 b, HOccursNot2 b e l l0) => HOccursNot1 (e :: a) (e1 ': l :: [a]) (l0 :: [a]) Source # | |
Defined in Data.HList.HOccurs |
class HOccursOpt' e l where Source #
hOccursOpt' :: HList l -> Maybe e Source #
Instances
HOccursOpt' e ('[] :: [Type]) Source # | |
Defined in Data.HList.HOccurs hOccursOpt' :: HList '[] -> Maybe e Source # | |
e ~ e1 => HOccursOpt' e (e1 ': l) Source # | |
Defined in Data.HList.HOccurs hOccursOpt' :: HList (e1 ': l) -> Maybe e Source # |
class HOccurs' e l (l0 :: [*]) where Source #
l0 is the original list so that when we reach the end of l without finding an e, we can report an error that gives an idea about what the original list was.
data TypeNotFound e Source #
class HOccursMany' e l where Source #
hOccursMany' :: HList l -> [e] Source #
Instances
HOccursMany' e ('[] :: [Type]) Source # | |
Defined in Data.HList.HOccurs hOccursMany' :: HList '[] -> [e] Source # | |
(e ~ e1, HOccursMany e l) => HOccursMany' e (e1 ': l) Source # | |
Defined in Data.HList.HOccurs hOccursMany' :: HList (e1 ': l) -> [e] Source # |
class HOccursMany e (l :: [*]) where Source #
hOccursMany :: HList l -> [e] Source #
Instances
(HOccurrence e l l', HOccursMany' e l') => HOccursMany e l Source # | |
Defined in Data.HList.HOccurs hOccursMany :: HList l -> [e] Source # |
class HOccurrence' (b :: Bool) (e1 :: *) (l :: [*]) (l' :: [*]) | b e1 l -> l' where Source #
Instances
HOccurrence e1 l l' => HOccurrence' 'False e1 (e ': l) l' Source # | |
Defined in Data.HList.HOccurs | |
HOccurrence' 'True e1 (e ': l) (e ': l) Source # | |
Defined in Data.HList.HOccurs |
class HOccurrence (e1 :: *) (l :: [*]) (l' :: [*]) | e1 l -> l' where Source #
Instances
HOccurrence e1 ('[] :: [Type]) ('[] :: [Type]) Source # | |
Defined in Data.HList.HOccurs | |
(HEq e1 e b, HOccurrence' b e1 (e ': l) l') => HOccurrence e1 (e ': l) l' Source # | |
Defined in Data.HList.HOccurs |
hOccursMany1 :: forall e l l'. (HOccurrence e l (e ': l'), HOccursMany e l') => HList l -> (e, [e]) Source #
hOccursFst :: forall e l l'. HOccurrence e l (e ': l') => HList l -> e Source #
hOccursRest :: forall l r (v :: [Type]) (v' :: [Type]). (HOccurs l (r v), HDeleteAtLabel r l v v') => r v -> (l, r v') Source #
lookup a value in the collection (TIP usually) and return the TIP with that
element deleted. Used to implement tipyTuple
.
hOccursOpt :: forall e l l'. (HOccurrence e l l', HOccursOpt' e l') => HList l -> Maybe e Source #