Hi
> So what I noticed that "A Gentle Introduction to Haskell" mentioned
> that wild-cards are useful in constructors. For example:
>
> head (x:_) = x
>
> So, does that offer any performance benefits over:
>
> head (x:xs) = x
No. They are exactly the same. _ simply means "a new unique name".
> O
So what I noticed that "A Gentle Introduction to Haskell" mentioned
that wild-cards are useful in constructors. For example:
head (x:_) = x
So, does that offer any performance benefits over:
head (x:xs) = x
Or is it primarily to indicate to the coder that xs is useless? I get
the impressio
Hello everyone, I've been working on improving my Haskell knowledge,
and in doing so, I have read a little about as-patterns as well as
some form of pattern that uses "~" that I don't really understand. I
suspect there are even more lesser-known pattern matching expressions
than just these,