gleamunison/elab_types
Types
pub type BuiltinName {
TInt
TFloat
TText
TList
}
Constructors
-
TInt -
TFloat -
TText -
TList
pub type ElaborateError {
NameNotFound(String)
UnknownOperation(ability: String, op: String)
MissingAbilityDecl(String)
InferFailed(message: String)
UnsupportedTypeRef(description: String)
}
Constructors
-
NameNotFound(String) -
UnknownOperation(ability: String, op: String) -
MissingAbilityDecl(String) -
InferFailed(message: String) -
UnsupportedTypeRef(description: String)
pub type SCase {
SCase(
pattern: SPattern,
guard: option.Option(SurfaceTerm),
body: SurfaceTerm,
)
}
Constructors
-
SCase( pattern: SPattern, guard: option.Option(SurfaceTerm), body: SurfaceTerm, )
pub type SurfaceDef {
SurfaceTermDef(SurfaceTerm)
SurfaceTypeDef(Typ)
SurfaceAbilityDef(name: String, ops: List(SurfaceOp))
SurfaceTypeAlias(name: String, target: Typ)
SurfacePubTypeAlias(name: String, target: Typ)
}
Constructors
-
SurfaceTermDef(SurfaceTerm) -
SurfaceTypeDef(Typ) -
SurfaceAbilityDef(name: String, ops: List(SurfaceOp)) -
SurfaceTypeAlias(name: String, target: Typ) -
SurfacePubTypeAlias(name: String, target: Typ)
pub type SurfaceTerm {
SInt(Int)
SFloat(Float)
SText(BitArray)
SList(List(SurfaceTerm))
SVar(String)
SRef(identity.DefinitionRef)
SApply(function: SurfaceTerm, arg: SurfaceTerm)
SLambda(param: String, body: SurfaceTerm)
SLet(name: String, value: SurfaceTerm, body: SurfaceTerm)
SMatch(scrutinee: SurfaceTerm, cases: List(SCase))
SDo(
ability: String,
operation: String,
args: List(SurfaceTerm),
)
SHandle(
computation: SurfaceTerm,
handler: SurfaceTerm,
ability: String,
)
SConstruct(name: String, args: List(SurfaceTerm))
SLabeledFn(
params: List(#(String, SurfaceTerm)),
body: SurfaceTerm,
)
SHole
SGuardGuard(guard: SurfaceTerm)
SUse(binder: String, call: SurfaceTerm, body: SurfaceTerm)
}
Constructors
-
SInt(Int) -
SFloat(Float) -
SText(BitArray) -
SList(List(SurfaceTerm)) -
SVar(String) -
SRef(identity.DefinitionRef) -
SApply(function: SurfaceTerm, arg: SurfaceTerm) -
SLambda(param: String, body: SurfaceTerm) -
SLet(name: String, value: SurfaceTerm, body: SurfaceTerm) -
SMatch(scrutinee: SurfaceTerm, cases: List(SCase)) -
SDo(ability: String, operation: String, args: List(SurfaceTerm)) -
SHandle( computation: SurfaceTerm, handler: SurfaceTerm, ability: String, ) -
SConstruct(name: String, args: List(SurfaceTerm)) -
SLabeledFn( params: List(#(String, SurfaceTerm)), body: SurfaceTerm, ) -
SHole -
SGuardGuard(guard: SurfaceTerm) -
SUse(binder: String, call: SurfaceTerm, body: SurfaceTerm)
pub type SurfaceUnit {
SurfaceUnit(
root: identity.DefinitionRef,
defs: List(#(String, SurfaceDef)),
)
}
Constructors
-
SurfaceUnit( root: identity.DefinitionRef, defs: List(#(String, SurfaceDef)), )
pub type Typ {
TVar(String)
TCon(identity.DefinitionRef)
TFun(params: List(Typ), result: Typ)
TBuiltin(BuiltinName)
}
Constructors
-
TVar(String) -
TCon(identity.DefinitionRef) -
-
TBuiltin(BuiltinName)