Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a simple example of use of everything in
Pinchot. address
parses a postal address from a string and
prints a simple report showing some of the elements of the
address and their locations.
- labelLoc :: Loc -> String
- labelOpt :: String -> Seq (Char, Loc) -> String
- labelNE :: String -> NonEmptySeq (Char, Loc) -> String
- showAddress :: Address Char Loc -> String
- showParseResult :: ([Address Char Loc], Report String (Seq (Char, Loc))) -> String
- address :: String -> IO ()
- addressPretty :: String -> IO ()
- addressFromFile :: String -> IO ()
Documentation
labelOpt :: String -> Seq (Char, Loc) -> String Source #
Labels a single field, where the field may or may not appear in a parsed result.
labelNE :: String -> NonEmptySeq (Char, Loc) -> String Source #
Labels a single field, where the field will always appear in a parsed result.
showAddress :: Address Char Loc -> String Source #
Formats a single Address
for nice on-screen display.
address :: String -> IO () Source #
Parse an address and print the resulting report. Good for use in GHCi.
Read an address from a file and print the resulting report. Good for use in GHCi.