1 // Various versions of the identity function
3 // Identity for integers
4 // The type signature forces the function to have a more concrete type than it could have.
5 id_int(x) :: Int -> Int
11 // Polymorphic identity with type signature
12 id_poly_with(x) :: a -> a
18 //// Polymorphic identity without type signature
19 //// Type checking should figure out the type forall a . a -> a
26 // Clumsy polymorphic identity
27 // Type checking should give type forall a . a -> a
28 id_poly_wtf(x) :: a -> a
37 //// Clumsy identity for integers
38 //// Type checking should give type Int -> Int