Copyright | (c) Fumiaki Kinoshita 2015 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- data h :| s where
- EmbedAt :: !(Membership xs x) -> h x -> h :| xs
- hoist :: (forall x. g x -> h x) -> (g :| xs) -> h :| xs
- embed :: x ∈ xs => h x -> h :| xs
- strike :: forall h x xs. x ∈ xs => (h :| xs) -> Maybe (h x)
- strikeAt :: forall h x xs. Membership xs x -> (h :| xs) -> Maybe (h x)
- (<:|) :: (h x -> r) -> ((h :| xs) -> r) -> (h :| (x : xs)) -> r
- exhaust :: (h :| []) -> r
- picked :: forall f h x xs. (x ∈ xs, Applicative f) => (h x -> f (h x)) -> (h :| xs) -> f (h :| xs)
- embedAssoc :: Associate k a xs => h (k :> a) -> h :| xs
- pattern UnionAt (Membership k t x) (t x) :: (:|) k t t
Documentation
The extensible sum type
(:|) :: (k -> *) -> [k] -> *
EmbedAt :: !(Membership xs x) -> h x -> h :| xs |
(Applicative f, Choice p) => Extensible k f p ((:|) k) | |
Typeable ((k -> *) -> [k] -> *) ((:|) k) | |
WrapForall k * Eq h xs => Eq ((:|) k h xs) | |
(Eq ((:|) k h xs), WrapForall k * Ord h xs) => Ord ((:|) k h xs) | |
WrapForall k * Show h xs => Show ((:|) k h xs) |
strike :: forall h x xs. x ∈ xs => (h :| xs) -> Maybe (h x) Source
Try to extract something you want.
strikeAt :: forall h x xs. Membership xs x -> (h :| xs) -> Maybe (h x) Source
Try to extract something you want.
(<:|) :: (h x -> r) -> ((h :| xs) -> r) -> (h :| (x : xs)) -> r infixr 1 Source
O(1) Naive pattern match
picked :: forall f h x xs. (x ∈ xs, Applicative f) => (h x -> f (h x)) -> (h :| xs) -> f (h :| xs) Source
Deprecated: Use piece instead
A traversal that tries to point a specific element.
embedAssoc :: Associate k a xs => h (k :> a) -> h :| xs Source
Embed a value, but focuses on its key.
pattern UnionAt (Membership k t x) (t x) :: (:|) k t t Source
Deprecated: This has renamed to EmbedAt