component factorial (* Bugs: Uses 64-bit signed ints instead of unlimited nats (which are not yet implemented); thus breaks at about 13!. Comments have render bugs, so this was removed. *) import List.{...} export Executable (* string_to_ZZ64(s:String):ZZ64 = do nlist = <| digit | digit <- s |>.reverse() numerals = <| n | n <- "0123456789" |> SUM[x <- 0:(|nlist| - 1)] numerals.indexOf(nlist[x]) 10^x end *) run (args:String...):() = do -- n = string_to_ZZ64(args[0]) n = n.cast(ZZ64) fact = n! println(fact) end end