Safe Haskell | None |
---|---|
Language | Haskell2010 |
Main module exporting the relevant functions
- parseTok :: Text -> Either (ParseError Char Dec) RandTok
- runFile :: FilePath -> IO Text
- parseFile :: FilePath -> IO (Either (ParseError Char Dec) RandTok)
- templateGen :: Text -> Either (ParseError Char Dec) (IO Text)
- run :: RandTok -> IO Text
- data RandTok
- type Context a = State [(Key, RandTok)] a
- data SemanticError
- exec :: IO ()
Parsers for `.mad` files
parseTok :: Text -> Either (ParseError Char Dec) RandTok Source #
Parse text as a token
f <- readFile "template.mad" parseTok f
parseFile :: FilePath -> IO (Either (ParseError Char Dec) RandTok) Source #
Parse a template file into the RandTok
data type
templateGen :: Text -> Either (ParseError Char Dec) (IO Text) Source #
Generate randomized text from a template
Functions and constructs for the RandTok
data type
datatype for a token returning a random string
Eq RandTok Source # | |
Show RandTok Source # | |
Monoid RandTok Source # | Make (Value "Hello") <> (List [(0.5," you"), (0.5, " me")]) (List [(0.5,"Hello you"), (0.5, "Hello me")]) |
Eq a => Eq (Context a) Source # | Compare inside the state monad using only the underlying objects |
Types associated with the parser
type Context a = State [(Key, RandTok)] a Source #
State monad providing context, i.e. function we've already called before
data SemanticError Source #
Datatype for a semantic error
Show SemanticError Source # | display a |
Exception SemanticError Source # | derived exception instance |