Skip to content

Loading…

add default case for Pattern Matching #16

Merged
merged 1 commit into from

2 participants

@jokster

default case was not documented

@lrytz lrytz merged commit 15ac359 into lampepfl:gh-pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 25, 2013
  1. @jokster
Showing with 1 addition and 0 deletions.
  1. +1 −0 CheatSheet.md
View
1 CheatSheet.md
@@ -210,6 +210,7 @@ Here are a few example patterns
// xs to the tail. xs could be Nil or some other list.
case 1 :: 2 :: cs => ... // lists that starts with 1 and then 2
case (x, y) :: ps => ... // a list where the head element is a pair
+ case _ => ... // default case if none of the above matches
}
The last example shows that every pattern consists of sub-patterns: it
Something went wrong with that request. Please try again.