Sorry for not getting around to the original question yet. As with Haskell, we still consider memory-allocating code pure. However, in C, use function uw_malloc() to allocate the memory, so that the Ur/Web runtime system can reclaim the memory automatically.

I don't remember right now why that 'effectful' annotation would have this effect, in detail, but it must be because certain program simplifications conservatively refuse to touch effectful code.


On 02/22/2017 01:32 PM, Marko Schütz Schmuck wrote:
[sorry for not continuing the thread: I was having some issues with my
subscription to the mailing list and did not receive list emails.]

In lib.urp of blobText I had marked BlobText.blobText as
effectful since it allocates memory. With the effectful annotation I
got the error

Anonymous function remains at code generation

When I remove the annotation it compiles without error.

Is effectful used correctly in this way?
If this is so, what can I do to get the compiler to accept the source
code? I had tried decomposing and annotating some types in the hope
that this was an issue with the type checker that could be solved this
way...
How should the allocated memory be released?
Or is effectful not needed here? Why?

Thanks,

Marko

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

Reply via email to