I'm trying to do one of the extended exercises in http://okmij.org/ftp/tagless-final/nondet-effect.html#no-functor and replace the int_t
type with 'a repr
. While trying to do this, I'm stuck on the following error:
Values do not match:
val cons : '_a repr -> '_a list_t -> '_a list_t
is not included in
val cons : 'a repr -> 'a list_t -> 'a list_t
my implementation of cons
looks like
let cons: 'a repr -> 'a list_t -> 'a list_t =
liftm2 (fun h t -> h::t)
which definitely has the right type. Why are these apparently identical types incompatible?