purescript-0.15.12: PureScript Programming Language Compiler

Safe Haskell | Safe-Inferred
Language | Haskell2010

Language.PureScript.TypeChecker

Description

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

Synopsis

- module Language.PureScript.TypeChecker.Types
- module Language.PureScript.TypeChecker.Synonyms
- module Language.PureScript.TypeChecker.Roles
- module Language.PureScript.TypeChecker.Monad
- module Language.PureScript.TypeChecker.Kinds
- typeCheckModule :: forall m. (MonadSupply m, MonadState CheckState m, MonadError MultipleErrors m, MonadWriter MultipleErrors m) => Map ModuleName Exports -> Module -> m Module
- checkNewtype :: forall m. MonadError MultipleErrors m => ProperName 'TypeName -> [DataConstructorDeclaration] -> m (DataConstructorDeclaration, (Ident, SourceType))

# Documentation

module Language.PureScript.TypeChecker.Types

module Language.PureScript.TypeChecker.Synonyms

module Language.PureScript.TypeChecker.Roles

module Language.PureScript.TypeChecker.Monad

module Language.PureScript.TypeChecker.Kinds

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

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)) #

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.