BNFC-2.9.4.1: A compiler front-end generator.
Safe HaskellNone
LanguageHaskell2010

BNFC.TypeChecker

Description

Type checker for defined syntax constructors define f xs = e.

Synopsis

Type checker entry point

checkDefinitions :: CF -> Err CF Source #

Entry point.

Backdoor for rechecking defined syntax constructors for list types

checkDefinition' Source #

Arguments

:: ListConstructors

Translation of the list constructors.

-> Context

Signature (types of labels).

-> RFun

Function name.

-> [String]

Function arguments.

-> Exp

Function body.

-> Err (Telescope, (Exp, Base))

Typed arguments, translated body, type of body.

buildSignature :: [Rule] -> Err Signature Source #

Create context containing the types of all labels, computed from the rules.

Fail if a label is used at different types.

buildContext :: CF -> Context Source #

ctxTokens :: Context -> [String] Source #

User-defined token types.

isToken :: String -> Context -> Bool Source #

data ListConstructors Source #

Constructors

LC 

Fields