Release 0.76.0
CSL language change: Pattern matches must be exhaustive
CSL pattern matches must now cover all potential cases. For instance, the following contract is no longer permitted:
contract c = \ 0 -> success
| 1 -> <*> e : Event then success
| 2 -> <*> e : Event then <*> e : Event then success
CSL provides the following message:
Missing cases: 3, 4, 5
CSL Visual Studio Code extension: Support for code completion
The CSL VSCode extension now provides completions for record projections, definitions, and record construction snippets.
Explicit type variable binders and type variables in type annotations
While CSL has always supported polymorphic 1 definitions, it has so far not been possible to write polymorphic type signatures. For example:
val my_id = \x -> x // my_id has type a -> a
val my_id2 : a -> a = \x -> x // Not allowed because a is not the name of a type
The second definition is now valid, but it requires the type variables to first be explicitly bound. Here are a few examples of how definitions can now be given type signatures.
// <a> explicitly puts a into scope of the type signature
val <a> myId : a -> a = \x -> x
// also valid
val <a> myId2 = \(x : a) -> x
// Multiple type variables can be bound
val <t, u> myConst : t -> u -> t = \x -> \_ -> x
// Contract and template definitions can also bind type variables
contract <a> myContract = \(x: a) -> success
template <a> MyTemplate (x: a) = success
- 1
The term “generic” is often used instead of polymorphic. The two terms can be considered equivalent here.
Corda version upgraded to 4.8
The Deon Digital CSL CorDapp now runs on Corda 4.8, which is the newest version as of May 28th, 2021. This version requires some operational changes when starting Corda nodes, please refer to the migration guide for details.