[Ur] 'Anonymous function remains at code generation' error

Marko Schütz Schmuck markoschuetz at googlemail.com
Mon Feb 20 15:52:15 EST 2017


I'm trying to get the text from a blob. Following Adam's helpful
comment, I'm now trying the FFI route.

With
git at github.com:MarkoSchuetz/urweb-blobText.git

and

fun echo (r : {File : file}) : transaction string =
  if blobSize (fileData r.File) > 100000 then
      return "Whoa!  That one's too big."
  else
      return (BlobText.blobText (fileData r.File))

fun echoLength (r : {File : file}) : transaction page =
    s <- echo r ;
    return <xml>{[String.length s]}</xml>

fun main () : transaction page
  = return <xml><body>
  <h1>The Amazing File Echoer!</h1>

  <form>Upload a file: <upload{#File}/> <submit action={echoLength}/></form>
</body></xml>

I am now getting

...sandbox/myUpload.ur:3:6: (to 3:41) Anonymous function remains at code generation
Function:  (fn _ : {} => "Whoa!  That one's too big.")
/usr/local/lib/urweb/ur/basis.urs:122:0: (to 124:24) Anonymous function remains at code generation
Function:  (fn _ : {} => UNBOUND_1)

Where is my mistake?

Thanks,

Marko
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP Digital Signature
URL: <http://www.impredicative.com/pipermail/ur/attachments/20170220/52bbab19/attachment.sig>


More information about the Ur mailing list