language-qux-0.2.0.0: Utilities for working with the Qux language

Copyright(c) Henry J. Wylde, 2015
LicenseBSD3
Maintainerpublic@hjwylde.com
Safe HaskellNone
LanguageHaskell2010

Language.Qux.Annotated.Exception

Contents

Description

Exceptions and utility functions.

Synopsis

Type exception

data TypeException Source

An exception that occurs during type checking. See Language.Qux.Annotated.TypeChecker.

Constructors

TypeException SourcePos String

A generic type exception with a position and message.

DuplicateFunctionName SourcePos Id

Indicates a function of the given name already exists.

DuplicateParameterName SourcePos Id

Indicates a parameter of the given name already exists.

InvalidFunctionCall SourcePos Int Int

Indicates the wrong number of arguments was passed to the function call.

MismatchedType SourcePos Id [Id]

Indicates a type mismatch.

pos :: TypeException -> SourcePos Source

Extracts the source position from the exception.

message :: TypeException -> String Source

Creates a human understandable message from the exception.