On 06/09/2015 07:19 PM, Sergey Mironov wrote:
Hi. I am trying to write an [Error] monad. So far I've managed to
write the code (see below), which is rejected by the compiler

It's just a case of incompleteness in type inference. An extra annotation sorts it all out. In particular, this line of code

   val monad_error = fn [e ::: Type] => (mkMonad { Return = @@mreturn [e], Bind 
= @@mbind [e] })

can be changed to this one:
val monad_error = fn [e ::: Type] => (@@mkMonad [error e] { Return = @@mreturn [e], Bind = @@mbind [e] })


_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to