[Ur] Implementing StateMonad transformer

Adam Chlipala adamc at csail.mit.edu
Thu Dec 12 08:41:48 EST 2013


On 12/12/2013 06:16 AM, Sergey Mironov wrote:
> Haskell version allows it by defining
> third datatype parameter with kind (Type ->  Type). But looks like it
> wouldn't work for Ur/Web since UrWeb accepts only Type kinds in this
> place (but I may have missed some syntax):
>
> datatype state m st a = State of (st ->  m (st * a))
>    

Yeah, datatypes are currently hardcoded to accept only [Type] arguments, 
which is pretty arbitrary.  Maybe some day I'll be motivated to 
generalize. ;)

You can still abstract a datatype over arbitrary kinds using functors 
(in the module system), though.  Let me know if that isn't a clear 
enough hint!



More information about the Ur mailing list