| License | BSD3 |
|---|---|
| Maintainer | tbidne@gmail.com |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Common.Parsing.ParseOr
Description
Provides the ParseOr monoid.
Synopsis
- newtype ParseOr acc = ParseOr (ParseStatus acc)
- module Common.Parsing.ParseStatus
Documentation
ParseOr Induces an "Or" monoidal structure on ParseStatus. That is,
(PFailurep1) <> ... <> (PFailurepn) =PFailure(p1 <> ... <> pn) (PFailurep1) <> ... <> (PFailurepj) <> (PSuccesspk) ... =PSuccesspk
The algebra for ParseOr satisfies
1. Identity:ParseOr(PFailure(Err"")) 2.PSuccessis an ideal:PSuccessx <>PFailurey ==PSuccessx ==PFailurey <>PSuccessx 3. Left-biased: l <> r == l, when it doesn't violate 1 or 2.
Strictly speaking property 2 is stronger than saying PSuccess is an ideal.
More precisely, the action by PFailure on PSuccess in ParseOr is trivial.
Constructors
| ParseOr (ParseStatus acc) |
module Common.Parsing.ParseStatus