| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Pinchot.Examples.PostalAstRuleTree
Description
Provides an example of the use of ruleTreeToCode. You will
want to look at the source code, as it has a Template Haskell
splice that produces all of the data types that you see in the
Haddocks.
- newtype Digit = Digit Char
- data Digits = Digits Digit ([] Digit)
- newtype Number = Number Digits
- newtype Space = Space Char
- newtype North = North Char
- newtype South = South Char
- newtype East = East Char
- newtype West = West Char
- data Direction
- data DirectionSpace = DirectionSpace Direction Space
- newtype MaybeDirection = MaybeDirection (Maybe DirectionSpace)
- newtype Letter = Letter Char
- data PostalWord = PostalWord Letter ([] Letter)
- data PreSpacedWord = PreSpacedWord Space PostalWord
- newtype PreSpacedWords = PreSpacedWords ([] PreSpacedWord)
- data Words = Words PostalWord PreSpacedWords
- newtype StreetName = StreetName Words
- data Street = Street ([] Char)
- data Avenue = Avenue ([] Char)
- data Way = Way ([] Char)
- data Boulevard = Boulevard ([] Char)
- data Suffix
- data SpaceSuffix = SpaceSuffix Space Suffix
- newtype MaybeSuffix = MaybeSuffix (Maybe SpaceSuffix)
- newtype Comma = Comma Char
- newtype City = City Words
- newtype State = State PostalWord
- newtype ZipCode = ZipCode Digits
- data Address = Address Number Space MaybeDirection StreetName MaybeSuffix Comma Space City Comma Space State Space ZipCode
- postalGrammar :: Grammar r (Prod r String Char Address)
Documentation
data DirectionSpace Source
Constructors
| DirectionSpace Direction Space |
newtype MaybeDirection Source
Constructors
| MaybeDirection (Maybe DirectionSpace) |
newtype PreSpacedWords Source
Constructors
| PreSpacedWords ([] PreSpacedWord) |
Constructors
| Words PostalWord PreSpacedWords |
Constructors
| State PostalWord |
Constructors
| Address Number Space MaybeDirection StreetName MaybeSuffix Comma Space City Comma Space State Space ZipCode |