Copyright | (c) Fumiaki Kinoshita 2015 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
- type (⊆) xs ys = Include ys xs
- type Include ys = Forall (Member ys)
- inclusion :: forall xs ys. Include ys xs => Membership ys :* xs
- shrink :: xs ⊆ ys => (h :* ys) -> h :* xs
- spread :: xs ⊆ ys => (h :| xs) -> h :| ys
- type IncludeAssoc ys = Forall (Associated ys)
- class Associated xs t
- inclusionAssoc :: forall xs ys. IncludeAssoc ys xs => Membership ys :* xs
- shrinkAssoc :: IncludeAssoc ys xs => (h :* ys) -> h :* xs
- spreadAssoc :: IncludeAssoc ys xs => (h :| xs) -> h :| ys
- coinclusion :: (Include ys xs, Generate ys) => Nullable (Membership xs) :* ys
- wrench :: (Generate ys, xs ⊆ ys) => (h :* xs) -> Nullable h :* ys
- retrench :: (Generate ys, xs ⊆ ys) => (h :| ys) -> Nullable ((:|) h) xs
- data Nullable h x
- nullable :: r -> (h x -> r) -> Nullable h x -> r
- mapNullable :: (g x -> h y) -> Nullable g x -> Nullable h y
Inclusion
inclusion :: forall xs ys. Include ys xs => Membership ys :* xs Source
Reify the inclusion of type level sets.
Key-value
type IncludeAssoc ys = Forall (Associated ys) Source
Similar to Include
, but this focuses on keys.
class Associated xs t Source
getAssociation
Associate k k1 k2 v xs => Associated (Assoc k k) xs ((:>) k k k v) |
inclusionAssoc :: forall xs ys. IncludeAssoc ys xs => Membership ys :* xs Source
Reify the inclusion of type level sets.
shrinkAssoc :: IncludeAssoc ys xs => (h :* ys) -> h :* xs Source
O(m log n) Select some elements.
spreadAssoc :: IncludeAssoc ys xs => (h :| xs) -> h :| ys Source
O(log n) Embed to a larger union.
Inverse
coinclusion :: (Include ys xs, Generate ys) => Nullable (Membership xs) :* ys Source
The inverse of inclusion
.
wrench :: (Generate ys, xs ⊆ ys) => (h :* xs) -> Nullable h :* ys Source
Extend a product and fill missing fields by Null
.
retrench :: (Generate ys, xs ⊆ ys) => (h :| ys) -> Nullable ((:|) h) xs Source
Narrow the range of the sum, if possible.
Poly-kinded Maybe
mapNullable :: (g x -> h y) -> Nullable g x -> Nullable h y Source
Apply a function to its content.