match expressions


somewhat like


"switch - case" function in C


match <expression> with <match>


e.g.

match <expression> with 

<pattern 1> -> <expression1> |

<pattern 2> -> <expression2> |

...

<pattern N> -> <expression N>





when you get a warning that says,


"this pattern-matching is not exhaustive"


what it means is that it does not cover "all possibilities"


to which you may add


| _ -> something



"| _ "


this means "anything else not specified"




WRITTEN BY
서상호

,