
Hi, Am Sonntag, den 08.11.2015, 09:30 +0000 schrieb Tom Ellis:
Simon's code is inadvisable, in my opinion. It is
f xs | null xs = blah | otherwise = x+1 where (x:_) = xs
where it really should be
f xs = case xs of [] -> blah (x:_) -> x + 1
yes, in this particular, small example But often you have complex decisions in the guards that are not obviously related to the pattern match, and the where-bound and partially-pattern-matched value are used in multiple branches of the guard. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org