Skip to content

Instantly share code, notes, and snippets.

@taksuyu
Last active August 29, 2015 14:12
Show Gist options
  • Save taksuyu/9d888bf4c2c3623a1c9d to your computer and use it in GitHub Desktop.
Save taksuyu/9d888bf4c2c3623a1c9d to your computer and use it in GitHub Desktop.
pattern matching a constructor
data Test = Test | NotTest | StillNotTest deriving Show
testFuction a@Test {} = a
testFuction _ = NotTest
{-
Test -> Test
NotTest -> NotTest
StillNotTest -> NotTest
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment