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.

On Aug 30, 2014 1:06 PM, "Julius Gedvilas" <xged90@gmail.com> wrote:
\0 -> 1 :: (Num a1, Num a, Eq a) => a -> a1

Actually 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 bad


On 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