otherwise is in the area of ββthe template l@ (x:xs) , which can only match a non-empty string. This can help to see what this (effectively) translates into internally:
guardMatch l = case l of (x :xs) -> if x == '-' then "negative " ++ xs else l patternMatch l = case l of ('-':xs) -> "negative " ++ xs _ -> l
(Actually, I think that if translates to case + guard, not the other way around).
source share