[Ur] Given a value of a "transactional" type, how can it be used in an expression expecting a different, "non-transactional" type?

Adam Chlipala adamc at csail.mit.edu
Sat Jul 18 16:39:04 EDT 2015


On 07/18/2015 03:44 PM, Stefan Scott Alexander wrote:
> Apparently these compile errors are happening because:
>
> - My code instantiates functions Show, Widget, WidgetPopulated and 
> Parse, which are defined in crud.urs / crud.ur (in the Crud2 demo) and 
> which are expected to return values of type xbody, xml, and db;
>
> - Meanwhile, my code uses Top.queryX1 and Top.oneRowE1 which return 
> values of "transactional" types - instead of the desired types xbody, 
> xml and db.

I haven't read all the details of your issue report, but I think you're 
running into one of the standard "newbie" problems with monadic IO, in 
common with Haskell.  It is /intended/ that the code you're writing can 
never be accepted in the fields where you're trying to put it.  Some 
fields are explicitly /not/ given [transaction] types because they are 
not supposed to be able to cause side effects.  Allowing them to cause 
side effects would require changes to their types.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150718/9c696673/attachment.html>


More information about the Ur mailing list