You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

511 B

Exercises: Parametricity

  1. As said this is impossible. A function which takes any type and returns that same type can't be anything else. As soon as you choose something else, you pose limitations on the type. E.g. square x = x * x requires that x can be applied to (*), which means it has to be of type Num at least.\
  2. The only possibilies are to return either the first or the second argument.
  3. fst' a1 a2 = a1
  4. snd' a1 a2 = a2
  5. Here there is only one possiblity: snd'' a b = b.