Alternative -is:module

A monoid on applicative functors. If defined, some and many should be the least solutions of the equations:

Examples

>>> Nothing <|> Just 42
Just 42
>>> [1, 2] <|> [3, 4]
[1,2,3,4]
>>> empty <|> print (2^15)
32768
A monoid on applicative functors. If defined, some and many should be the least solutions of the equations:
Check Alternative Monoid laws
Multiple alternative representations of the same data. For example, you could provide a plain-text and HTML version of a message.
Undocumented parsing-related extensions introduced in GHC 7.0.
Undocumented parsing-related extensions introduced in GHC 7.0.
Memory-managed wrapper type.
Internal state of the result of Alternative constructions
Try to deserialize each constructor of a in order. For sum types, stock Binary writes (and expects to read) an integer denoting the index of the constructor. This isn't always what's needed. In the following example, the constructor is uniquely identified by the marker byte, and its index in the Haskell ADT is irrelevant:
data JfifSegment
= App0Segment (MatchByte "app0 segment" 0xe0, JfifApp0)
| DqtSegment  (MatchByte "dqt segment"  0xdb, QuantTable)
| SofSegment  (MatchByte "sof segment"  0xc0, SofInfo)
| DhtSegment  (MatchByte "dht segment"  0xc4, HuffmanTable)
| DriSegment  (MatchByte "dri segment"  0xdd, RestartInterval)
| SosSegment  (MatchByte "sos segment"  0xda, SosImage)
| UnknownSegment RawSegment
deriving Generic
deriving Binary via Alternatively JfifSegment
Possible alternatives.
Subclass of Alternative that carries an error message in case of failure
Pyyyy-mm-dd (extended), Pyyyymmdd (basic) [ISO 8601:2004(E) sec. 4.4.3.3]
Pyyyy-mm-ddThh:mm:ss (extended), PyyyymmddThhmmss (basic) [ISO 8601:2004(E) sec. 4.4.3.3]
Parallel composition of a list of GrdDags. Needs a non-empty list as GdAlt does not have a neutral element.