Ich habe diesen Schnipsel des Codes in ML:polymorphe Listen in ML
local
fun unfolder([] , n) = []
| unfolder(l::ls, n) = (n, l) :: unfolder(ls, n)
in
fun flat list = unfolder(list, 1)
end;
es mir einen Fehler gibt:
unexpected exception (bug?) in SML/NJ: EA [EA]
raised at: ../../MLRISC/x86/mltree/x86.sml:417.32-417.34
../compiler/Basics/stats/stats.sml:198.40
../compiler/Basics/stats/stats.sml:198.40
../compiler/Basics/stats/stats.sml:198.40
../compiler/TopLevel/interact/evalloop.sml:44.55
aber wenn ich its (n, l) to (n, l:int)
ändere es funktioniert, und wenn zu (n, l:'a)
, kann jemand bitte erklären, warum polymorphe Art nicht funktioniert, danke im Voraus