std/core/exn▲toc

Standard exception (exnstd/core/exn/exn: (E, V) -> V) effect.

.

alias errorstd/core/exn/error: V -> V<a> = resultstd/core/types/result: (V, V) -> V<a,exceptionstd/core/exn/exception: V>

An errorstd/core/exn/error: V -> V<a> type represents a first-class exception result as a resultstd/core/types/result: (V, V) -> V<a,exceptionstd/core/exn/exception: V>.

struct exceptionstd/core/exn/exception: V(message : stringstd/core/types/string: V, info : exception-infostd/core/exn/exception-info: V)

The exception data type.

Automatically generated. Retrieves the info constructor field of the exceptionstd/core/exn/exception: V type.

Automatically generated. Retrieves the message constructor field of the exceptionstd/core/exn/exception: V type.

Show the exception message.

type open exception-infostd/core/exn/exception-info: V

Exception information.

Generic error.

con ExnTodo
type exnstd/core/exn/exn: (E, V) -> V<e,a>

Exceptions.

fun error/map( err : errorstd/core/exn/error: V -> V<a>, f : (a) -> e b ) : e errorstd/core/exn/error: V -> V<b>
fun error/try( action : () -> <exnstd/core/exn/exn: (E, V) -> V|e> a ) : e errorstd/core/exn/error: V -> V<a>

Transform an exception effect to an errorstd/core/exn/error: V -> V type.

fun handle/try( hndl : (exceptionstd/core/exn/exception: V) -> e a, action : () -> <exnstd/core/exn/exn: (E, V) -> V|e> a ) : e a

Catch any exception raised in action and handle it. Use on-exitstd/core/exn/on-exit: forall<a,e> (hndler : () -> e (), action : () -> e a) -> e a when appropriate.

fun catch( hndl : (exceptionstd/core/exn/exception: V) -> e a, action : () -> <exnstd/core/exn/exn: (E, V) -> V|e> a ) : e a

deprecated. Catch an exception raised by throwstd/core/exn/throw: forall<a> (message : string, info : ? exception-info) -> exn a and handle it.

fun error-pattern( location : stringstd/core/types/string: V, definition : stringstd/core/types/string: V ) : exnstd/core/exn/exn: (E, V) -> V a

Raise a pattern match exception. This is function is used internally by the compiler to generate error messages on pattern match failures.

fun exn-error-range(): exnstd/core/exn/exn: (E, V) -> V a
fun on-exit( hndler : () -> e (), action : () -> e a ) : e a

Set a hndler that is always called when the action finishes (either normally or with an exception).

fun throw( message : stringstd/core/types/string: V, info : ? exception-infostd/core/exn/exception-info: V ) : exnstd/core/exn/exn: (E, V) -> V a

Throw an exception with a specified message.

fun try-exn-map( f : (exceptionstd/core/exn/exception: V) -> exceptionstd/core/exn/exception: V, action : () -> <exnstd/core/exn/exn: (E, V) -> V|e> a ) : <exnstd/core/exn/exn: (E, V) -> V|e> a
fun try-exn-prepend( pre : stringstd/core/types/string: V, action : () -> <exnstd/core/exn/exn: (E, V) -> V|e> a ) : <exnstd/core/exn/exn: (E, V) -> V|e> a
fun untry( err : errorstd/core/exn/error: V -> V<a> ) : exnstd/core/exn/exn: (E, V) -> V a

Transform an exception result type back to an exn effect (by throwing on an Errorstd/core/types/Error: forall<a,b> (error : b) -> result<a,b>).

private import std/core/typesstd/core/types, std/core/hndstd/core/hnd