| This looks incredibly ambitious: - There are no booleans in the language! Conditionals can still succeed or fail, but failure is defined as returning zero values and success is defined as returning one or more values. - Verse uses a so-called 'lenient' evaluation strategy which is neither strict nor lazy, but somewhere in-between ("Everything is eventually evaluated, but only when it is ready") - an expression does not evaluate to a value (like in Haskell), but instead to a sequence of zero or more values - tries to bring functional logic programming into the mainstream - Verse uses an effect system for I/O instead of monads - A type in Verse is "simply a function". E.g. int is the identity function on integers, and fails otherwise This all looks very mind-bending to me (in a good way). Perhaps Verse will one day be as influential for PL design as Haskell has been. |
You can try this type of programming at home, say in JavaScript Make any result or argument be an Array. The problem with nulls goes away because "not there" is represented simply by an empty Array (a.k.a "sequence").
And you will not get null-errors because you can write:
You don't need to test whether filter() returns an empty array or not, the map() will work for empty arrays too but simply do nothing.This is in a sense "generalized programming" because you don't deal with individual values but always with collections of them. I sometimes wonder why I don't use this pattern more often.