| License | BSD-3-Clause |
|---|---|
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Swarm.Language.Parser.Type
Description
Parsing types in the Swarm language.
Synopsis
Documentation
parsePolytype :: Parser Polytype Source #
Parse a Swarm language polytype, which starts with an optional
quanitifation (forall followed by one or more variables and a
period) followed by a type. Note that anything accepted by
parseType is also accepted by parsePolytype.
parseTypeMolecule :: Parser Type Source #
A "type molecule" consists of either a type constructor applied to a chain of type atoms, or just a type atom by itself. We have to separate this out from parseTypeAtom to deal with the left recursion.
parseTypeAtom :: Parser Type Source #
A "type atom" consists of some atomic type snytax --- type variables, things in brackets of some kind, or a lone type constructor.
parseTyCon :: Parser TyCon Source #
A type constructor.