Square Brackets
We're making a big change to the Acorn syntax: using square brackets for type parameters, instead of angle brackets.
Before:
inductive List<T> {
nil
cons(T, List<T>)
}
After:
inductive List[T] {
nil
cons(T, List[T])
}
Posts about the Acorn language, like new keywords or syntax.
View All TagsWe're making a big change to the Acorn syntax: using square brackets for type parameters, instead of angle brackets.
Before:
inductive List<T> {
nil
cons(T, List<T>)
}
After:
inductive List[T] {
nil
cons(T, List[T])
}
Typeclasses in Acorn provide a powerful way to define common behaviors across different types. But what happens when you need to build upon existing typeclasses? Today, we're introducing typeclass extension.
Since launching the Acorn beta, we've heard consistent feedback from mathematicians that they need a powerful type system to represent their favorite area of mathematics.
Today, we're releasing two big improvements to Acorn's type system. The first is typeclasses.
We've deployed a new version of the Acorn Prover, 0.0.5, with support for a commonly requested feature: generic types. For example, the standard library now has a Pair structure:
structure Pair[T, U] {
first: T
second: U
}