Copyright | (c) Fumiaki Kinoshita 2018 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <fumiexcel@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Data.Extensible.Nullable
Description
Synopsis
- vacancy :: Generate xs => Nullable h :* xs
- 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
- newtype Nullable h x = Nullable {
- getNullable :: Maybe (h x)
- mapNullable :: (g x -> h y) -> Nullable g x -> Nullable h y
Documentation
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.
Wrapped Maybe
Constructors
Nullable | |
Fields
|
Instances
mapNullable :: (g x -> h y) -> Nullable g x -> Nullable h y Source #
Apply a function to its content.