Documentation
¶
Overview ¶
Package types provides type system implementation
Index ¶
- Variables
- func Equal(l, r ale.Type) bool
- func MakeApplicable(first Signature, rest ...Signature) ale.Type
- func MakeCons(left, right ale.Type) ale.Type
- func MakeListOf(elem ale.Type) ale.Type
- func MakeObject(key ale.Type, value ale.Type) ale.Type
- func MakeRecord(fields ...Field) ale.Type
- func MakeTuple(elems ...ale.Type) ale.Type
- func MakeUnion(first ale.Type, rest ...ale.Type) ale.Type
- func MakeVectorOf(elem ale.Type) ale.Type
- type Any
- type Applicable
- type Basic
- type Field
- type ID
- type Literal
- type Object
- type Pair
- type Record
- type Signature
- type Union
Constants ¶
This section is empty.
Variables ¶
var ( BasicBoolean = makeBasic("boolean") BasicBytes = makeBasic("bytes") BasicKeyword = makeBasic("keyword") BasicProcedure = makeBasic("procedure") BasicNull = makeBasic("null") BasicNumber = makeBasic("number") BasicString = makeBasic("string") BasicSymbol = makeBasic("symbol") BasicList = makeBasic("list") BasicObject = makeBasic("object") BasicCons = makeBasic("cons") BasicVector = makeBasic("vector") BasicUnion = makeBasic("union") )
var BasicAny = &Any{
basic: makeBasic("any"),
}
Functions ¶
func MakeApplicable ¶
MakeApplicable declares an ApplicableType that will only allow an applicable value capable of the provided signature set
func MakeCons ¶
MakeCons declares a new PairType that will only allow a List with elements of the provided elem Type
func MakeListOf ¶
MakeListOf declares a new PairType that will only allow a BasicList with elements of the provided elem Type
func MakeObject ¶
MakeObject declares a new ObjectType that will only allow keys and values of the provided types
func MakeRecord ¶
MakeRecord declares a new RecordType that only allows a fixed set of Field entries, each being identified by a BasicKeyword and having a specified Type
func MakeTuple ¶
MakeTuple declares a new Type that will only allow a List or Vector with positional elements of the provided Types
Types ¶
type Any ¶
type Any struct {
// contains filtered or unexported fields
}
Any accepts a Value of any other Type
type Applicable ¶
type Applicable struct {
Basic
// contains filtered or unexported fields
}
Applicable describes a Type that can be the target of a function application. Such application may expose multiple Signatures to describe the various ways that the type can be applied
func (*Applicable) Name ¶
func (a *Applicable) Name() string
func (*Applicable) Signatures ¶
func (a *Applicable) Signatures() []Signature
type Literal ¶ added in v0.3.0
type Literal struct {
Basic
// contains filtered or unexported fields
}
type Object ¶
type Object struct {
Basic
// contains filtered or unexported fields
}
Object describes a typed set of Key/Value Pairs
type Pair ¶
type Pair struct {
Basic
// contains filtered or unexported fields
}
Pair describes a pair of typed Values
type Record ¶
type Record struct {
Basic
// contains filtered or unexported fields
}
Record describes an Object that allows a fixed set of fields, each of which has a keyword