liboleg-2010.1.6: An evolving collection of Oleg Kiselyov's Haskell modules

Data.Numerals

Description

Illustration of the 2-order lambda-calculus, using Church numerals as an example. The example shows limited impredicativity

http://okmij.org/ftp/Haskell/types.html#some-impredicativity

Synopsis

Documentation

newtype N Source

Constructors

N (forall a. (a -> a) -> a -> a) 

succ :: N -> NSource

mul :: N -> N -> NSource

add :: N -> N -> NSource

exp :: N -> N -> NSource

exp2 :: N -> N -> NSource

f1 :: (forall a. a -> a) -> b -> bSource

Simpler illustrations of impredicativity

foo :: forall c notimportant. (c -> c) -> notimportantSource

newtype W Source

Constructors

W 

Fields

unW :: forall a. a -> a
 

f2 :: W -> b -> bSource