Link Details

Link 107845 thumbnail
User 249531 avatar

By ksh2dzone
via hcoding.blogspot.com
Submitted: Aug 27 2008 / 16:11

Pattern matching works best with built in facilities in the language, yet this was fun to implement. Basically a pattern matching statement(expression, computation) is of type Type1 => Type2 which means it get a value of type Type1 and returns a value of type Type2. We need a set of pairs of lambdas. Each pair consists of computations of type (Type1 => bool, Type1 => Type2). First item of this pair helps us to decide if we must execute the second part or not; ...
  • 2
  • 0
  • 154
  • 28

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (2)



Voters Against This Link (0)