| License | BSD-3-Clause |
|---|---|
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Swarm.Util.Erasable
Documentation
Extend a semigroup to a monoid by adding an identity (ENothing) and an
annihilator (EErase). That is,
ENothing <> e = e <> ENothing = e
EErase <> e = e <> EErase = EErase
This allows us to "erase" previous values by combining with
EErase. The erasableToMaybe function turns an Erasable
into a Maybe by collapsing ENothing and EErase both back
into Nothing.
Instances
| Functor Erasable Source # | |
| Semigroup e => Monoid (Erasable e) Source # | |
| Semigroup e => Semigroup (Erasable e) Source # | |
| Show e => Show (Erasable e) Source # | |
| Eq e => Eq (Erasable e) Source # | |
| Ord e => Ord (Erasable e) Source # | |
Defined in Swarm.Util.Erasable | |
erasableToMaybe :: Erasable e -> Maybe e Source #