[Ur] anonymous function remains

Gergely Buday gbuday at gmail.com
Fri Sep 23 08:52:06 EDT 2011


Hi,

I get the following error message:

[gergoe at flagship sandbox]$ urweb mapm
/home/gergoe/local/sandbox/mapm.ur:12:45-12:56: Anonymous function
remains at code generation
Function:  (fn n : FFI(Basis.int) => 0)
:0:0-0:0: Anonymous function remains at code generation
Function:
(fn _ : {} => (let sources : list(source) = (UNBOUND_1 {}) in ({})))

which I do not see how to correct. The point would be to have a list
of source ints, bundled into a transaction monad to do operations
later. Probably my idea is mistaken.

[gergoe at flagship sandbox]$ cat mapm.ur
fun tabulate n f =
    let
        fun tabulate' k =
            if (k=n)
               then []
               else (f k) :: tabulate' (k+1)
     in
        tabulate' 0
    end

fun main () =
    sources <- List.mapM source (tabulate 12 (fn n => 0));
    return <xml/>

[gergoe at flagship sandbox]$ cat mapm.urp

$/list
mapm
[gergoe at flagship sandbox]$ cat mapm.urs
val main : {} -> transaction page

- Gergely



More information about the Ur mailing list