Copyright | (c) Fumiaki Kinoshita 2015 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
- data h :| s where
- UnionAt :: !(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
Documentation
The extensible sum type
UnionAt :: !(Membership xs x) -> h x -> h :| xs |
strikeAt :: forall h x xs. Membership xs x -> (h :| xs) -> Maybe (h x) Source
(<:|) :: (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
A traversal that tries to point a specific element.
embedAssoc :: Associate k a xs => h (k :> a) -> h :| xs Source