Ivan Miljenovic wrote:
On 28 May 2010 15:18, wren ng thornton w...@freegeek.org wrote:
Stefan Monnier wrote:
churchedBool :: t - t - t
Important detail: the precise type is ∀t. t → t → t.
encodeBool x = \t e - if x then t else e
So the type of encodeBool should be:
Bool → ∀t. t → t → t
On Thu, May 27, 2010 at 9:11 PM, Stefan Monnier
monn...@iro.umontreal.ca wrote:
I.e. to make such an encoding really usable, you need deep
polymorphism (which GHC supports just fine, but which is not part of
the Haskell standard).
Ah, yes, and thank you for pointing that out. My message
Stefan Monnier wrote:
churchedBool :: t - t - t
Important detail: the precise type is ∀t. t → t → t.
encodeBool x = \t e - if x then t else e
So the type of encodeBool should be:
Bool → ∀t. t → t → t
whereas Haskell will infer it to be
∀t. Bool → t → t → t
Those are the same type.
On 28 May 2010 15:18, wren ng thornton w...@freegeek.org wrote:
Stefan Monnier wrote:
churchedBool :: t - t - t
Important detail: the precise type is ∀t. t → t → t.
encodeBool x = \t e - if x then t else e
So the type of encodeBool should be:
Bool → ∀t. t → t → t
whereas Haskell will