[Haskell-beginners] case statement
Daniel Trstenjak
daniel.trstenjak at gmail.com
Tue Jul 7 10:36:04 UTC 2015
Hi Imants,
On Tue, Jul 07, 2015 at 12:28:58PM +0200, Imants Cekusins wrote:
> ok with a small tweak I can see "case" a1 value is x:
>
> result1 x = case x of
> a1 -> trace (show a1) "one"
> 2 -> "two"
'a1' is new variable which is always bound to the value of 'x' and this
case is always matching.
You should also get a warning for this:
Warning:
Pattern match(es) are overlapped
In a case alternative: 2 -> ...
Greetings,
Daniel
More information about the Beginners
mailing list