A parsed type expression.
Modulepersistent-2.18.1.0Haskell2010
Database.Persist.Quasi.Internal.TypeParser
- 2 types
- 3 values
- Packagepersistent-2.18.1.0
- Exports5
- LanguageHaskell2010
- LicenceMIT
- SourceTypeParser.hs
A parsed type constructor.
Constructors
Instances2Eq, Show
Eq TypeConstructorDefined in persistent-2.18.1.0 · Database.Persist.Quasi.Internal.TypeParserShow TypeConstructorDefined in persistent-2.18.1.0 · Database.Persist.Quasi.Internal.TypeParser
Parses a Persistent-style type expression. Persistent's type expressions are largely similar to Haskell's, but with a few differences:
Syntactic sugar is not currently supported for constructing types other than List.
Only certain typelevel literals are supported: Strings, Ints, and promoted type constructors.
Because they must be parsed as part of an entity field definition, top-level applications of non-nullary type constructors (except for the sugary List constructor) must be parenthesized.
VALID: Int VALID: [Maybe Int] VALID: (Maybe Int) INVALID: Maybe Int
Parses a type expression in non-top-level contexts, where an unparenthesized type constructor application is acceptable.
Given a TypeExpr, renders it back to a String in a canonical form that looks normal to humans and is re-parseable when making an UnboundEntityDef that uses it.