Created
April 25, 2015 00:07
-
-
Save techtangents/5118dbb811f96a9a0d4d to your computer and use it in GitHub Desktop.
record pattern matching example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Pos2D = Pos2D { x : Int, y : Int } | |
area : Pos2D -> Int | |
area (Pos2D {x,y}) = x * y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment