[Haskell-cafe] Function const (Binding)

TKM temp.public at gmail.com
Sat Feb 7 18:24:27 EST 2009


Hello,

I've a small question about the function const. I'm a bit of confused about how it binds. Let me take the following expression as example:

const id 1 2

If I execute this expression, I will get as answer 2 with Helium. Now is my question, why doesn't it give me 1 as the answer? Because the type of id would be: a -> a. So first it would execute id 1 in my opinion. That gives us 1. And after executing const 1 2 it should give us 1.

Can somebody explain to me why it does not bind as I expect? (I know I can do: const (id 1) 2 to get what I want)

Thank you for your answers.

Greetz TKM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090208/97df2761/attachment.htm


More information about the Haskell-Cafe mailing list