| License | BSD3 |
|---|---|
| Maintainer | tbidne@gmail.com |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Common.Parsing.ParseAnd
Description
Provides the ParseAnd monoid.
Synopsis
- newtype ParseAnd acc = ParseAnd (ParseStatus acc)
- module Common.Parsing.ParseStatus
Documentation
ParseAnd induces an "And" monoidal structure on Monoid acc => .
That is,ParseStatus acc
(PSuccessp1) <> ... <> (PSuccesspn) =PSuccess(p1 <> ... <> pn) (PSuccessp1) <> ... <> (PSuccesspj) <> (PFailurepk) ... =PFailurepk
The algebra for ParseAnd satisfies
1. Identity:ParseAnd(PSuccessmempty) 2.PFailureis an ideal:PFailurex <>PSuccessy ==PFailurex ==PSuccessy <>PFailurex 3. Left-biased: l <> r == l, when it doesn't violate 1 or 2.
Strictly speaking property 2 is stronger than saying PFailure is an ideal.
More precisely, the action by PSuccess on PFailure in ParseAnd is trivial.
Constructors
| ParseAnd (ParseStatus acc) |
module Common.Parsing.ParseStatus