Re:Show HN: Caramel – a modern syntax for the lambda calculus
by LightMachine on Sunday September 27, 2015 @11:14PM
(#10288759)
The point of ADT syntax is to allow deriving many functions on different data structures automatically. For example, lists and some functions can be defined as:
The very same definitions could be written more tersely as just:
Where Ctor/Getter/ZipWith/Size are proper derivers. It is possible because all the information you need is there, but it is very hard to come up with those derivers and I currently only have some very bloated derivers for Scott encoded structures, and none for Church encoded structures yet.
[ Parent
| on HN ]
Re:Show HN: Caramel – a modern syntax for the lambda calculus
by tikhonj on Monday September 28, 2015 @12:06AM
(#10288864)
Coincidentally, if you're thinking of adding pattern matching to the underlying calculus (not just as syntactic sugar), the book I mentioned in another comment (Pattern Calculus) is worth a look. The author explores what a language could look like of patterns were first-class and used to express arbitrary computations.
At the very least, it could be fun to have an extended version of the system (or a plugin of some sort, perhaps) using his ideas about pattern matching.
Re:Show HN: Caramel – a modern syntax for the lambda calculus
by javajosh on Monday September 28, 2015 @01:28PM
(#10291672)
Cool, thanks for the explanation. I guess I'm a little confused by the desire to "derive many functions on different data-structures automatically". What's the independant variable in this meta-function? It makes little sense to "automatically" define a type when one could argue that programming is the act of defining types! I guess my claim is that I want to express type as a named list of predicates that fold into a single predicate over 'and'.