It is pattern recognition of the case for which the argument is zero. The function will return 1 if provided with 0, but will throw a non-exhaustive patterns in lambda exception for any other correctly typed input.
\0 -> 1 :: (Num a1, Num a, Eq a) => a -> a1Actually this is fairly interesting. I need to dig into it.On Sat, Aug 30, 2014 at 12:59 PM, Julius Gedvilas <xged90@gmail.com> wrote:
... my badOn Sat, Aug 30, 2014 at 12:58 PM, Karl Voelker <karl@karlv.net> wrote:
On Sat, Aug 30, 2014, at 02:32 AM, Julius Gedvilas wrote:3. Is it? GHCi does not recognize it.Prelude> :t \0 -> 1\0 -> 1 :: (Num a1, Num a, Eq a) => a -> a1_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners