2014년 12월 29일 월요일

[CoffeeScript] Haskell's Pattern Matching in CoffeeScript

Here's a Lambda Calculus interpreter in CoffeeScript, where a utility called 'match' approximates Haskell's pattern matching syntax. Here's a Haskell version for comparison.

The "match" utility might be a nice feature to have in the CoffeeScript language itself. Here's a summary of the proposed idea.



Here's an example of polymorphic type matching for CoffeeScript Classes, useful for functional parser/evaluator projects. Thought this group may be interested in the idea.



There is a library which provides a way to write pattern-matching constructions (like in Erlang or Haskell) in coffeescript without precompilation. You can find it here: https://github.com/nogizhopaboroda/f_context


댓글 없음:

댓글 쓰기