Your intuition that id is related to const is a good one, since id can
be defined in terms of const. Here is one of many:
id' = flip const const
[This is also called a CKK combinator. See
http://en.wikipedia.org/wiki/S_combinator#Combinatory_calculi for more
examples, such as SKK, SKS, and va
t;[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
10/15/2007 06:56 PM
To
haskell-cafe@haskell.org
cc
Subject
[Haskell-cafe] Equality Question
Hi
is const = id?
const 'x' 'y'
'x'
id 'x'
'x'
Cheers,
Paul
]>
Sent by: [EMAIL PROTECTED]
10/15/2007 06:56 PM
To
haskell-cafe@haskell.org
cc
Subject
[Haskell-cafe] Equality Question
Hi
is const = id?
const 'x' 'y'
'x'
id 'x'
'x'
Cheers,
Paul
___
Hask
PR Stanley wrote:
is const = id?
No, const is saturated with 2 arguments, id with 1.
const 1 2 -> 1
id 1 2 -> type error
http://www.haskell.org/mailman/listinfo/haskell-cafe
On 10/15/07, PR Stanley <[EMAIL PROTECTED]> wrote:
> Hi
> is const = id?
You answered the question yourself
> const 'x' 'y'
> 'x'
> id 'x'
> 'x'
const has another parameter. Their types are
id:: a -> a
const :: a -> b -> a
HTH,
--
Felipe.
___
H
Hi
is const = id?
const 'x' 'y'
'x'
id 'x'
'x'
Cheers,
Paul
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe