This module provides a nice syntax for defining a list of pairs.
- type PairsWriter a b = State [(a, b)]
- (=:) :: forall a b. a -> b -> PairsWriter a b ()
- pairs :: forall a b c. PairsWriter a b c -> [(a, b)]
Documentation
type PairsWriter a b = State [(a, b)]Source
The abstract type describing the monadic state of a list of pairs.
(=:) :: forall a b. a -> b -> PairsWriter a b ()Source
Make a list of pairs of pairs like
pairs $ do $ 3 =: ( " is my favourite number or " , 5 ) 10 =: ( " pints have I drunk or was it " , 11 )
pairs :: forall a b c. PairsWriter a b c -> [(a, b)]Source
Take a monadic PairsWriter and return a list of pairs.