purescript-0.15.9: PureScript Programming Language Compiler
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.PureScript.TypeChecker

Description

The top-level type checker, which checks all declarations in a module.

Synopsis

Documentation

module Data.Text

typeCheckModule :: forall m. (MonadSupply m, MonadState CheckState m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Map ModuleName Exports -> Module -> m Module Source #

Type check an entire module and ensure all types and classes defined within the module that are required by exported members are also exported.

checkNewtype :: forall m. MonadError MultipleErrors m => ProperName 'TypeName -> [DataConstructorDeclaration] -> m (DataConstructorDeclaration, (Ident, SourceType)) Source #

Check that a newtype has just one data constructor with just one field, or throw an error. If the newtype is valid, this function returns the single data constructor declaration and the single field, as a proof that the newtype was indeed a valid newtype.