[Haskell-cafe] Function const (Binding)

Tony Morris tmorris at tmorris.net
Sat Feb 7 18:28:40 EST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maybe it will help with parentheses:
(const id 1) 2

(const id 1) ignores the second argument and yields the id function so
then
id 2

which is just 2.

TKM wrote:
> 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
>
> ----------------------------------------------------------------------
>
>
> _______________________________________________ Haskell-Cafe
> mailing list Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

- --
Tony Morris
http://tmorris.net/

************************************
* Anteromedial Osseous Impingement *
************************************

http://www.ajronline.org/cgi/content/full/178/3/601
"can result in chronic ankle pain, especially in athletes and the
younger population (15-40 years old)"

http://radiographics.rsnajnls.org/cgi/content/figsonly/22/6/1457
"Soft-tissue and osseous impingement syndromes of the ankle can be an
important cause of chronic pain, particularly in the professional
athlete."

1. Take any person with soft tissue and osseous joint impingement from
trauma
2. Surgically tighten the joint ligaments particularly those in the
area of impingement.
3. When the patient complains of incredible and permanent pain, shrug
your shoulders.

Outcome
You'll find the patient at the mental hospital bordering psychosis.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJjhkomnpgrYe6r60RAmvtAKDBQxNAlc2tfN283vcvs5gkzXUEjwCgpw7s
CcGAha7L6AgHESzwLSoD2XU=
=szrP
-----END PGP SIGNATURE-----



More information about the Haskell-Cafe mailing list