Copyright | (c) George Ungureanu 2015-2016 |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | ugeorge@kth.se |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module implements the constructors and assocuated utilities of a type which extends the behavior of a function to express "absent events" (see [Halbwachs91]).
The AbstExt
type can be used directly with the atom patterns
defined in ForSyDe.Atom.ExB, and no helpers or utilities are
needed. Example usage:
>>>
res21 (+) (Prst 1) (Prst 2)
3>>>
res21 (+) Abst Abst
⟂>>>
filter Abst (Prst 1)
⟂>>>
filter (Prst False) (Prst 1)
⟂>>>
filter (Prst True) (Prst 1)
1>>>
filter' False 1 :: AbstExt Int
⟂>>>
filter' True 1 :: AbstExt Int
1>>>
degen 0 (Prst 1)
1>>>
degen 0 Abst
0>>>
ignore11 (+) 1 (Prst 1)
2>>>
ignore11 (+) 1 Abst
1
Incorrect usage (not covered by doctest
):
λ> res21 (+) (Prst 1) Abst *** Exception: [ExB.Absent] Illegal occurrence of an absent and present event
Synopsis
- data AbstExt a
- module ForSyDe.Atom.ExB
Documentation
The AbstExt
type extends the base type with the '(bot)'
symbol denoting the absence of a value/event (see
[Halbwachs91]).
Instances
Functor AbstExt Source # |
|
Applicative AbstExt Source # |
|
ExB AbstExt Source # | Implements the absent semantics of the extended behavior atoms. |
Eq a => Eq (AbstExt a) Source # | |
Read a => Read (AbstExt a) Source # | Reads the '_' character to an |
Show a => Show (AbstExt a) Source # | Shows |
(Show a, Plottable a) => Plottable (AbstExt a) Source # | Absent-extended plottable types |
Module ForSyDe.Atom.ExB is re-exported for convenience, to access the atom patterns more easily.
module ForSyDe.Atom.ExB