-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Unsure if this is the best format/place for a new proposal (or if I should, say, create a Wiki page). If there's something else I should do, please let me know!
Often, it is useful to have access to an empty "void" type. A simple proposal might look like this:
signature VOID =
sig
type void
type t = void
val absurd : t -> 'a
end
structure Void :> VOID =
struct
datatype void = Void of void
type t = void
fun absurd (Void v) = absurd v
end
Perhaps a few other auxiliary functions could be useful, as well. For example:
val fail : string -> t (* raises `Fail` *)
val asLeft : ('a,t) either -> 'a
val asRight : (t,'a) either -> 'a
Metadata
Metadata
Assignees
Labels
No labels