disco-0.1.5: Functional programming language for teaching discrete math.
Copyrightdisco team and contributors
LicenseBSD-3-Clause
Maintainerbyorgey@gmail.com
Safe HaskellNone
LanguageHaskell2010

Disco.Error

Description

Type for collecting all potential Disco errors at the top level, and a type for runtime errors.

Synopsis

Documentation

data DiscoError where Source #

Top-level error type for Disco.

Constructors

ModuleNotFound :: String -> DiscoError

Module not found.

CyclicImport :: [ModuleName] -> DiscoError

Cyclic import encountered.

TypeCheckErr :: LocTCError -> DiscoError

Error encountered during typechecking.

ParseErr :: ParseErrorBundle String DiscoParseError -> DiscoError

Error encountered during parsing.

EvalErr :: EvalError -> DiscoError

Error encountered at runtime.

Panic :: String -> DiscoError

Something that shouldn't happen; indicates the presence of a bug.

Instances

Instances details
Show DiscoError Source # 
Instance details

Defined in Disco.Error

Pretty DiscoError Source # 
Instance details

Defined in Disco.Error

Methods

pretty :: forall (r :: EffectRow). Members '[Reader PA, LFresh] r => DiscoError -> Sem r Doc Source #

data EvalError where Source #

Errors that can be generated at runtime.

Constructors

UnboundError :: QName core -> EvalError

An unbound name was encountered.

UnboundPanic :: Name core -> EvalError

An unbound name that really shouldn't happen, coming from some kind of internal name generation scheme.

DivByZero :: EvalError

Division by zero.

Overflow :: EvalError

Overflow, e.g. (2^66)!

NonExhaustive :: EvalError

Non-exhaustive case analysis.

InfiniteLoop :: EvalError

Infinite loop detected via black hole.

Crash :: String -> EvalError

User-generated crash.

Instances

Instances details
Show EvalError Source # 
Instance details

Defined in Disco.Error