├── .github └── workflows │ └── main.yml ├── .gitignore ├── Dockerfile ├── Makefile.in ├── Makefiledefault ├── NEWS.md ├── NEWS_SMLTOJS.md ├── README.md ├── README_BARRY.md ├── README_SMLTOJS.md ├── aclocal.m4 ├── autobuild ├── basis ├── .gitignore ├── ARRAY.sig ├── ARRAY2.sig ├── ARRAYSORT.sig ├── ARRAY_SLICE.sml ├── Array.sml ├── Array2.sml ├── ArraySlice.sml ├── Arraysort.sml ├── BINARYMAP.sig ├── BINARYSET.sig ├── BIN_IO.sml ├── BIT_FLAGS.sml ├── BOOL.sig ├── BYTE.sig ├── BinIO.sml ├── Binarymap.sml ├── Binaryset.sml ├── BitFlags.sml ├── Bool.sml ├── Byte.sml ├── ByteSlice.sml ├── ByteTable-1997.sml ├── ByteTable.sml ├── CHAR.sig ├── COMMAND_LINE.sml ├── Char.sml ├── CommandLine.sml ├── DATE.sig ├── DYNLIB.sig ├── Date.sml ├── Dynlib.sml ├── FORK_JOIN.sig ├── FileSys-1997.sml ├── FileSys.sml ├── ForkJoin-reml.sml ├── ForkJoin.sml ├── ForkJoinSeq.sml ├── GENERAL.sig ├── GENERIC_SOCK.sml ├── General.sml ├── IEEEReal.sml ├── IEEE_REAL.sig ├── INET_SOCK.sig ├── INTEGER.sml ├── INTMAP.sig ├── INTSET.sig ├── INT_INF.sml ├── INT_INF_REP.sml ├── IO.sml ├── Initial.sml ├── Initial2.sml ├── Int.sml ├── Int31.sml ├── Int32.sml ├── Int63.sml ├── Int64.sml ├── IntInf.sml ├── IntInfRep.sml ├── IntN.sml ├── Intmap.sml ├── Ints.sml ├── Intset.sml ├── LIST.sig ├── LISTSORT.sig ├── LIST_PAIR.sml ├── List.sml ├── ListPair.sml ├── Listsort.sml ├── MATH.sig ├── MD5.sig ├── MIT_LICENSE ├── MONO_ARRAY-1997.sml ├── MONO_ARRAY.sml ├── MONO_ARRAY2.sml ├── MONO_ARRAY_SLICE.sml ├── MONO_VECTOR-1997.sml ├── MONO_VECTOR.sml ├── MONO_VECTOR_SLICE.sml ├── Makefile ├── Math.sml ├── NET_HOST_DB.sig ├── NetHostDB.sml ├── OPTION.sig ├── OS.sml ├── OS_FILE_SYS.sml ├── OS_IO.sml ├── OS_PATH-1997.sml ├── OS_PATH.sml ├── OS_PROCESS.sml ├── Option.sml ├── PACK_REAL.sml ├── PACK_WORD.sml ├── POLYHASH.sig ├── POSIX.sig ├── POSIX_ERROR.sml ├── POSIX_FILE_SYS.sml ├── POSIX_IO.sml ├── POSIX_PROCESS.sml ├── POSIX_PROC_ENV.sig ├── POSIX_SIGNAL.sml ├── POSIX_SYS_DB.sml ├── POSIX_TTY.sml ├── Pack32Big.sml ├── Pack32Little.sml ├── PackRealBig.sml ├── PackRealLittle.sml ├── Path-1997.sml ├── Path.sml ├── Polyhash.sml ├── Posix.sml ├── PosixStat.sml ├── Prim.sml ├── Process.sml ├── RANDOM.sig ├── REAL.sig ├── REAL64_BLOCK_BASE.sml ├── REG_EXP.sml ├── Random.sml ├── Real.sml ├── Real64Blocks.sml ├── RegExp.sml ├── SML90.sml ├── SOCKET.sig ├── SPLAYMAP.sig ├── SPLAYSET.sig ├── SPLAYTREE.sig ├── STRING.sig ├── STRING_CVT.sml ├── STR_BASE.sml ├── SUBSTRING.sig ├── SUSP.sig ├── Socket.sml ├── Splaymap.sml ├── Splayset.sml ├── Splaytree.sml ├── StrBase.sml ├── String.sml ├── StringCvt.sml ├── Substring.sml ├── Susp.sml ├── TEXT.sig ├── TEXT_IO-1997.sml ├── TEXT_IO.sml ├── THREAD.sig ├── TIME.sig ├── TIMER-1997.sig ├── TIMER.sig ├── TableSlice.sml ├── Text.sml ├── TextIO-1997.sml ├── TextIO.sml ├── Thread-reml.sml ├── Thread.sml ├── ThreadSeq.sml ├── Time.sml ├── Timer-1997.sml ├── Timer.sml ├── UNIX.sig ├── UNIX_SOCK.sml ├── Unix.sml ├── VECTOR.sig ├── VECTOR_SLICE.sml ├── Vector.sml ├── VectorSlice.sml ├── WORD.sig ├── Word.sml ├── Word16.sml ├── Word31.sml ├── Word32.sml ├── Word63.sml ├── Word64.sml ├── Word8.sml ├── WordN.sml ├── basis-1997.mlb ├── basis.mlb ├── binarymap.mlb ├── dynlink.mlb ├── inttables.sml ├── io │ ├── .gitignore │ ├── bin-io.sig │ ├── bin-io.sml │ ├── bin-prim-io.sml │ ├── bin-stream-io.sig │ ├── cleaner.sig │ ├── cleaner.sml │ ├── imperative-io.sig │ ├── imperative-io.sml │ ├── io-close.sml │ ├── io.sig │ ├── io.sml │ ├── prim-io.sig │ ├── prim-io.sml │ ├── stream-io.sig │ ├── stream-io.sml │ ├── text-io.sig │ ├── text-io.sml │ ├── text-prim-io.sml │ └── text-stream-io.sig ├── kitlib.mlb ├── listsort.mlb ├── md5.mlb ├── par-reml.mlb ├── par-seq.mlb ├── par.mlb ├── polytable.sml ├── real64_blocks.mlb ├── repl.mlb ├── repl.sml ├── web │ ├── DbFunctor.sml │ ├── HTML.sig │ ├── Html.sml │ ├── MSP.sig │ ├── Msp.sml │ ├── Quot.sml │ ├── WEB.sig │ ├── WEB_CACHE.sml │ ├── WEB_CONN.sml │ ├── WEB_COOKIE.sml │ ├── WEB_DB.sml │ ├── WEB_DB_BIND.sml │ ├── WEB_DB_HANDLE.sml │ ├── WEB_DYNLIB.sml │ ├── WEB_INFO.sml │ ├── WEB_LOG.sml │ ├── WEB_LOW_MAIL.sml │ ├── WEB_MAIL.sml │ ├── WEB_MIME.sml │ ├── WEB_SERIALIZE.sml │ ├── WEB_SET.sml │ ├── WEB_STRING_CACHE.sml │ ├── Web.sml │ ├── WebDbLow.sml │ ├── WebDynlib.sml │ ├── WebInfo.sml │ ├── WebLowMail.sml │ ├── WebSerialize.sml │ ├── lib.mlb │ └── xmlrpc │ │ ├── Parsercomb.sig │ │ ├── Parsercomb.sml │ │ ├── WSeq.sig │ │ ├── WSeq.sml │ │ ├── XMLRPC.sig │ │ ├── XMLRPC_TYPE.sig │ │ ├── XMLrpc.sml │ │ └── xmlrpc.mlb ├── wordtable-functors.sml └── wordtables.sml ├── configure.ac ├── doc ├── .gitignore ├── license │ ├── CODEMIRROR-LICENSE │ ├── GPL-LICENSE │ ├── MLKit-LICENSE │ ├── MLton-HPND-LICENSE │ ├── MLton-LICENSE │ ├── SMLNJ-LIB-LICENSE │ ├── SMLNJ-LICENSE │ ├── X-LICENSE │ └── copyright.att ├── manual │ ├── Makefile │ ├── README │ ├── genericmac.tex │ ├── length_region.pdf │ ├── length_stack.pdf │ ├── life200.pdf │ ├── life80.pdf │ ├── life_ex2.pdf │ ├── life_ex3.pdf │ ├── life_ex4.pdf │ ├── mac.tex │ ├── mlkit-logo.png │ ├── mlkit.bib │ ├── mlkit.tex │ ├── mlkit_compiling_kitkbjul9.pdf │ ├── mlkit_compiling_kitkbjul9_400msec.pdf │ ├── msort.pdf │ ├── msortregion.pdf │ ├── msortreset2.pdf │ ├── msortstack.pdf │ ├── nlength_region.pdf │ ├── nlength_stack.pdf │ ├── prof_eks1.pdf │ ├── prof_eks2.pdf │ ├── prof_eks3.pdf │ ├── prof_eks4.pdf │ ├── scan.pdf │ ├── scan_posix.pdf │ ├── scan_rev1_1.pdf │ ├── scan_rev1_2.pdf │ ├── scan_rev2_1.pdf │ ├── scan_stream.pdf │ └── scan_stream_nogc.pdf └── mlkit.pdf ├── install-sh ├── js ├── .gitignore ├── MIT_LICENSE ├── Makefile ├── appfun │ ├── .gitignore │ ├── AppFun.sml │ ├── AppFun2.mlb │ ├── AppFun2.sml │ ├── appfun.mlb │ ├── appfunstyle.css │ ├── dropbox.png │ ├── dropbox.sig │ ├── dropbox.sml │ ├── json.mlb │ ├── json.sig │ ├── json.sml │ ├── nodropbox.png │ ├── oauth.mlb │ ├── oauth.sig │ ├── oauth.sml │ ├── smltojs_logo_no_text.png │ ├── smltojs_logo_no_text256x256.png │ ├── smltojs_logo_no_text64x64.png │ ├── string_map.sml │ └── style.css ├── base.css ├── basis │ ├── .gitignore │ ├── ARRAY.sig │ ├── ARRAY2.sig │ ├── ARRAY_SLICE.sml │ ├── Array.sml │ ├── Array2.sml │ ├── ArraySlice.sml │ ├── BOOL.sig │ ├── BYTE.sig │ ├── Bool.sml │ ├── Byte.sml │ ├── ByteSlice.sml │ ├── ByteTable.sml │ ├── CHAR.sig │ ├── CONTROL.sig │ ├── Char.sml │ ├── Control.sml │ ├── DATE.sig │ ├── Date.sml │ ├── GENERAL.sig │ ├── General.sml │ ├── HTML.sig │ ├── Html.sml │ ├── INTEGER.sml │ ├── INT_INF.sml │ ├── INT_INF_REP.sml │ ├── IO.sml │ ├── Initial.sml │ ├── Int31.sml │ ├── Int32.sml │ ├── IntInf.sml │ ├── IntInfRep.sml │ ├── JS.sig │ ├── JS_CORE.sml │ ├── Js.sml │ ├── JsCore.sml │ ├── LIST.sig │ ├── LISTSORT.sig │ ├── LIST_PAIR.sml │ ├── List.sml │ ├── ListPair.sml │ ├── Listsort.sml │ ├── MATH.sig │ ├── MONO_ARRAY.sml │ ├── MONO_ARRAY_SLICE.sml │ ├── MONO_VECTOR.sml │ ├── MONO_VECTOR_SLICE.sml │ ├── Makefile │ ├── Math.sml │ ├── OPTION.sig │ ├── OS.sml │ ├── OS_PATH.sml │ ├── Option.sml │ ├── PACK_REAL.sml │ ├── PACK_WORD.sml │ ├── Pack32Big.sml │ ├── Pack32Little.sml │ ├── PackRealBig.sml │ ├── PackRealLittle.sml │ ├── Parsercomb.sig │ ├── Parsercomb.sml │ ├── Path.sml │ ├── RANDOM.sig │ ├── REAL.sig │ ├── RWP.sig │ ├── Random.sml │ ├── Real.sml │ ├── Rwp.sml │ ├── STRING.sig │ ├── STRING_CVT.sml │ ├── STR_BASE.sml │ ├── SUBSTRING.sig │ ├── StrBase.sml │ ├── String.sml │ ├── String2.sml │ ├── StringCvt.sml │ ├── Substring.sml │ ├── TEXT.sig │ ├── TEXT_IO.sml │ ├── TIME.sig │ ├── TIMER.sig │ ├── TableSlice.sml │ ├── Text.sml │ ├── TextIO.sml │ ├── Time.sml │ ├── Timer.sml │ ├── VECTOR.sig │ ├── VECTOR_SLICE.sml │ ├── Vector.sml │ ├── VectorSlice.sml │ ├── WORD.sig │ ├── WSeq.sig │ ├── WSeq.sml │ ├── Word31.sml │ ├── Word32.sml │ ├── Word8.sml │ ├── XMLRPC.sig │ ├── XMLRPC_TYPE.sig │ ├── XMLrpc.sml │ ├── XMLrpcClient.sml │ ├── basis.mlb │ ├── dojo.mlb │ ├── dojo.sig │ ├── dojo.sml │ ├── formlets.sig │ ├── formlets.sml │ ├── html.mlb │ ├── js.mlb │ ├── md5.mlb │ ├── md5.sig │ ├── md5.sml │ ├── rwp.mlb │ ├── utest.mlb │ ├── utest.sig │ ├── utest.sml │ ├── wordtables.sml │ └── xmlrpc.mlb ├── codemirror │ ├── Makefile │ ├── codemirror.css │ ├── codemirror.js │ ├── sml.js │ └── sml │ │ ├── .gitignore │ │ ├── codemirror.mlb │ │ ├── codemirror.sig │ │ └── codemirror.sml ├── design.txt ├── doc │ ├── .gitignore │ ├── Makefile │ ├── images │ │ └── ui-bg_flat_75_ffffff_40x100.png │ ├── jquery-1.9.1.js │ ├── jquery-ui.css │ ├── jquery-ui.js │ └── style.css ├── index.html ├── otests │ ├── array.sml │ ├── array2.sml │ ├── arrayslice.sml │ ├── bytechar.sml │ ├── content │ ├── date.sml │ ├── fac.sml │ ├── frp.sml │ ├── general.sml │ ├── github.sml │ ├── int.sml │ ├── int31.sml │ ├── int32.sml │ ├── life.sml │ ├── list.sml │ ├── listpair.sml │ ├── math.sml │ ├── real.sml │ ├── sheep.png │ ├── sheeps.sml │ ├── showtime.sml │ ├── sine.sml │ ├── sine2.sml │ ├── string.sml │ ├── stringcvt.sml │ ├── svgballs.sml │ ├── testdyn1.sml │ ├── time.sml │ ├── vector.sml │ ├── vectorslice.sml │ └── war.sml ├── prims.js ├── slides_diku_2007-11-27.pdf ├── slides_lunch_2007-09-17.pdf ├── smltojs_logo_color.png ├── smltojs_logo_color160.png ├── smltojs_logo_no_text.png └── test │ ├── .gitignore │ ├── HTML.sig │ ├── Html.sml │ ├── Makefile │ ├── TDOM.sig │ ├── TDOM2.sig │ ├── TDom.sml │ ├── TDom2.sml │ ├── Web.sml │ ├── appfuntest │ ├── Makefile │ ├── appfuntest.mlb │ ├── appfuntest.sml │ └── smltojs_logo_transparent_small.png │ ├── armor.png │ ├── array.html.out.ok │ ├── array.sml │ ├── array2.html.out.ok │ ├── array2.sml │ ├── arrayslice.html.out.ok │ ├── arrayslice.sml │ ├── bytechar.html.out.ok │ ├── bytechar.sml │ ├── cal.mlb │ ├── cal.sml │ ├── canvas_ex1.mlb │ ├── canvas_ex1.sml │ ├── color.sig │ ├── color.sml │ ├── counter.mlb │ ├── counter.sml │ ├── date.html.out.ok │ ├── date.sml │ ├── dojo-flat │ ├── .bowerrc │ ├── .gitignore │ ├── README │ ├── SummaryRow.js │ ├── dojo_test.mlb │ ├── dojo_test.sml │ ├── mydojo.css │ └── notify.sml │ ├── dojo │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── SummaryRow.js │ ├── dojo_test.mlb │ ├── dojo_test.sml │ ├── formlets_test.mlb │ ├── formlets_test.sml │ ├── index2.html │ ├── mydojo.css │ ├── notify.sml │ ├── trash32.png │ └── typelets.sml │ ├── exec.mlb │ ├── exec.sml │ ├── export.mlb │ ├── export.sml │ ├── fac.sml │ ├── fix2.html.out.ok │ ├── fix2.sml │ ├── frp.mlb │ ├── frp.sml │ ├── frp2.sml │ ├── frp_ex1.sml │ ├── general.html.out.ok │ ├── general.sml │ ├── int.html.out.ok │ ├── int.sml │ ├── int31.html.out.ok │ ├── int31.sml │ ├── int31_2.html.out.ok │ ├── int31_2.sml │ ├── int32.html.out.ok │ ├── int32.sml │ ├── int32_2.html.out.ok │ ├── int32_2.sml │ ├── int_2.html.out.ok │ ├── int_2.sml │ ├── intinf.html.out.ok │ ├── intinf.sml │ ├── kkb.html.out.ok │ ├── kkb.sml │ ├── lamp.png │ ├── life.mlb │ ├── life.sml │ ├── lin.sml │ ├── list.html.out.ok │ ├── list.sml │ ├── listpair.html.out.ok │ ├── listpair.sml │ ├── ll.gif │ ├── lr.gif │ ├── math.html.out.ok │ ├── math.sml │ ├── ntemp.mlb │ ├── ntemp.sml │ ├── packreal.html.out.ok │ ├── packreal.sml │ ├── packreal2.html.out.ok │ ├── packreal2.sml │ ├── packreal3.html.out.ok │ ├── packreal3.sml │ ├── philip.html.out.ok │ ├── philip.sml │ ├── plantgreen.png │ ├── real.html.out.ok │ ├── real.sml │ ├── rhtml.sig │ ├── rhtml.sml │ ├── rhtml_ex1.mlb │ ├── rhtml_ex1.sml │ ├── rwidget.sig │ ├── rwidget.sml │ ├── rwp.mlb │ ├── rwp.sig │ ├── rwp.sml │ ├── rwp3.mlb │ ├── rwp3.sml │ ├── rwp_ex1.mlb │ ├── rwp_ex1.sml │ ├── rwp_ex2.mlb │ ├── rwp_ex2.sml │ ├── rwp_ex3.mlb │ ├── rwp_ex3.sml │ ├── rwp_ex4.mlb │ ├── rwp_ex4.sml │ ├── rwp_ex5.mlb │ ├── rwp_ex5.sml │ ├── sheep.png │ ├── simple.html.out.ok │ ├── simple.sml │ ├── string.html.out.ok │ ├── string.sml │ ├── stringcvt.html.out.ok │ ├── stringcvt.sml │ ├── substring.html.out.ok │ ├── substring.sml │ ├── tablechairs.png │ ├── tabs.mlb │ ├── tabs.sml │ ├── tailrec.sml │ ├── tailrec2.html.out.ok │ ├── tailrec2.sml │ ├── tdom2_ex1.mlb │ ├── tdom2_ex1.sml │ ├── tdom_ex1.mlb │ ├── tdom_ex1.sml │ ├── temp.mlb │ ├── temp.sml │ ├── test1.sml │ ├── testdyn1.html.out.ok │ ├── testdyn1.sml │ ├── testmatc.html.out.ok │ ├── testmatc.sml │ ├── time.html.out.ok │ ├── time.sml │ ├── tlist.mlb │ ├── tlist.sml │ ├── ul.gif │ ├── unixpath.html.out.ok │ ├── unixpath.sml │ ├── ur.gif │ ├── utest.js │ ├── vector.html.out.ok │ ├── vector.sml │ ├── vectorslice.html.out.ok │ ├── vectorslice.sml │ ├── walls.png │ ├── word.html.out.ok │ ├── word.sml │ ├── word31.html.out.ok │ ├── word31.sml │ ├── word32.html.out.ok │ ├── word32.sml │ ├── word8.html.out.ok │ ├── word8.sml │ ├── word8array.html.out.ok │ ├── word8array.sml │ ├── word8arrayslice.html.out.ok │ ├── word8arrayslice.sml │ ├── word8vector.html.out.ok │ ├── word8vector.sml │ ├── word8vectorslice.html.out.ok │ ├── word8vectorslice.sml │ ├── xmlrpc_test1.mlb │ └── xmlrpc_test1.sml ├── kitdemo ├── INT_SET.sml ├── IntSet.sml ├── Makefile ├── PolySet.mlb ├── PolySet.sml ├── SET.sig ├── Set.mlb ├── Set.sml ├── SetApp.sml ├── append.sml ├── apply.sml ├── ccalls.sml ├── ccalls.sml.mads ├── compose.mlb ├── compose.sml ├── dangling.sml ├── elimpair.sml ├── escape.sml ├── escape1.sml ├── escape2.sml ├── exceptions.sml ├── fold1.sml ├── fold2.sml ├── fold3.sml ├── fold4.sml ├── fromto.sml ├── helloworld.sml ├── lambda.sml ├── lambda1.sml ├── lambda2.sml ├── lambda3.sml ├── lambda4.sml ├── length.sml ├── lib.sml ├── lib_stream.sml ├── libmylib.c ├── life.sml ├── map.sml ├── minilist.mlb ├── minilist.sml ├── msort.mlb ├── msort.sml ├── msortreset1.mlb ├── msortreset1.sml ├── msortreset2.mlb ├── msortreset2.sml ├── msortrun.sml ├── mylib.mlb ├── mylib.sml ├── onetwothree.sml ├── projection.sml ├── refs1.sml ├── refs2.sml ├── refs3.sml ├── runmsort.sml ├── scan.mlb ├── scan.sml ├── scan_rev1.mlb ├── scan_rev1.sml ├── scan_rev2.mlb ├── scan_rev2.sml ├── scan_stream.mlb ├── scan_stream.sml ├── scanfiles ├── select_second.c ├── select_second.mlb ├── select_second.sml ├── sma1.sml ├── tail.sml ├── tail2.sml ├── takeanddrop.sml ├── test_mylib.sml ├── testdyn1.sml ├── testdyn2.sml ├── trees.mlb ├── trees.sml ├── tststrcmp.sml ├── upto.sml ├── utils │ ├── ListUtils.sml │ └── utils.mlb ├── vpprob.mlb └── vpprob.sml ├── kitlib ├── CRASH.sig ├── Crash.sml ├── IntFinMapPT.sml ├── IntFinMapPTExt.sml ├── IntFinMapPTImpl.sml ├── IntSet.sml ├── IntSetExt.sml ├── IntSetImpl.sml ├── MONO_FINMAP.sml ├── MONO_FINMAP_EXT.sml ├── MONO_SET.sml ├── MONO_SET_EXT.sml ├── NatSet.sml ├── NatSetExt.sml ├── NatSetImpl.sml ├── OrderSet.sml ├── OrderSetExt.sml ├── OrderSetImpl.sml ├── PRETTYPRINT.sig ├── PrettyPrint.sml ├── REPORT.sig ├── Report.sml ├── finmap.mlb ├── finmap_ext.mlb ├── finmap_impl.mlb ├── kitprofile.mlb ├── kitprofile.sig ├── kitprofile.sml ├── pp.mlb ├── set.mlb ├── set_ext.mlb └── set_impl.mlb ├── man └── man1 │ ├── .gitignore │ ├── kittester.1.in │ ├── mlkit-mllex.1.in │ ├── mlkit-mlyacc.1.in │ └── rp2ps.1.in ├── mkinstalldirs ├── ml-yacc-lib ├── base.sig ├── join.sml ├── lrtable.sml ├── ml-yacc-lib.mlb ├── parser1.sml ├── parser2.sml └── stream.sml ├── src ├── .gitignore ├── CUtils │ ├── .gitignore │ ├── Makefile │ ├── binaryheap.c │ ├── binaryheap.h │ ├── binaryheap_test.c │ ├── binaryheap_test.out.ok │ ├── hashfun.c │ ├── hashfun.h │ ├── hashmap.c │ ├── hashmap.h │ ├── hashmap_typed.c │ ├── hashmap_typed.h │ ├── hashmap_typed_test.c │ ├── hashmap_typed_test.out.ok │ ├── polyhashmap.c │ └── polyhashmap.h ├── Common │ ├── .gitignore │ ├── ALL_INFO.sml │ ├── AllInfo.sml │ ├── BASICS.sig │ ├── BASIC_IO.sml │ ├── BasicIO.sml │ ├── Basics.sml │ ├── BasisCompat.sml │ ├── CRASH.sig │ ├── Crash.sml │ ├── DEC_GRAMMAR.sml │ ├── DFInfo.sml │ ├── DF_INFO.sml │ ├── DIGRAPH.sig │ ├── DecGrammar.sml │ ├── DiGraph.sml │ ├── ELABDEC.sig │ ├── ELABTOPDEC.sml │ ├── ELAB_INFO.sml │ ├── ELAB_REPOSITORY.sml │ ├── ENVIRONMENTS.sml │ ├── ERROR_CODE.sml │ ├── ERROR_INFO.sml │ ├── ERROR_TRAVERSE.sml │ ├── EfficientElab │ │ ├── .gitignore │ │ ├── ElabTopdec.sml │ │ ├── Environments.sml │ │ ├── MODULE_STATOBJECT.sml │ │ ├── ModuleEnvironments.sml │ │ ├── ModuleStatObject.sml │ │ └── StatObject.sml │ ├── ElabDec.sml │ ├── ElabInfo.sml │ ├── ElabRepository.sml │ ├── Elaboration.sml │ ├── EqFinMap.sml │ ├── EqSetList.sml │ ├── ErrorInfo.sml │ ├── ErrorTraverse.sml │ ├── Execution.sml │ ├── FINMAP.sig │ ├── FINMAPEQ.sig │ ├── FLAGS.sig │ ├── FUNID.sig │ ├── FinMap.sml │ ├── FinMapEq.sml │ ├── FinMapPT.sml │ ├── Flags.sml │ ├── FunId.sml │ ├── HashTable.sml │ ├── Heap.sml │ ├── IDENT.sig │ ├── INFIXBASIS.sig │ ├── IOStreams.sml │ ├── IO_STREAMS.sml │ ├── Ident.sml │ ├── InfixBasis.sml │ ├── IntDiGraph.sml │ ├── IntFinMap.sml │ ├── IntFinMapPT.sml │ ├── IntSet.sml │ ├── IntStringFinMap.sml │ ├── KIT_MONO_SET.sml │ ├── KitBarry.sml │ ├── KitCompiler.sml │ ├── KitDummy.sml │ ├── KitJS.sml │ ├── KitKam.sml │ ├── KitMain.sml │ ├── KitOnKit.sml │ ├── KitReML.sml │ ├── KitSmlserver.sml │ ├── KitX64.sml │ ├── KitX86.sml │ ├── LAB.sig │ ├── LIST_HACKS.sml │ ├── LIST_SORT.sml │ ├── Lab.sml │ ├── ListHacks.sml │ ├── ListSort.sml │ ├── ListUtils.sml │ ├── MD5.sml │ ├── MODULE_ENVIRONMENTS.sml │ ├── MONO_FINMAP.sml │ ├── Man.sml │ ├── Menu.sml │ ├── MonoFinMap.sml │ ├── NAME.sig │ ├── Name.sml │ ├── NatSet.sml │ ├── ORDER.sig │ ├── ORDSET.sml │ ├── OVERLOADING_INFO.sml │ ├── OrderFinMap.sml │ ├── OrderSet.sml │ ├── OverloadingInfo.sml │ ├── PARSE_INFO.sml │ ├── PRETTYPRINT.sig │ ├── ParseInfo.sml │ ├── PostElabDecGrammar.sml │ ├── PostElabGrammar.sml │ ├── PreElabDecGrammar.sml │ ├── PreElabTopdecGrammar.sml │ ├── PrettyPrint.sml │ ├── QUASI_ENV.sml │ ├── QuasiEnv.sml │ ├── QuasiMap.sml │ ├── QuasiSet.sml │ ├── REGVAR.sig │ ├── REPORT.sig │ ├── RegVar.sml │ ├── Report.sml │ ├── SCON.sig │ ├── SCon.sml │ ├── SIGID.sig │ ├── SMLofNJOnKit.sml │ ├── SORTED_FINMAP.sml │ ├── SOURCE_INFO.sml │ ├── STACK.sig │ ├── STATOBJECT.sml │ ├── STRID.sig │ ├── SYNTAX_TYVAR.sig │ ├── SigId.sml │ ├── SortedFinMap.sml │ ├── SourceInfo.sml │ ├── Stack.sml │ ├── StrId.sml │ ├── StringFinMap.sml │ ├── StringFinMapPT.sml │ ├── StringSet.sml │ ├── SyntaxTyVar.sml │ ├── TIMESTAMP.sig │ ├── TOPDEC_GRAMMAR.sml │ ├── TOP_LEVEL_REPORT.sml │ ├── TYCON.sig │ ├── TYNAME.sig │ ├── TYPE_INFO.sml │ ├── TYVAR.sig │ ├── Timestamp.sml │ ├── Timing.sml │ ├── TopLevelReport.sml │ ├── TopdecGrammar.sml │ ├── TyCon.sml │ ├── TyName.sml │ ├── TyVar.sml │ ├── TypeInfo.sml │ ├── UNION_FIND_POLY.sml │ ├── UnionFindPoly.sml │ ├── WordFinMapPT.sml │ ├── basics.mlb │ ├── commonBasicIO.sml │ ├── md5.mlb │ ├── special_objects.mlb │ ├── syntax_objects.mlb │ ├── test │ │ ├── IntFinMapPT_Test.mlb │ │ └── IntFinMapPT_Test.sml │ └── tools.mlb ├── Compiler │ ├── .gitignore │ ├── Backend │ │ ├── .gitignore │ │ ├── BACKEND_INFO.sml │ │ ├── BackendInfo.sml │ │ ├── Barry │ │ │ ├── CompileBarry.sml │ │ │ ├── CompileBasisBarry.sml │ │ │ └── ExecutionBarry.sml │ │ ├── CALC_OFFSET.sml │ │ ├── CALL_CONV.sml │ │ ├── CLOS_CONV_ENV.sml │ │ ├── CLOS_EXP.sml │ │ ├── CODE_GEN.sml │ │ ├── CalcOffset.sml │ │ ├── CallConv.sml │ │ ├── ClosConvEnv.sml │ │ ├── ClosExp.sml │ │ ├── Dummy │ │ │ └── Execution__dummy.sml │ │ ├── FETCH_AND_FLUSH.sml │ │ ├── FetchAndFlush.sml │ │ ├── JS │ │ │ ├── .gitignore │ │ │ ├── CompileBasisJS.sml │ │ │ ├── CompileJS.sml │ │ │ ├── EXP_TO_JS.sig │ │ │ ├── ExecutionJS.sml │ │ │ ├── ExpToJs.sml │ │ │ ├── ExpToJs2.sml │ │ │ ├── JS_AST.sml │ │ │ ├── JsAst.sml │ │ │ ├── SmlToJsComp.sml │ │ │ ├── SmlToJsCompApp.sml │ │ │ └── jsast.mlb │ │ ├── JUMP_TABLES.sml │ │ ├── JumpTables.sml │ │ ├── LINE_STMT.sml │ │ ├── LineStmt.sml │ │ ├── NativeCompile.sml │ │ ├── PrimName.sml │ │ ├── REGISTER_INFO.sml │ │ ├── REG_ALLOC.sml │ │ ├── RegAlloc.sml │ │ ├── SUBST_AND_SIMPLIFY.sml │ │ ├── SubstAndSimplify.sml │ │ └── X64 │ │ │ ├── .gitignore │ │ │ ├── CodeGenUtilX64.sml │ │ │ ├── CodeGenX64.sml │ │ │ ├── ExecutionX64.sml │ │ │ ├── INSTS_X64.sml │ │ │ └── InstsX64.sml │ ├── BuildCompile.sml │ ├── BuildCompile__dummy.sml │ ├── COMPILE.sig │ ├── COMPILE_BASIS.sml │ ├── COMPILE_GEN.sml │ ├── COMPILE_TO_LAMB.sml │ ├── COMP_BASIS.sml │ ├── COMP_BASIS_GEN.sml │ ├── CompBasis.sml │ ├── CompBasisToLamb.sml │ ├── Compile.sml │ ├── CompileBasis.sml │ ├── CompileBasis__dummy.sml │ ├── CompileToLamb.sml │ ├── Lambda │ │ ├── .gitignore │ │ ├── COMPILER_ENV.sml │ │ ├── COMPILE_DEC.sml │ │ ├── CON.sig │ │ ├── CompileDec.sml │ │ ├── CompilerEnv.sml │ │ ├── CompilerEnv__dummy.sml │ │ ├── Con.sml │ │ ├── ELIMINATE_EQ.sml │ │ ├── EXCON.sig │ │ ├── EliminateEq.sml │ │ ├── Excon.sml │ │ ├── LAMBDA_BASICS.sml │ │ ├── LAMBDA_EXP.sml │ │ ├── LAMBDA_STAT_SEM.sml │ │ ├── LVARS.sig │ │ ├── LambdaBasics.sml │ │ ├── LambdaExp.sml │ │ ├── LambdaStatSem.sml │ │ ├── Lvars.sml │ │ ├── OPT_LAMBDA.sml │ │ └── OptLambda.sml │ ├── Regions │ │ ├── .gitignore │ │ ├── ADDRESS_LABELS.sml │ │ ├── AT_INF.sml │ │ ├── AddressLabels.sml │ │ ├── AtInf.sml │ │ ├── DROP_REGIONS.sml │ │ ├── DropRegions.sml │ │ ├── EFFECT.sig │ │ ├── EffVarEnv.sml │ │ ├── Effect.sml │ │ ├── LOCALLY_LIVE_VARIABLES.sml │ │ ├── LocallyLiveVariables.sml │ │ ├── MUL.sig │ │ ├── MUL_EXP.sml │ │ ├── MUL_INF.sml │ │ ├── Mul.sml │ │ ├── MulExp.sml │ │ ├── MulInf.sml │ │ ├── PHYS_SIZE_INF.sml │ │ ├── PhysSizeInf.sml │ │ ├── REGINF.sig │ │ ├── REGION_EXP.sml │ │ ├── REGION_FLOW_GRAPH_PROFILING.sml │ │ ├── REGION_STAT_ENV.sml │ │ ├── REG_CONST.sml │ │ ├── REG_FLOW.sml │ │ ├── RTYPE.sig │ │ ├── RType.sml │ │ ├── RegConst.sml │ │ ├── RegFlow.sml │ │ ├── RegInf.sml │ │ ├── RegionExp.sml │ │ ├── RegionFlowGraphProfiling.sml │ │ ├── RegionStatEnv.sml │ │ ├── SPREAD_DATATYPE.sml │ │ ├── SPREAD_EXPRESSION.sml │ │ ├── SpreadDataType.sml │ │ ├── SpreadExpression.sml │ │ ├── TestSpreadDataType.sml │ │ └── TestSpreadExp.sml │ ├── barry.mlb │ ├── compiler.mlb │ ├── compiler0.mlb │ ├── compiler_objects.mlb │ ├── dummy.mlb │ ├── native64.mlb │ ├── prebackend.mlb │ ├── prebackend0.mlb │ ├── regions.mlb │ ├── reml.mlb │ ├── smltojs.mlb │ └── smltojs0.mlb ├── Edlib │ ├── .gitignore │ ├── EDLIB_GENERAL.sml │ ├── EQ_SET.sml │ ├── Edlib.sml │ ├── EdlibGeneral.sml │ ├── EqSet.sml │ ├── LIST.sml │ ├── LIST_PAIR.sml │ ├── LIST_SORT.sml │ ├── ListSort.sml │ ├── Makefile │ ├── ORDERING.sml │ ├── SET.sig │ ├── Set.sml │ ├── edList.sml │ ├── edListPair.sml │ └── edlib.mlb ├── Kitlib │ ├── .gitignore │ ├── BINARYMAP.sig │ ├── BINARYSET.sig │ ├── Binarymap.sml │ ├── Binaryset.sml │ ├── INTMAP.sig │ ├── INTSET.sig │ ├── Intmap.sml │ ├── Intset.sml │ ├── LISTSORT.sig │ ├── Listsort.sml │ ├── POLYHASH.sig │ ├── Polyhash.sml │ ├── REG_EXP.sml │ ├── RegExp.sml │ ├── SML90.sml │ ├── SPLAYMAP.sig │ ├── SPLAYSET.sig │ ├── SPLAYTREE.sig │ ├── SUSP.sig │ ├── Splaymap.sml │ ├── Splayset.sml │ ├── Splaytree.sml │ ├── Susp.sml │ └── kitlib.mlb ├── Makefile.in ├── Manager │ ├── .gitignore │ ├── ELAB_REPOSITORY.sml │ ├── EXECUTION.sml │ ├── ElabRepository.sml │ ├── FREE_IDS.sml │ ├── FreeIds.sml │ ├── INT_MODULES.sml │ ├── IntModules.sml │ ├── MANAGER.sig │ ├── MANAGER_OBJECTS.sml │ ├── MANAGER_OBJECTS0.sml │ ├── MLB_PROJECT.sml │ ├── MODCODE_MINI.sml │ ├── Manager.sml │ ├── ManagerObjects.sml │ ├── ManagerObjects0.sml │ ├── OPACITY_ELIM.sml │ ├── OpacityElim.sml │ ├── OpacityEnv.sml │ ├── PARSE_ELAB.sml │ ├── ParseElab.sml │ ├── Repl.sml │ ├── Scriptlet.sml │ ├── manager.mlb │ └── manager0.mlb ├── Parsing │ ├── .gitignore │ ├── GRAMMAR_UTILS.sml │ ├── GrammarUtils.sml │ ├── HOOKS.sml │ ├── INFIXING.sig │ ├── INFIX_STACK.sml │ ├── InfixStack.sml │ ├── Infixing.sml │ ├── LEX_BASICS.sml │ ├── LEX_UTILS.sml │ ├── LexBasics.sml │ ├── LexUtils.sml │ ├── MyBase.sml │ ├── PARSE.sig │ ├── Parse.sml │ ├── Topdec.grm │ ├── Topdec.grm.sig │ ├── Topdec.grm.sml │ ├── Topdec.lex │ └── Topdec.lex.sml ├── Pickle │ ├── .gitignore │ ├── Makefile │ ├── PACK_REAL.sml │ ├── POLYHASH.sig │ ├── Polyhash.sml │ ├── bitstream.sig │ ├── bitstream.sml │ ├── eqhashdyn2.sml │ ├── pickle.mlb │ ├── pickle.sig │ ├── pickle.sml │ ├── pickletest.sml │ ├── stream.sig │ ├── stream.sml │ └── test │ │ ├── Makefile │ │ ├── test_pickle.mlb │ │ └── test_pickle.sml ├── Runtime │ ├── .gitignore │ ├── CommandLine.c │ ├── CommandLine.h │ ├── Dlsym.c │ ├── Dlsym.h │ ├── Exception.h │ ├── Export.c │ ├── Export.h │ ├── Flags.h │ ├── GC.c │ ├── GC.h │ ├── IO.c │ ├── IO.h │ ├── Icp.c │ ├── List.h │ ├── Locks.h │ ├── MIT_LICENSE │ ├── Makefile.in │ ├── Math.c │ ├── Math.h │ ├── Posix.c │ ├── Posix.h │ ├── Profiling.c │ ├── Profiling.h │ ├── Region.c │ ├── Region.h │ ├── Repl.c │ ├── Runtime.c │ ├── Runtime.h │ ├── Socket.c │ ├── Spawn.c │ ├── Spawn.h │ ├── String.c │ ├── String.h │ ├── Table.c │ ├── Table.h │ ├── Tagging.h │ ├── Time.c │ └── gen_syserror.c ├── Tools │ ├── Benchmark │ │ ├── .gitignore │ │ ├── Benchmark.sml │ │ ├── COMPILE.sml │ │ ├── CompileMLKIT.sml │ │ ├── CompileMLTON.sml │ │ ├── CompileSMLNJ-110.40.sml │ │ ├── CompileSMLNJ.sml │ │ ├── KitBench.mlb │ │ ├── Makefile │ │ └── MemTime.sml │ ├── MlbMake │ │ ├── .gitignore │ │ ├── CONFIGURATION.sig │ │ ├── Configuration.sml.in │ │ ├── ENVIRONMENT.sig │ │ ├── Environment.sml │ │ ├── MLB_FILESYS.sml │ │ ├── MLB_PLUGIN.sml │ │ ├── MLB_PROJECT.sml │ │ ├── MLKit.sml │ │ ├── Makefile.in │ │ ├── MlbFileSys.sml │ │ ├── MlbMake.sml │ │ ├── MlbProject.sml │ │ ├── MlbStandAlone.sml │ │ ├── MlbSyntax.sml │ │ ├── MlbUtil.sml │ │ ├── configuration.mlb │ │ ├── environment.mlb │ │ ├── mlbmake.mlb │ │ └── sources.mlb │ ├── MspComp │ │ ├── .gitignore │ │ ├── Makefile │ │ └── MspComp.sml │ ├── Rp2ps │ │ ├── .gitignore │ │ ├── Alloc.c │ │ ├── Alloc.h │ │ ├── Curves.c │ │ ├── Curves.h │ │ ├── Error.c │ │ ├── Error.h │ │ ├── Flags.h │ │ ├── Graph.c │ │ ├── Graph.h │ │ ├── Makefile.in │ │ ├── Output.c │ │ ├── Output.h │ │ ├── PostScript.c │ │ ├── PostScript.h │ │ ├── ProfileData.c │ │ ├── ProfileData.h │ │ ├── Rp2Ps.c │ │ ├── Rp2Ps.h │ │ ├── Sample.c │ │ ├── Sample.h │ │ └── Types.h │ ├── SigDoc │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README │ │ ├── lib │ │ │ ├── jquery-1.9.1.js │ │ │ ├── jquery-ui.css │ │ │ ├── jquery-ui.js │ │ │ └── style.css │ │ ├── main.sml │ │ └── sigdoc.mlb │ ├── Tester │ │ ├── .gitignore │ │ ├── CompilerTimings.sml │ │ ├── ExecProfile.sml │ │ ├── INFO.sig │ │ ├── Info.sml │ │ ├── KitTester.mlb │ │ ├── LinuxInfo.sml │ │ ├── Makefile.in │ │ ├── MemUsage.sml │ │ ├── SolarisInfo.sml │ │ ├── TestFile.sml │ │ ├── TestReport.sml │ │ ├── Tester.sml │ │ ├── info.mlb │ │ ├── test.sml │ │ ├── test_report.sig │ │ └── test_report.sml │ ├── ml-lex │ │ ├── .gitignore │ │ ├── COPYRIGHT.smlnj │ │ ├── Makefile.in │ │ ├── README │ │ ├── lexgen.sml │ │ ├── ml-lex-mlkit.sml │ │ ├── ml-lex.mlb │ │ ├── mlex_int.doc │ │ ├── mllex.pdf │ │ └── mllex.tex │ └── ml-yacc │ │ ├── .gitignore │ │ ├── COPYRIGHT │ │ ├── Makefile.in │ │ ├── README │ │ ├── doc │ │ ├── mlyacc.pdf │ │ ├── mlyacc.tex │ │ └── tech.doc │ │ ├── examples │ │ ├── calc │ │ │ ├── README │ │ │ ├── calc.grm │ │ │ ├── calc.lex │ │ │ ├── calc.sml │ │ │ └── sources.cm │ │ └── fol │ │ │ ├── README │ │ │ ├── absyn.sml │ │ │ ├── fol.grm │ │ │ ├── fol.lex │ │ │ ├── interface.sml │ │ │ ├── link.sml │ │ │ ├── list.fol │ │ │ ├── parse.sml │ │ │ └── sources.cm │ │ ├── lib │ │ ├── base.sig │ │ ├── join.sml │ │ ├── lrtable.sml │ │ ├── ml-yacc-lib.mlb │ │ ├── parser1.sml │ │ ├── parser2.sml │ │ └── stream.sml │ │ └── src │ │ ├── .gitignore │ │ ├── FILES │ │ ├── README │ │ ├── absyn.sig │ │ ├── absyn.sml │ │ ├── core.sml │ │ ├── coreutils.sml │ │ ├── export-yacc.sml │ │ ├── grammar.sml │ │ ├── graph.sml │ │ ├── hdr.sml │ │ ├── lalr.sml │ │ ├── link.sml │ │ ├── look.sml │ │ ├── mklrtable.sml │ │ ├── mkprstruct.sml │ │ ├── ml-yacc.mlb │ │ ├── parse.sml │ │ ├── shrink.sml │ │ ├── sigs.sml │ │ ├── utils.sig │ │ ├── utils.sml │ │ ├── verbose.sml │ │ ├── yacc.grm │ │ ├── yacc.grm.sig │ │ ├── yacc.grm.sml │ │ ├── yacc.lex │ │ ├── yacc.lex.sml │ │ └── yacc.sml ├── Version.sml.in ├── lib │ └── github.com │ │ └── diku-dk │ │ └── sml-uref │ │ ├── Makefile │ │ ├── test │ │ ├── .gitignore │ │ ├── test_uref.mlb │ │ ├── test_uref.out.ok │ │ └── test_uref.sml │ │ ├── uref.mlb │ │ ├── uref.sig │ │ └── uref.sml └── sml.pkg ├── test ├── .gitignore ├── DLXSimulator.sml ├── DLXSimulator_smlnj.sml ├── FuhMishra.mlb ├── FuhMishra.mlb.out.ok ├── FuhMishra.sml ├── FuhMishra.sml.out.ok ├── Makefile ├── POLYHASH.sig ├── PermuteList.sig ├── PermuteList.sml ├── Polyhash.sml ├── README ├── VLIW_DATA │ ├── cmp.s │ ├── ndotprod.s │ └── tmp.s ├── abstype.sml ├── all.tst ├── anoq_Exception.sml ├── anoq_Exception.sml.log.ok ├── anoq_Exception.sml.out.ok ├── arr2a.sml ├── array.sml ├── array.sml.out.ok ├── array2.sml ├── array2.sml.out.ok ├── arrayslice.sml ├── arrayslice.sml.out.ok ├── atExit0.sml ├── atExit0.sml.out.ok ├── auto2.sml ├── auto2.sml.out.ok ├── barnes-hut.mlb ├── barnes-hut.mlb.out.ok ├── barnes-hut │ ├── README │ ├── data-io.sml │ ├── getparam.sml │ ├── grav.sml │ ├── load │ ├── load.sml │ ├── main.sml │ ├── main2.sml │ ├── rand-sig.sml │ ├── rand.sml │ ├── sources.mlb │ ├── space.sml │ ├── vector-sig.sml │ └── vector3.sml ├── barry │ ├── Makefile │ ├── fft.out.ok │ ├── fft.sml │ ├── fib35.out.ok │ ├── fib35.sml │ ├── general.out.ok │ ├── general.sml │ ├── int.out.ok │ ├── int.sml │ ├── life.out.ok │ ├── life.sml │ ├── mandelbrot.out.ok │ ├── mandelbrot.sml │ ├── msort.out.ok │ ├── msort.sml │ ├── precedence.out.ok │ ├── precedence.sml │ ├── professor.out.ok │ ├── professor.sml │ ├── qsort.out.ok │ ├── qsort.sml │ ├── simple.out.ok │ ├── simple.sml │ ├── string.out.ok │ ├── string.sml │ ├── testdyn1.out.ok │ ├── testdyn1.sml │ ├── tststrcmp.out.ok │ └── tststrcmp.sml ├── basislib_small.mlb ├── basislib_small2.mlb ├── bin │ ├── memtime_hpux │ └── memtime_sun_os4 ├── binio.sml ├── boyer.sml ├── bytechar.sml ├── bytechar.sml.out.ok ├── check_arrays.sml ├── check_arrays.sml.out.ok ├── checksum.sml ├── checksum_smlnj.sml ├── cmdline.sml ├── cmdline.sml.out.ok ├── cobol.sml ├── constraint.sml ├── constraint.sml.log.ok ├── constraint.sml.out.ok ├── count-graphs.sml ├── cross-module.sml ├── dangle4.sml ├── dangle4.sml.out.ok ├── dangle4_simple.sml ├── danwang.mlb ├── danwang.mlb.out.ok ├── danwang │ ├── go.sml │ ├── sobj-cps.sig │ ├── sobj-cps.sml │ ├── sources.mlb │ └── sprogs.sml ├── datatypes.sml ├── datatypes.sml.out.ok ├── date.sml ├── date.sml.out.ok ├── date2.sml ├── date2.sml.out.ok ├── dynlink.mlb ├── dynlink.sml ├── elabDecBug.sml ├── elabDecBug.sml.log.ok ├── eqhashdyn2.sml ├── error1.mlb ├── error2.mlb ├── error2.sml ├── error2b.sml ├── error3.mlb ├── error3.sml ├── error3a.mlb ├── error4.mlb ├── error4a.mlb ├── excon.sml ├── excon.sml.out.ok ├── exn-alpha.sml ├── exn-alpha.sml.out.ok ├── exn.sml ├── exn.sml.out.ok ├── explicit_regions │ ├── Makefile │ ├── all.tst │ ├── call.sml │ ├── call.sml.out.ok │ ├── call2.sml │ ├── call2.sml.out.ok │ ├── con0.sml │ ├── con0.sml.out.ok │ ├── con1.sml │ ├── con1.sml.out.ok │ ├── disputs.sml │ ├── disputs.sml.log.ok │ ├── disputs2.sml │ ├── disputs2.sml.log.ok │ ├── effty1.sml │ ├── effty1.sml.log.ok │ ├── er1.sml │ ├── er1.sml.log.ok │ ├── er10.sml │ ├── er10.sml.log.ok │ ├── er11.sml │ ├── er11.sml.log.ok │ ├── er12.sml │ ├── er12.sml.log.ok │ ├── er13.sml │ ├── er13.sml.log.ok │ ├── er14.sml │ ├── er14.sml.log.ok │ ├── er15.sml │ ├── er15.sml.log.ok │ ├── er16.sml │ ├── er16.sml.log.ok │ ├── er17.sml │ ├── er17.sml.log.ok │ ├── er18.sml │ ├── er18.sml.log.ok │ ├── er19.sml │ ├── er19.sml.log.ok │ ├── er2.sml │ ├── er2.sml.log.ok │ ├── er3.sml │ ├── er3.sml.log.ok │ ├── er4.sml │ ├── er4.sml.log.ok │ ├── er5.sml │ ├── er5.sml.log.ok │ ├── er6.sml │ ├── er6.sml.log.ok │ ├── er7.sml │ ├── er7.sml.log.ok │ ├── er8.sml │ ├── er8.sml.log.ok │ ├── er9.sml │ ├── er9.sml.log.ok │ ├── err_constraint1.sml │ ├── err_copylist.sml │ ├── err_copylist.sml.log.ok │ ├── err_expty1.sml │ ├── err_expty1.sml.log.ok │ ├── err_expty2.sml │ ├── err_expty2.sml.log.ok │ ├── err_expty3.sml │ ├── err_expty3.sml.log.ok │ ├── err_funty1.sml │ ├── err_funty1.sml.log.ok │ ├── err_funty2.sml │ ├── err_funty2.sml.log.ok │ ├── err_funty3.sml │ ├── err_funty3.sml.log.ok │ ├── err_patty1.sml │ ├── err_patty1.sml.log.ok │ ├── err_ty1.sml │ ├── err_ty1.sml.log.ok │ ├── expty1.sml │ ├── expty1.sml.out.ok │ ├── expty2.sml │ ├── expty2.sml.out.ok │ ├── funty1.sml │ ├── funty1.sml.out.ok │ ├── nomut-err.sml │ ├── nomut-err.sml.log.ok │ ├── nomut-ok.sml │ ├── nomut-ok.sml.out.ok │ ├── nomut2-err.sml │ ├── nomut2-err.sml.log.ok │ ├── par-no.sml │ ├── par-no.sml.log.ok │ ├── par-no2.sml │ ├── par-no2.sml.log.ok │ ├── par.sml │ ├── par.sml.out.ok │ ├── param.sml │ ├── param.sml.out.ok │ ├── param1.sml │ ├── param1.sml.out.ok │ ├── rec.sml │ ├── rec.sml.out.ok │ ├── ref.sml │ ├── ref.sml.out.ok │ ├── string.sml │ ├── string.sml.out.ok │ ├── tup.sml │ ├── tup.sml.out.ok │ ├── tup2.sml │ ├── tup2.sml.out.ok │ ├── ty1.sml │ └── ty1.sml.out.ok ├── export.c ├── export.mlb ├── export.sml ├── export2.sml ├── export2.sml.out.ok ├── export3.sml ├── export3.sml.out.ok ├── fft.sml ├── fft.sml.out.ok ├── filesys.sml ├── filesys.sml.out.ok ├── fns.sml ├── fns.sml.out.ok ├── foldbug.sml ├── foldbug.sml.out.ok ├── fork.sml ├── freedatatype.sml ├── freedatatype.sml.log.ok ├── freedatatype2.sml ├── freedatatype2.sml.log.ok ├── ftv.sml ├── ftv.sml.out.ok ├── functor.sml ├── functor.sml.log.ok ├── functor.sml.out.ok ├── functor2.sml ├── functor2.sml.log.ok ├── functor2.sml.out.ok ├── functor3.sml ├── functor3.sml.out.ok ├── functor4.sml ├── fxp.sml ├── gc0.sml ├── gc0.sml.out.ok ├── gc01.sml ├── gc01.sml.out.ok ├── general.sml ├── general.sml.out.ok ├── globalbotrho.sml ├── hatch1.sml ├── hatch1.sml.out.ok ├── helsen.sml ├── helsen0.sml ├── host.mlb ├── host.sml ├── input_to_testdyn2 ├── int-n-vector.sml ├── int-n-vector.sml.out.ok ├── int-n.sml ├── int-n.sml.out.ok ├── int.sml ├── int.sml.out.ok ├── int31.sml ├── int31.sml.out.ok ├── int31_2.sml ├── int31_2.sml.out.ok ├── int32.sml ├── int32.sml.out.ok ├── int32_2.sml ├── int32_2.sml.out.ok ├── int63.sml ├── int63.sml.out.ok ├── int63_2.sml ├── int63_2.sml.out.ok ├── int64.sml ├── int64.sml.out.ok ├── int_2.sml ├── int_2.sml.out.ok ├── intinf.sml ├── intinf.sml.out.ok ├── intinf2.sml ├── intinf2.sml.out.ok ├── kitdangle.sml ├── kitdangle.sml.out.ok ├── kitdangle3.sml ├── kitdangle3.sml.out.ok ├── kitfib35.sml ├── kitfib35.sml.out.ok ├── kitfib35_mlton.sml ├── kitfib35_smlnj.sml ├── kitkbjul9.sml ├── kitkbjul9.sml.out.ok ├── kitkbjul9_smlnj.sml ├── kitkbjul9_tp.sml ├── kitlife35u.sml ├── kitlife35u.sml.out.ok ├── kitlife35u_mlton.sml ├── kitlife35u_smlnj.sml ├── kitlife35u_tp.sml ├── kitloop2.sml ├── kitloop2.sml.out.ok ├── kitmandelbrot.sml ├── kitmandelbrot.sml.out.ok ├── kitmolgard.sml ├── kitmolgard.sml.out.ok ├── kitmolgard_smlnj.sml ├── kitqsort.sml ├── kitqsort.sml.out.ok ├── kitqsort2.sml ├── kitreynolds2.sml ├── kitreynolds2.sml.out.ok ├── kitreynolds3.sml ├── kitreynolds3.sml.out.ok ├── kitsimple.sml ├── kitsimple.sml.out.ok ├── kitsimple_smlnj.sml ├── kitsimple_tp.sml ├── kittmergesort.sml ├── kittmergesort.sml.out.ok ├── kittmergesort_smlnj.sml ├── kittmergesort_tp.sml ├── kkb36c.sml ├── kkb36c.sml.out.ok ├── kkb36c_mlton.sml ├── kkb36c_smlnj.sml ├── kkb36d.sml ├── kkb_eq.sml ├── kkb_eq.sml.out.ok ├── klife_eq.sml ├── klife_eq.sml.out.ok ├── layout.sml ├── layout.sml.log.ok ├── layout.sml.out.ok ├── lex.sml ├── lex.sml.log.ok ├── lex.sml.out.ok ├── lib.sml ├── life.sml ├── life.sml.out.ok ├── list.sml ├── list.sml.out.ok ├── listpair.sml ├── listpair.sml.out.ok ├── listsort.mlb ├── listsort.mlb.out.ok ├── listsort.sml ├── lllllll.txt ├── llv.sml ├── llv.sml.out.ok ├── logic.mlb ├── logic.mlb.out.ok ├── logic │ ├── data.sml │ ├── main.sml │ ├── main_smlnj.sml │ ├── sources.mlb │ ├── sources_mlton.cm │ ├── sources_smlnj.cm │ ├── term.sml │ ├── trail.sml │ └── unify.sml ├── logic_mlton.cm ├── logic_smlnj.cm ├── longlife.sml ├── math.sml ├── math.sml.out.ok ├── matrix-multiply.sml ├── matrix-multiply_smlnj.sml ├── mlbtest │ ├── A.sml │ ├── B.sml │ ├── ab.mlb │ ├── char.mlb │ ├── char.sml │ ├── charsig.sml │ ├── d1 │ │ ├── a.sml │ │ ├── d.mlb │ │ ├── f.mlb │ │ ├── f.sml │ │ ├── f2.mlb │ │ └── f2.sml │ ├── d2 │ │ ├── b.sml │ │ ├── c.sml │ │ ├── d.mlb │ │ └── d2.mlb │ ├── datatype │ │ ├── d.mlb │ │ └── d1.sml │ ├── dir.mlb │ ├── dir2.mlb │ ├── f1.mlb │ ├── f1.sml │ ├── functor.mlb │ ├── functor1.sml │ ├── functor2.sml │ ├── functor3.sml │ ├── functor4.sml │ ├── sig.mlb │ ├── sig.sig │ └── sig.sml ├── mpuz.sml ├── mpuz_smlnj.sml ├── msort.mlb ├── msort.mlb.out.ok ├── msort.sml ├── msortrun.sml ├── multiarg.sml ├── natset.sml ├── natset.sml.out.ok ├── nucleic.mlb ├── nucleic.mlb.out.ok ├── nucleic │ ├── MAIL │ ├── main.sml │ ├── nucleic.sml │ ├── paper.bbl │ ├── paper.tex │ └── sources.mlb ├── oh-no.sml ├── oh-no.sml.log.ok ├── oh-no.sml.out.ok ├── oh-no2.sml ├── oh-no2.sml.log.ok ├── oh-no2.sml.out.ok ├── opaque.sml ├── opaque.sml.log.ok ├── opaque.sml.out.ok ├── opaque2.sml ├── opaque2.sml.out.ok ├── opaque3.sml ├── opaque3.sml.out.ok ├── packreal.sml ├── packreal.sml.out.ok ├── packreal2.sml ├── packreal2.sml.out.ok ├── packreal3.sml ├── packreal3.sml.out.ok ├── parallelism │ ├── Makefile │ ├── all.tst │ ├── cores.mlb │ ├── cores.sml │ ├── cores.sml.out.ok │ ├── exn0.sml │ ├── exn0.sml.out.ok │ ├── exn1.sml │ ├── exn1.sml.out.ok │ ├── exn2.sml │ ├── exn2.sml.out.ok │ ├── spawn.sml │ ├── spawn.sml.out.ok │ ├── spawn100.sml │ ├── spawn100.sml.out.ok │ ├── spawn_alloccomp.sml │ ├── spawn_lists.sml │ ├── spawn_lists.sml.out.ok │ ├── spawn_msort.sml │ ├── spawn_pmap.sml │ ├── spawn_simple.sml │ ├── spawn_simple.sml.out.ok │ ├── spawn_simple2.sml │ ├── spawn_simple2.sml.out.ok │ ├── spawn_simple3.sml │ ├── spawn_simple3.sml.out.ok │ ├── spawn_simple4.sml │ ├── spawn_simple4.sml.out.ok │ ├── spawn_simple5.sml │ ├── spawn_simple5.sml.out.ok │ ├── spawn_simple6.sml │ ├── spawn_simple6.sml.out.ok │ ├── spawn_simple7.sml │ └── spawn_simple8.sml ├── pat.sml ├── pat.sml.log.ok ├── pat.sml.out.ok ├── patricia.sml ├── patricia.sml.out.ok ├── peek.sml ├── peek_smlnj.sml ├── perm.mlb ├── perm.sml ├── perm1.sml ├── pickle.mlb ├── pickle.sig ├── pickle.sml ├── pickletest.mlb ├── pickletest.mlb.out.ok ├── pickletest.sml ├── poll.sml ├── poll.sml.out.ok ├── posix.sml ├── posix.sml.out.ok ├── professor.sml ├── professor2.sml ├── professor2_smlnj.sml ├── professor2_tp.sml ├── professor_game.sml ├── psdes-random.sml ├── psdes-random_smlnj.sml ├── pseudokit.sml ├── rank.sml ├── rank.sml.log.ok ├── ratio-regions.sml ├── ratio-regions.sml.log.ok ├── ratio-regions.sml.out.ok ├── ratio-regions_smlnj.sml ├── ratio-regions_tp.sml ├── ray.mlb ├── ray.mlb.out.ok ├── ray │ ├── DATA │ │ └── TEST │ ├── README │ ├── input │ ├── interface.sml │ ├── interp.sml │ ├── load │ ├── main.sml │ ├── objects.sml │ ├── ray.sml │ └── sources.mlb ├── raytrace.sml ├── raytrace_smlnj.sml ├── real.sml ├── real.sml.out.ok ├── real64array.sml ├── real64array.sml.out.ok ├── real64vector.sml ├── real64vector.sml.out.ok ├── real_match.sml ├── real_match.sml.out.ok ├── realarray2.sml ├── realarray2.sml.out.ok ├── regexp.sml ├── regexp.sml.out.ok ├── regexp1.mlb ├── regexp1.mlb.out.ok ├── regexp1.sml ├── regexp2.mlb ├── regexp2.mlb.out.ok ├── regexp2.sml ├── repl │ ├── .gitignore │ ├── Makefile │ ├── a.mlb │ ├── basis.cmd │ ├── basis.out.ok │ ├── chdir.cmd │ ├── chdir.out.ok │ ├── hello.sml │ ├── load.cmd │ ├── load.out.ok │ ├── pretty.cmd │ ├── pretty.out.ok │ ├── simple.cmd │ ├── simple.out.ok │ ├── simple2.cmd │ └── simple2.out.ok ├── req.sml ├── seltuptup.sml ├── seltuptup.sml.out.ok ├── server.mlb ├── server.sml ├── sharing.sml ├── sharing.sml.log.ok ├── sigs-avail.sml ├── sigs-avail.sml.out.ok ├── sigs.sml ├── smith-normal-form.sml ├── smith-normal-form_smlnj.sml ├── stream.mlb ├── stream.mlb.out.ok ├── stream.sig ├── stream.sml ├── streamtest.sml ├── string.sml ├── string.sml.out.ok ├── stringcvt.sml ├── stringcvt.sml.out.ok ├── stringsz.sml ├── stringsz.sml.out.ok ├── structs-avail.sml ├── structs-avail.sml.out.ok ├── substring.sml ├── substring.sml.out.ok ├── switch.sml ├── tailfib.sml ├── tailfib_smlnj.sml ├── tak.sml ├── tak_smlnj.sml ├── testcon.sml ├── testcon.sml.log.ok ├── testdyn1.sml ├── testdyn1.sml.out.ok ├── testdyn2.sml ├── testmatc.sml ├── testmatc.sml.log.ok ├── testmatc.sml.out.ok ├── testtyvar.sml ├── textio.sml ├── textio.sml.out.ok ├── time.sml ├── time.sml.out.ok ├── timer.sml ├── timer.sml.out.ok ├── tsp.sml ├── tsp_smlnj.sml ├── tsp_tp.sml ├── tststrcmp.sml ├── tststrcmp.sml.out.ok ├── tyan.sml ├── tyan_smlnj.sml ├── type_sharing.sml ├── typerr.sml ├── typerr.sml.log.ok ├── unbox.sml ├── unbox.sml.out.ok ├── unixpath.sml ├── unixpath.sml.out.ok ├── upto.sml ├── valrecpat.sml ├── valrecpat.sml.out.ok ├── valrecpat1.sml ├── valrecpat1.sml.out.ok ├── valrecpat2.sml ├── valrecpat2.sml.out.ok ├── valrecpat3.sml ├── valrecpat3.sml.out.ok ├── valrecpat4.sml ├── valrecpat4.sml.out.ok ├── vector-concat.sml ├── vector-concat_smlnj.sml ├── vector-rev.sml ├── vector-rev_smlnj.sml ├── vector.sml ├── vector.sml.out.ok ├── vectorslice.sml ├── vectorslice.sml.out.ok ├── vesa2.sml ├── vesa2.sml.out.ok ├── wc-input1.sml ├── wc-input1_smlnj.sml ├── wc-scanStream.sml ├── wc-scanStream_smlnj.sml ├── weeks.sml ├── weeks.sml.log.ok ├── weeks.sml.out.ok ├── weeks2.sml ├── weeks2.sml.log.ok ├── weeks3.sml ├── weeks3.sml.log.ok ├── weeks4.sml ├── weeks5.sml ├── weeks5.sml.out.ok ├── weeks6.sml ├── with-escape.sml ├── with-escape.sml.out.ok ├── word-n-vector.sml ├── word-n-vector.sml.out.ok ├── word.sml ├── word.sml.out.ok ├── word16.sml ├── word16.sml.out.ok ├── word31.sml ├── word31.sml.out.ok ├── word32.sml ├── word32.sml.out.ok ├── word63.sml ├── word63.sml.out.ok ├── word64.sml ├── word64.sml.out.ok ├── word8.sml ├── word8.sml.out.ok ├── word8array.sml ├── word8array.sml.out.ok ├── word8arrayslice.sml ├── word8arrayslice.sml.out.ok ├── word8vector.sml ├── word8vector.sml.out.ok ├── word8vectorslice.sml ├── word8vectorslice.sml.out.ok ├── zern.sml └── zern_smlnj.sml ├── test_dev ├── .gitignore ├── Initial.out.ok ├── Initial.sml ├── Makefile ├── README ├── README_KAM.md ├── README_PARALLEL.md ├── README_X64.md ├── Word32Boxed.sml ├── a.mlb ├── a.mlbout.ok ├── a1.out.ok ├── a1.sml ├── a2.sml ├── app1.sml ├── app2.sml ├── array.sml ├── auto.out.ok ├── auto.sml ├── b.mlb ├── b.mlbout.ok ├── b1.sml ├── b2.sml ├── b3.out.ok ├── b3.sml ├── build.out.ok ├── build.sml ├── c.mlb ├── c.mlbout.ok ├── c1.sml ├── c2.sml ├── ccall.out.ok ├── ccall.sml ├── ceil.sml ├── date.sml ├── date2.sml ├── debug.sml ├── div.sml ├── div0.sml ├── empty.sml ├── empty_loop.sml ├── eqdat.sml ├── er1_err.sml ├── exception1.out.ok ├── exception1.sml ├── exception2.sml ├── exception3.out.ok ├── exception3.sml ├── exception4.out.ok ├── exception4.sml ├── exception5.out.ok ├── exception5.sml ├── exception6.sml ├── exn1.out.ok ├── exn1.sml ├── exn2.out.ok ├── exn2.sml ├── exn3.out.ok ├── exn3.sml ├── exn4.out.ok ├── exn4.sml ├── exn5.sml ├── explode.sml ├── expr.out.ok ├── expr.sml ├── f1.out.ok ├── f1.sml ├── f2.out.ok ├── f2.sml ├── f64.sml ├── f64_1.out.ok ├── f64_1.sml ├── f64_2.out.ok ├── f64_2.sml ├── f64_3.out.ok ├── f64_3.sml ├── f64_4.out.ok ├── f64_4.sml ├── f64_simple.sml ├── f64_simple1.sml ├── f64_simple2.sml ├── fft_no_basislib.out.ok ├── fft_no_basislib.sml ├── fib.out.ok ├── fib.sml ├── fib0.out.ok ├── fib0.sml ├── floor.sml ├── foldl.out.ok ├── foldl.sml ├── general.sml ├── general_debug.sml ├── global_region.out.ok ├── global_region.sml ├── hanoi.out.ok ├── hanoi.sml ├── hello.out.ok ├── hello.sml ├── if.out.ok ├── if.sml ├── if2.sml ├── immedString.out.ok ├── immedString.sml ├── int_first.out.ok ├── int_first.sml ├── int_overflow.out.ok ├── int_overflow.sml ├── interrupt.sml ├── jt.out.ok ├── jt.sml ├── kit.script ├── kitkbjul9_no_basislib.out.ok ├── kitkbjul9_no_basislib.sml ├── kitlife35u_no_basislib.out.ok ├── kitlife35u_no_basislib.sml ├── kitqsort.sml ├── kitqsort_no_basislib.out.ok ├── kitqsort_no_basislib.sml ├── kitreynolds2_no_basislib.out.ok ├── kitreynolds2_no_basislib.sml ├── kitreynolds3_no_basislib.out.ok ├── kitreynolds3_no_basislib.sml ├── kitsimple.sml ├── kitsimple_no_basislib.out.ok ├── kitsimple_no_basislib.sml ├── kittmergesort_no_basislib.out.ok ├── kittmergesort_no_basislib.sml ├── l1.out.ok ├── l1.sml ├── life.sml ├── list_nh.out.ok ├── list_nh.sml ├── listpair.sml ├── listsort.sml ├── many_args.sml ├── many_refs.sml ├── p1.sml ├── professor_game.out.ok ├── professor_game.sml ├── professor_game_debug.sml ├── r.c ├── raise_div.out.ok ├── raise_div.sml ├── raise_maybe.sml ├── real0.out.ok ├── real0.sml ├── real1.out.ok ├── real1.sml ├── real2.out.ok ├── real2.sml ├── real3.sml ├── real5.sml ├── real_cmp.out.ok ├── real_cmp.sml ├── real_negabs.out.ok ├── real_negabs.sml ├── real_problem.sml ├── ref-int.out.ok ├── ref-int.sml ├── ref-real.out.ok ├── ref-real.sml ├── ref.out.ok ├── ref.sml ├── reg.out.ok ├── reg.sml ├── rev.sml ├── scratchmem.out.ok ├── scratchmem.sml ├── shra.out.ok ├── shra.sml ├── sign.out.ok ├── sign.sml ├── single.out.ok ├── single.sml ├── spawn.sml ├── spawn_alloccomp.sml ├── spawn_msort.sml ├── spawn_pmap.sml ├── spawn_simple.sml ├── spawn_simple2.sml ├── spawn_simple3.sml ├── spawn_simple4.sml ├── spawn_simple5.sml ├── spawn_simple6.sml ├── spawn_simple7.sml ├── spawn_simple8.sml ├── string1.out.ok ├── string1.sml ├── string_sub.out.ok ├── string_sub.sml ├── string_upd.out.ok ├── string_upd.sml ├── string_update.out.ok ├── string_update.sml ├── stringcvt.sml ├── strs.sml ├── tag_examples.c ├── test_dattyp.out.ok ├── test_dattyp.sml ├── testdyn1-nobasis.out.ok ├── testdyn1-nobasis.sml ├── testdyn1.sml ├── testdyn2.sml ├── word8.sml ├── word_list.out.ok ├── word_list.sml ├── word_problem.sml ├── xinlA.sml ├── xinlB.sml ├── xinline.mlb └── xinline.mlbout.ok ├── to_do └── vagrant └── ubuntu_i686_mlkit ├── .gitignore ├── README.md └── Vagrantfile /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | autom4te.cache 3 | bin 4 | lib 5 | config.log 6 | config.status 7 | configure 8 | *~ -------------------------------------------------------------------------------- /autobuild: -------------------------------------------------------------------------------- 1 | autoconf -o configure configure.ac 2 | autoheader configure.ac 3 | -------------------------------------------------------------------------------- /basis/.gitignore: -------------------------------------------------------------------------------- 1 | MLB 2 | *.log 3 | *.vcg -------------------------------------------------------------------------------- /basis/Array.sml: -------------------------------------------------------------------------------- 1 | structure Array : ARRAY = 2 | PolyTable (type 'a table = 'a array) 3 | -------------------------------------------------------------------------------- /basis/ArraySlice.sml: -------------------------------------------------------------------------------- 1 | structure ArraySlice :> ARRAY_SLICE = 2 | TableSlice(type 'a table = 'a array 3 | val maxLen = Array.maxLen 4 | type 'a vector_slice = 'a VectorSlice.slice 5 | val vector_slice_base = VectorSlice.base) 6 | -------------------------------------------------------------------------------- /basis/CommandLine.sml: -------------------------------------------------------------------------------- 1 | 2 | structure CommandLine : COMMAND_LINE = 3 | struct 4 | fun name () : string = prim("sml_commandline_name", ()) 5 | fun arguments () : string list = prim("sml_commandline_args", ()) 6 | end 7 | -------------------------------------------------------------------------------- /basis/Ints.sml: -------------------------------------------------------------------------------- 1 | structure Int8 = IntN(struct open Int val precision=SOME 8 end) 2 | structure Int16 = IntN(struct open Int val precision=SOME 16 end) 3 | -------------------------------------------------------------------------------- /basis/Makefile: -------------------------------------------------------------------------------- 1 | clean: 2 | rm -rf MLB run *~ *.vcg *.log 3 | rm -rf web/MLB web/*~ web/*.vcg web/*.log 4 | rm -rf io/MLB io/*~ io/*.vcg io/*.log 5 | -------------------------------------------------------------------------------- /basis/Prim.sml: -------------------------------------------------------------------------------- 1 | structure Prim = 2 | struct 3 | fun equal_int32ub(a:int,b) = a=b 4 | fun mod_int32ub(a:int,b,e) = a mod b handle _ => raise e 5 | fun div_int32ub(a:int,b,e) = a div b handle _ => raise e 6 | fun printStringML s = print s 7 | end 8 | -------------------------------------------------------------------------------- /basis/RegExp.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/basis/RegExp.sml -------------------------------------------------------------------------------- /basis/THREAD.sig: -------------------------------------------------------------------------------- 1 | signature THREAD = sig 2 | type 'a t 3 | val spawn : (unit->'a) -> ('a t->'b) -> 'b 4 | val get : 'a t -> 'a 5 | val numCores : unit -> int 6 | end 7 | -------------------------------------------------------------------------------- /basis/Text.sml: -------------------------------------------------------------------------------- 1 | structure Text : TEXT = 2 | struct 3 | structure Char = Char 4 | structure String = String 5 | structure Substring = Substring 6 | structure CharVector = CharVector 7 | structure CharArray = CharArray 8 | structure CharVectorSlice = CharVectorSlice 9 | structure CharArraySlice = CharArraySlice 10 | end 11 | -------------------------------------------------------------------------------- /basis/ThreadSeq.sml: -------------------------------------------------------------------------------- 1 | structure ThreadSeq :> THREAD = struct 2 | type 'a t = 'a 3 | fun spawn f g = g(f()) 4 | fun get x = x 5 | fun numCores () = 1 6 | end 7 | 8 | structure Thread = ThreadSeq 9 | -------------------------------------------------------------------------------- /basis/Vector.sml: -------------------------------------------------------------------------------- 1 | structure Vector : VECTOR = 2 | let structure T = PolyTable (type 'a table = 'a vector) 3 | in struct 4 | open T 5 | val update = updatev 6 | end 7 | end 8 | 9 | fun vector l = Vector.fromList l 10 | -------------------------------------------------------------------------------- /basis/VectorSlice.sml: -------------------------------------------------------------------------------- 1 | (* Opaque matching done in ArraySlice.sml *) 2 | structure VectorSlice :> VECTOR_SLICE = 3 | TableSlice(type 'a table = 'a vector 4 | val maxLen = Vector.maxLen 5 | type 'a vector_slice = 'a vector * int * int 6 | val vector_slice_base = fn x => x) 7 | -------------------------------------------------------------------------------- /basis/Word16.sml: -------------------------------------------------------------------------------- 1 | 2 | (** SigDoc *) 3 | 4 | structure Word16 : WORD = 5 | WordN(struct open Word val wordSize = 16 end) 6 | -------------------------------------------------------------------------------- /basis/binarymap.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | BINARYMAP.sml 3 | Binarymap.sml 4 | -------------------------------------------------------------------------------- /basis/dynlink.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | 4 | basis Dynlib = (* Dynamic linking support *) 5 | bas DYNLIB.sig Dynlib.sml end 6 | in open Dynlib 7 | end 8 | -------------------------------------------------------------------------------- /basis/io/.gitignore: -------------------------------------------------------------------------------- 1 | MLB 2 | *.log 3 | *.vcg -------------------------------------------------------------------------------- /basis/io/bin-stream-io.sig: -------------------------------------------------------------------------------- 1 | signature BIN_STREAM_IO = 2 | STREAM_IO 3 | where type elem = Word8Vector.elem 4 | where type vector = Word8Vector.vector 5 | -------------------------------------------------------------------------------- /basis/io/io-close.sml: -------------------------------------------------------------------------------- 1 | 2 | signature BIN_IO = BIN_IO 3 | signature TEXT_IO = TEXT_IO 4 | signature TEXT_STREAM_IO = TEXT_STREAM_IO 5 | 6 | (** SigDoc *) 7 | structure BinIO : BIN_IO = BinIO 8 | 9 | (** SigDoc *) 10 | structure TextIO : TEXT_IO = TextIO 11 | -------------------------------------------------------------------------------- /basis/listsort.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in 4 | LISTSORT.sml 5 | Listsort.sml 6 | end 7 | -------------------------------------------------------------------------------- /basis/md5.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in 4 | MD5.sml 5 | end 6 | -------------------------------------------------------------------------------- /basis/par-reml.mlb: -------------------------------------------------------------------------------- 1 | local 2 | basis.mlb 3 | in 4 | THREAD.sig 5 | ThreadSeq.sml 6 | Thread-reml.sml 7 | FORK_JOIN.sig 8 | ForkJoinSeq.sml 9 | ForkJoin-reml.sml 10 | end 11 | -------------------------------------------------------------------------------- /basis/par-seq.mlb: -------------------------------------------------------------------------------- 1 | local 2 | basis.mlb 3 | in 4 | THREAD.sig 5 | ThreadSeq.sml 6 | FORK_JOIN.sig 7 | ForkJoinSeq.sml 8 | end 9 | -------------------------------------------------------------------------------- /basis/par.mlb: -------------------------------------------------------------------------------- 1 | local 2 | basis.mlb 3 | in 4 | THREAD.sig 5 | ThreadSeq.sml 6 | Thread.sml 7 | FORK_JOIN.sig 8 | ForkJoinSeq.sml 9 | ForkJoin.sml 10 | end 11 | -------------------------------------------------------------------------------- /basis/real64_blocks.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | REAL64_BLOCK_BASE.sml 4 | in 5 | Real64Blocks.sml 6 | end 7 | -------------------------------------------------------------------------------- /basis/repl.mlb: -------------------------------------------------------------------------------- 1 | basis.mlb 2 | repl.sml 3 | -------------------------------------------------------------------------------- /basis/web/WEB_DB_BIND.sml: -------------------------------------------------------------------------------- 1 | signature WEB_DB_BIND = 2 | sig 3 | type sql = string 4 | structure Handle : WEB_DB_HANDLE 5 | val dml : sql -> Handle.db -> string list -> unit 6 | val fold : sql -> Handle.db -> string list -> ((string -> string) * 'a -> 'a) -> 'a -> 'a 7 | end 8 | -------------------------------------------------------------------------------- /basis/web/WEB_DYNLIB.sml: -------------------------------------------------------------------------------- 1 | signature WEB_DYNLIB = sig 2 | datatype flag = NOW | LAZY 3 | type ForeignLib 4 | val dlopen : string option * flag * bool -> ForeignLib 5 | val dlsym : string * string * ForeignLib -> unit 6 | val isLinked : string -> bool 7 | end 8 | -------------------------------------------------------------------------------- /basis/web/WEB_MIME.sml: -------------------------------------------------------------------------------- 1 | signature WEB_MIME = sig 2 | val getMime : string -> string 3 | val addEncoding : string -> string 4 | end 5 | (* 6 | [getMime s] returns the mime-type of the file s based on the file's 7 | extension and it's content. 8 | 9 | [addEncoding s] adds configured encoding to mime-type s. 10 | *) 11 | -------------------------------------------------------------------------------- /basis/web/xmlrpc/xmlrpc.mlb: -------------------------------------------------------------------------------- 1 | local 2 | ../../basis.mlb 3 | ../../kitlib.mlb 4 | Parsercomb.sig 5 | Parsercomb.sml 6 | WSeq.sig 7 | WSeq.sml 8 | in 9 | XMLRPC_TYPE.sig 10 | XMLRPC.sig 11 | XMLrpc.sml 12 | end 13 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | README_BIN 2 | README_SMLSERVER_BIN -------------------------------------------------------------------------------- /doc/manual/Makefile: -------------------------------------------------------------------------------- 1 | all: mlkit.pdf 2 | 3 | mlkit.pdf: mlkit.tex Makefile 4 | pdflatex mlkit 5 | bibtex mlkit 6 | pdflatex mlkit 7 | pdflatex mlkit 8 | makeindex mlkit 9 | pdflatex mlkit 10 | pdflatex mlkit 11 | 12 | clean: 13 | rm -rf *~ auto *.ind *.log *.idx *.aux *.dvi *.toc *.info *.ilg *.blg .xvpics *.bbl *.out .\#* mlkit.pdf 14 | -------------------------------------------------------------------------------- /doc/manual/README: -------------------------------------------------------------------------------- 1 | This is "Programming with Regions in the MLKit", the user's guide to 2 | the MLKit. 3 | 4 | Style conventions: 5 | ------------------ 6 | 7 | Profile graphs should be produced with the -eps 138mm option to rp2ps. 8 | 9 | We use the series comma. 10 | 11 | Pdf-version 12 | ----------- 13 | 14 | See Makefile 15 | -------------------------------------------------------------------------------- /doc/manual/length_region.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/length_region.pdf -------------------------------------------------------------------------------- /doc/manual/length_stack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/length_stack.pdf -------------------------------------------------------------------------------- /doc/manual/life200.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/life200.pdf -------------------------------------------------------------------------------- /doc/manual/life80.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/life80.pdf -------------------------------------------------------------------------------- /doc/manual/life_ex2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/life_ex2.pdf -------------------------------------------------------------------------------- /doc/manual/life_ex3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/life_ex3.pdf -------------------------------------------------------------------------------- /doc/manual/life_ex4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/life_ex4.pdf -------------------------------------------------------------------------------- /doc/manual/mlkit-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/mlkit-logo.png -------------------------------------------------------------------------------- /doc/manual/mlkit_compiling_kitkbjul9.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/mlkit_compiling_kitkbjul9.pdf -------------------------------------------------------------------------------- /doc/manual/mlkit_compiling_kitkbjul9_400msec.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/mlkit_compiling_kitkbjul9_400msec.pdf -------------------------------------------------------------------------------- /doc/manual/msort.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/msort.pdf -------------------------------------------------------------------------------- /doc/manual/msortregion.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/msortregion.pdf -------------------------------------------------------------------------------- /doc/manual/msortreset2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/msortreset2.pdf -------------------------------------------------------------------------------- /doc/manual/msortstack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/msortstack.pdf -------------------------------------------------------------------------------- /doc/manual/nlength_region.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/nlength_region.pdf -------------------------------------------------------------------------------- /doc/manual/nlength_stack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/nlength_stack.pdf -------------------------------------------------------------------------------- /doc/manual/prof_eks1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/prof_eks1.pdf -------------------------------------------------------------------------------- /doc/manual/prof_eks2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/prof_eks2.pdf -------------------------------------------------------------------------------- /doc/manual/prof_eks3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/prof_eks3.pdf -------------------------------------------------------------------------------- /doc/manual/prof_eks4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/prof_eks4.pdf -------------------------------------------------------------------------------- /doc/manual/scan.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/scan.pdf -------------------------------------------------------------------------------- /doc/manual/scan_posix.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/scan_posix.pdf -------------------------------------------------------------------------------- /doc/manual/scan_rev1_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/scan_rev1_1.pdf -------------------------------------------------------------------------------- /doc/manual/scan_rev1_2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/scan_rev1_2.pdf -------------------------------------------------------------------------------- /doc/manual/scan_rev2_1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/scan_rev2_1.pdf -------------------------------------------------------------------------------- /doc/manual/scan_stream.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/scan_stream.pdf -------------------------------------------------------------------------------- /doc/manual/scan_stream_nogc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/manual/scan_stream_nogc.pdf -------------------------------------------------------------------------------- /doc/mlkit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/doc/mlkit.pdf -------------------------------------------------------------------------------- /js/.gitignore: -------------------------------------------------------------------------------- 1 | favicon.ico 2 | smltojsonline 3 | smltojsonline.tgz 4 | smltojs.man.html -------------------------------------------------------------------------------- /js/appfun/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /js/appfun/AppFun2.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/basis/js.mlb 3 | $(SML_LIB)/codemirror/sml/codemirror.mlb 4 | $(SML_LIB)/basis/dojo.mlb 5 | $(SML_LIB)/basis/md5.mlb 6 | oauth.mlb 7 | json.mlb 8 | dropbox.sig 9 | dropbox.sml 10 | in AppFun2.sml 11 | end 12 | -------------------------------------------------------------------------------- /js/appfun/appfun.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/basis/js.mlb 3 | $(SML_LIB)/codemirror/sml/codemirror.mlb 4 | in AppFun.sml 5 | end 6 | -------------------------------------------------------------------------------- /js/appfun/dropbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/appfun/dropbox.png -------------------------------------------------------------------------------- /js/appfun/json.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | string_map.sml 3 | in json.sig 4 | json.sml 5 | end 6 | -------------------------------------------------------------------------------- /js/appfun/nodropbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/appfun/nodropbox.png -------------------------------------------------------------------------------- /js/appfun/oauth.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/basis/js.mlb 3 | in oauth.sig 4 | oauth.sml 5 | end 6 | -------------------------------------------------------------------------------- /js/appfun/smltojs_logo_no_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/appfun/smltojs_logo_no_text.png -------------------------------------------------------------------------------- /js/appfun/smltojs_logo_no_text256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/appfun/smltojs_logo_no_text256x256.png -------------------------------------------------------------------------------- /js/appfun/smltojs_logo_no_text64x64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/appfun/smltojs_logo_no_text64x64.png -------------------------------------------------------------------------------- /js/basis/.gitignore: -------------------------------------------------------------------------------- 1 | MLB 2 | *.html -------------------------------------------------------------------------------- /js/basis/Array.sml: -------------------------------------------------------------------------------- 1 | structure Array : ARRAY = 2 | WordTable (type 'a table = 'a array) 3 | 4 | -------------------------------------------------------------------------------- /js/basis/ArraySlice.sml: -------------------------------------------------------------------------------- 1 | structure ArraySlice :> ARRAY_SLICE = 2 | TableSlice(type 'a table = 'a array 3 | val maxLen = Array.maxLen 4 | type 'a vector_slice = 'a VectorSlice.slice 5 | val vector_slice_base = VectorSlice.base) 6 | -------------------------------------------------------------------------------- /js/basis/Control.sml: -------------------------------------------------------------------------------- 1 | structure Control : CONTROL = struct 2 | val printer_set = Initial.printer_set 3 | val printer_get = Initial.printer_get 4 | end 5 | -------------------------------------------------------------------------------- /js/basis/Makefile: -------------------------------------------------------------------------------- 1 | clean: 2 | rm -rf *~ MLB *.mlb.html -------------------------------------------------------------------------------- /js/basis/String2.sml: -------------------------------------------------------------------------------- 1 | 2 | structure String : STRING 3 | where type char = char 4 | and type string = string 5 | = String 6 | 7 | structure Char : CHAR = Char 8 | -------------------------------------------------------------------------------- /js/basis/Text.sml: -------------------------------------------------------------------------------- 1 | structure Text : TEXT = 2 | struct 3 | structure Char = Char 4 | structure String = String 5 | structure Substring = Substring 6 | structure CharVector = CharVector 7 | structure CharArray = CharArray 8 | structure CharVectorSlice = CharVectorSlice 9 | structure CharArraySlice = CharArraySlice 10 | end 11 | -------------------------------------------------------------------------------- /js/basis/Vector.sml: -------------------------------------------------------------------------------- 1 | structure Vector : VECTOR = 2 | let structure T = WordTable (type 'a table = 'a vector) 3 | in struct 4 | open T 5 | val update = updatev 6 | end 7 | end 8 | 9 | fun vector l = Vector.fromList l 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /js/basis/VectorSlice.sml: -------------------------------------------------------------------------------- 1 | (* Opaque matching done in ArraySlice.sml *) 2 | structure VectorSlice :> VECTOR_SLICE = 3 | TableSlice(type 'a table = 'a vector 4 | val maxLen = Vector.maxLen 5 | type 'a vector_slice = 'a vector * int * int 6 | val vector_slice_base = fn x => x) 7 | -------------------------------------------------------------------------------- /js/basis/dojo.mlb: -------------------------------------------------------------------------------- 1 | local 2 | basis.mlb 3 | js.mlb 4 | in 5 | dojo.sig 6 | dojo.sml 7 | formlets.sig 8 | formlets.sml 9 | end -------------------------------------------------------------------------------- /js/basis/html.mlb: -------------------------------------------------------------------------------- 1 | local basis.mlb 2 | in ann safeLinkTimeElimination 3 | in HTML.sig Html.sml 4 | end 5 | end -------------------------------------------------------------------------------- /js/basis/js.mlb: -------------------------------------------------------------------------------- 1 | local basis.mlb 2 | in JS_CORE.sml JsCore.sml 3 | JS.sig Js.sml 4 | html.mlb 5 | local xmlrpc.mlb 6 | in ann safeLinkTimeElimination in XMLrpcClient.sml end 7 | end 8 | end -------------------------------------------------------------------------------- /js/basis/md5.mlb: -------------------------------------------------------------------------------- 1 | local 2 | basis.mlb 3 | in 4 | md5.sig 5 | md5.sml 6 | end -------------------------------------------------------------------------------- /js/basis/rwp.mlb: -------------------------------------------------------------------------------- 1 | local 2 | basis.mlb 3 | in 4 | js.mlb 5 | RWP.sig 6 | Rwp.sml 7 | end -------------------------------------------------------------------------------- /js/basis/utest.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | in utest.sig 3 | utest.sml 4 | end -------------------------------------------------------------------------------- /js/basis/xmlrpc.mlb: -------------------------------------------------------------------------------- 1 | local 2 | basis.mlb 3 | Parsercomb.sig 4 | Parsercomb.sml 5 | WSeq.sig 6 | WSeq.sml 7 | in 8 | XMLRPC_TYPE.sig 9 | XMLRPC.sig 10 | XMLrpc.sml 11 | end 12 | -------------------------------------------------------------------------------- /js/codemirror/Makefile: -------------------------------------------------------------------------------- 1 | clean: 2 | rm -rf sml/*~ sml/MLB 3 | rm -rf *~ 4 | rm -rf dist/*~ dist/contrib/*~ dist/css/*~ dist/js/*~ dist/contrib/sml/*~ dist/contrib/sml/css/*~ dist/contrib/sml/js/*~ 5 | rm -rf dist/contrib/fundamental/*~ dist/contrib/fundamental/css/*~ dist/contrib/fundamental/js/*~ -------------------------------------------------------------------------------- /js/codemirror/sml/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /js/codemirror/sml/codemirror.mlb: -------------------------------------------------------------------------------- 1 | 2 | local 3 | $SML_LIB/basis/basis.mlb 4 | $SML_LIB/basis/js.mlb 5 | in 6 | codemirror.sig 7 | codemirror.sml 8 | end 9 | -------------------------------------------------------------------------------- /js/doc/.gitignore: -------------------------------------------------------------------------------- 1 | generated_tags.js 2 | *.html -------------------------------------------------------------------------------- /js/doc/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/doc/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /js/doc/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Verdana", "sans-serif"; 3 | font-size: 12px; 4 | } -------------------------------------------------------------------------------- /js/otests/content: -------------------------------------------------------------------------------- 1 | Examples=github.sml,life.sml,war.sml; 2 | Simple=fac.sml; 3 | Utests=array.sml,array2.sml,arrayslice.sml,bytechar.sml,date.sml,general.sml,int.sml,int31.sml,int32.sml,list.sml,listpair.sml,math.sml, 4 | real.sml,string.sml,stringcvt.sml,testdyn1.sml,time.sml,vector.sml,vectorslice.sml; 5 | Reactive=frp.sml,sheeps.sml,showtime.sml,svgballs.sml; 6 | -------------------------------------------------------------------------------- /js/otests/sheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/otests/sheep.png -------------------------------------------------------------------------------- /js/slides_diku_2007-11-27.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/slides_diku_2007-11-27.pdf -------------------------------------------------------------------------------- /js/slides_lunch_2007-09-17.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/slides_lunch_2007-09-17.pdf -------------------------------------------------------------------------------- /js/smltojs_logo_color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/smltojs_logo_color.png -------------------------------------------------------------------------------- /js/smltojs_logo_color160.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/smltojs_logo_color160.png -------------------------------------------------------------------------------- /js/smltojs_logo_no_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/smltojs_logo_no_text.png -------------------------------------------------------------------------------- /js/test/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | MLB 3 | *.res 4 | *.out 5 | *.snippet 6 | *.mlbsnippet -------------------------------------------------------------------------------- /js/test/appfuntest/appfuntest.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/js.mlb 4 | ../../appfun/appfun2.mlb 5 | in 6 | appfuntest.sml 7 | end -------------------------------------------------------------------------------- /js/test/appfuntest/smltojs_logo_transparent_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/appfuntest/smltojs_logo_transparent_small.png -------------------------------------------------------------------------------- /js/test/armor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/armor.png -------------------------------------------------------------------------------- /js/test/cal.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | HTML.sig 3 | Html.sml 4 | cal.sml -------------------------------------------------------------------------------- /js/test/canvas_ex1.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/js.mlb 4 | in 5 | canvas_ex1.sml 6 | end -------------------------------------------------------------------------------- /js/test/counter.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | counter.sml -------------------------------------------------------------------------------- /js/test/dojo-flat/.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "." 3 | } -------------------------------------------------------------------------------- /js/test/dojo-flat/.gitignore: -------------------------------------------------------------------------------- 1 | basis 2 | dgrid 3 | dijit 4 | dojo 5 | dojox 6 | dstore 7 | prims.js 8 | put-selector 9 | xstyle 10 | -------------------------------------------------------------------------------- /js/test/dojo-flat/README: -------------------------------------------------------------------------------- 1 | see Makefile for instructions... -------------------------------------------------------------------------------- /js/test/dojo-flat/dojo_test.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/js.mlb 4 | $(SML_LIB)/basis/dojo.mlb 5 | notify.sml 6 | in dojo_test.sml 7 | end -------------------------------------------------------------------------------- /js/test/dojo/.gitignore: -------------------------------------------------------------------------------- 1 | basis 2 | dgrid 3 | dijit 4 | dojo 5 | dojox 6 | dstore 7 | prims.js 8 | put-selector 9 | xstyle 10 | -------------------------------------------------------------------------------- /js/test/dojo/README: -------------------------------------------------------------------------------- 1 | see Makefile for instructions... -------------------------------------------------------------------------------- /js/test/dojo/dojo_test.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/js.mlb 4 | $(SML_LIB)/basis/dojo.mlb 5 | notify.sml 6 | in dojo_test.sml 7 | end -------------------------------------------------------------------------------- /js/test/dojo/formlets_test.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/js.mlb 4 | $(SML_LIB)/basis/dojo.mlb 5 | in 6 | formlets_test.sml 7 | end -------------------------------------------------------------------------------- /js/test/dojo/trash32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/dojo/trash32.png -------------------------------------------------------------------------------- /js/test/exec.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | exec.sml -------------------------------------------------------------------------------- /js/test/export.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | export.sml -------------------------------------------------------------------------------- /js/test/export.sml: -------------------------------------------------------------------------------- 1 | fun myfun x = x + 1 2 | 3 | val () = _export("myfun", myfun) 4 | -------------------------------------------------------------------------------- /js/test/fix2.html.out.ok: -------------------------------------------------------------------------------- 1 | Loading fix2.html 2 | Testing mutual recursion 3 | 4 | Testing mutual recursion toplevel 5 | 6 | Ok - even... 7 | Ok - not even... 8 | Ok - odd... 9 | Ok - not odd... 10 | Testing mutual recursion local 11 | 12 | Ok - even... 13 | Ok - not even... 14 | Ok - odd... 15 | Ok - not odd... 16 | 17 | End of test. 18 | -------------------------------------------------------------------------------- /js/test/frp.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | frp2.sml 4 | frp_ex1.sml -------------------------------------------------------------------------------- /js/test/lamp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/lamp.png -------------------------------------------------------------------------------- /js/test/life.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | life.sml -------------------------------------------------------------------------------- /js/test/listpair.html.out.ok: -------------------------------------------------------------------------------- 1 | Loading listpair.html 2 | File listpair.sml: Testing structure ListPair... 3 | 4 | test1 OK 5 | test2a OK 6 | test2b OK 7 | test3a OK 8 | checkv OK 9 | checkv OK 10 | test5a OK 11 | test5b OK 12 | test5c OK 13 | checkv OK 14 | checkv OK 15 | test6 OK 16 | test7 OK 17 | Test ended. 18 | -------------------------------------------------------------------------------- /js/test/ll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/ll.gif -------------------------------------------------------------------------------- /js/test/lr.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/lr.gif -------------------------------------------------------------------------------- /js/test/ntemp.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | HTML.sig 4 | Html.sml 5 | Web.sml 6 | ntemp.sml -------------------------------------------------------------------------------- /js/test/packreal2.html.out.ok: -------------------------------------------------------------------------------- 1 | Loading packreal2.html 2 | big: C0,A,48,27,B6,FE,2E,6F 3 | little: 6F,2E,FE,B6,27,48,A,C0 4 | 5 | -------------------------------------------------------------------------------- /js/test/packreal3.html.out.ok: -------------------------------------------------------------------------------- 1 | Loading packreal3.html 2 | Testing PackRealBig 3 | OK 4 | OK 5 | OK 6 | OK 7 | Testing PackRealLittle 8 | OK 9 | OK 10 | OK 11 | OK 12 | 13 | -------------------------------------------------------------------------------- /js/test/philip.html.out.ok: -------------------------------------------------------------------------------- 1 | Loading philip.html 2 | ok 3 | -------------------------------------------------------------------------------- /js/test/philip.sml: -------------------------------------------------------------------------------- 1 | fun bar x = 2 | fn x => () 3 | 4 | fun foo () = 5 | (bar (Real.fromString "4.0"); ()) 6 | 7 | val () = foo () 8 | 9 | val () = print "ok\n" 10 | -------------------------------------------------------------------------------- /js/test/plantgreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/plantgreen.png -------------------------------------------------------------------------------- /js/test/rhtml_ex1.mlb: -------------------------------------------------------------------------------- 1 | rwp3.mlb 2 | rhtml_ex1.sml -------------------------------------------------------------------------------- /js/test/rwp.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | rwp.sig 4 | rwp3.sml 5 | rhtml.sig 6 | rhtml.sml 7 | color.sig 8 | color.sml 9 | (* 10 | rwidget.sig 11 | rwidget.sml 12 | *) -------------------------------------------------------------------------------- /js/test/rwp3.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | rwp.sig 4 | rwp3.sml 5 | rhtml.sig 6 | rhtml.sml 7 | color.sig 8 | color.sml 9 | rwidget.sig 10 | rwidget.sml -------------------------------------------------------------------------------- /js/test/rwp_ex1.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/rwp.mlb 4 | in 5 | rwp_ex1.sml 6 | end -------------------------------------------------------------------------------- /js/test/rwp_ex2.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/rwp.mlb 4 | in 5 | rwp_ex2.sml 6 | end -------------------------------------------------------------------------------- /js/test/rwp_ex3.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/rwp.mlb 4 | in 5 | rwp_ex3.sml 6 | end -------------------------------------------------------------------------------- /js/test/rwp_ex4.mlb: -------------------------------------------------------------------------------- 1 | rwp3.mlb 2 | rwp_ex4.sml -------------------------------------------------------------------------------- /js/test/rwp_ex5.mlb: -------------------------------------------------------------------------------- 1 | rwp3.mlb 2 | rwp_ex5.sml -------------------------------------------------------------------------------- /js/test/sheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/sheep.png -------------------------------------------------------------------------------- /js/test/stringcvt.html.out.ok: -------------------------------------------------------------------------------- 1 | Loading stringcvt.html 2 | File stringcvt.sml: Testing structure StringCvt... 3 | 4 | test1 OK 5 | test2 OK 6 | test3 OK 7 | test4 OK 8 | test5 OK 9 | test6 OK 10 | test7 OK 11 | test8 OK 12 | test9 OK 13 | test10 OK 14 | Test ended. 15 | -------------------------------------------------------------------------------- /js/test/tablechairs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/tablechairs.png -------------------------------------------------------------------------------- /js/test/tabs.mlb: -------------------------------------------------------------------------------- 1 | 2 | local 3 | $(SML_LIB)/basis/basis.mlb 4 | $(SML_LIB)/basis/js.mlb 5 | in 6 | tabs.sml 7 | end -------------------------------------------------------------------------------- /js/test/tailrec2.html.out.ok: -------------------------------------------------------------------------------- 1 | Loading tailrec2.html 2 | x= 17156667 3 | y= 92 4 | OK 5 | 6 | -------------------------------------------------------------------------------- /js/test/tdom2_ex1.mlb: -------------------------------------------------------------------------------- 1 | rwp3.mlb 2 | TDOM2.sig 3 | TDom2.sml 4 | tdom2_ex1.sml -------------------------------------------------------------------------------- /js/test/tdom_ex1.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | frp2.sml 4 | TDOM.sig 5 | TDom.sml 6 | tdom_ex1.sml -------------------------------------------------------------------------------- /js/test/tdom_ex1.sml: -------------------------------------------------------------------------------- 1 | 2 | open TimeVal 3 | open TDom 4 | infix & 5 | 6 | val _ = print "
" 7 | 8 | val a = h1($(arr Time.toString (timer 100))) & h1($(arr (fn (x,y) => Int.toString x ^ " - " ^ Int.toString y) (mouse()))) 9 | 10 | val _ = insertDOM "bdy" a 11 | -------------------------------------------------------------------------------- /js/test/temp.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | temp.sml -------------------------------------------------------------------------------- /js/test/test1.sml: -------------------------------------------------------------------------------- 1 | 2 | val _ = print("Hello world") 3 | -------------------------------------------------------------------------------- /js/test/tlist.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | frp2.sml 4 | tlist.sml -------------------------------------------------------------------------------- /js/test/ul.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/ul.gif -------------------------------------------------------------------------------- /js/test/ur.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/ur.gif -------------------------------------------------------------------------------- /js/test/vector.html.out.ok: -------------------------------------------------------------------------------- 1 | Loading vector.html 2 | File vector.sml: Testing Vector... 3 | 4 | test1: OK 5 | test2: OK 6 | test3: OK 7 | test4a: OK 8 | test4b: OK 9 | test4c: OK 10 | test5: OK 11 | test6a: OK 12 | test6b: OK 13 | test6c: OK 14 | test7: OK 15 | test8: OK 16 | test10a: OK 17 | test11a: OK 18 | 19 | Test ended 20 | -------------------------------------------------------------------------------- /js/test/walls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/js/test/walls.png -------------------------------------------------------------------------------- /js/test/xmlrpc_test1.mlb: -------------------------------------------------------------------------------- 1 | $SML_LIB/basis/basis.mlb 2 | $SML_LIB/basis/js.mlb 3 | xmlrpc_test1.sml -------------------------------------------------------------------------------- /kitdemo/INT_SET.sml: -------------------------------------------------------------------------------- 1 | signature INT_SET = 2 | sig 3 | type 'a set 4 | val empty : int set 5 | val singleton : int -> int set 6 | val mem : int * int set -> bool 7 | val union : int set * int set -> int set 8 | end -------------------------------------------------------------------------------- /kitdemo/IntSet.sml: -------------------------------------------------------------------------------- 1 | structure IntSet1 : INT_SET = PolySet 2 | structure IntSet2 :> INT_SET = PolySet -------------------------------------------------------------------------------- /kitdemo/PolySet.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | PolySet.sml 3 | INT_SET.sml 4 | IntSet.sml 5 | -------------------------------------------------------------------------------- /kitdemo/PolySet.sml: -------------------------------------------------------------------------------- 1 | structure PolySet = 2 | struct 3 | type 'a set = 'a list 4 | val empty = [] 5 | fun singleton x = [x] 6 | fun mem(x,[]) = false 7 | | mem(x,y::ys) = x=y orelse mem(x,ys) 8 | fun union(s1,[]) = s1 9 | | union(s1,x::s2) = if mem(x,s1) then union(s1,s2) 10 | else x::union(s1,s2) 11 | end 12 | -------------------------------------------------------------------------------- /kitdemo/SET.sig: -------------------------------------------------------------------------------- 1 | signature SET = 2 | sig 3 | eqtype elem and set 4 | val empty : set 5 | val singleton : elem -> set 6 | val mem : elem -> set -> bool 7 | val union : set * set -> set 8 | val pr : set -> string 9 | end -------------------------------------------------------------------------------- /kitdemo/Set.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | local utils/utils.mlb 3 | in SET.sig Set.sml SetApp.sml 4 | end 5 | -------------------------------------------------------------------------------- /kitdemo/SetApp.sml: -------------------------------------------------------------------------------- 1 | structure IntSet = Set(type elem = int 2 | val lt = op < 3 | fun pr a = Int.toString a) 4 | open IntSet 5 | val _ = print (pr (union(singleton 2, singleton 5))) 6 | -------------------------------------------------------------------------------- /kitdemo/append.sml: -------------------------------------------------------------------------------- 1 | infixr 5 @ 2 | fun [] @ ys = ys 3 | | (x::xs) @ ys = x :: (xs @ ys) 4 | val l = [1] @ [2,3] 5 | -------------------------------------------------------------------------------- /kitdemo/apply.sml: -------------------------------------------------------------------------------- 1 | fun apply f x = f x 2 | val y = apply (fn n => n + 1.0) 5.0 3 | val z = apply (fn m => m) 6 4 | -------------------------------------------------------------------------------- /kitdemo/compose.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | compose.sml 3 | -------------------------------------------------------------------------------- /kitdemo/compose.sml: -------------------------------------------------------------------------------- 1 | fun (f o g) x = f(g x); 2 | -------------------------------------------------------------------------------- /kitdemo/dangling.sml: -------------------------------------------------------------------------------- 1 | val f = let val x = ref (2, [1]) 2 | in fn y => (#1 (!x), y) 3 | end 4 | val r = f 5 5 | -------------------------------------------------------------------------------- /kitdemo/elimpair.sml: -------------------------------------------------------------------------------- 1 | val n = let 2 | val pair = if true then (3+4, 4+5) 3 | else (4, 5) 4 | in 5 | #1 pair 6 | end; 7 | 8 | 9 | -------------------------------------------------------------------------------- /kitdemo/escape.sml: -------------------------------------------------------------------------------- 1 | fun g() = 2 | let val x = [5,7] 3 | fun f(y) = (if y>3 then x@x else x; 4 | 5) 5 | in 6 | f 1; f 4 7 | end; 8 | 9 | -------------------------------------------------------------------------------- /kitdemo/escape1.sml: -------------------------------------------------------------------------------- 1 | fun g() = 2 | let fun mk_x() = [5,7] 3 | fun f(y) = let val x = mk_x() 4 | in if y>3 then x@x else x; 5 5 | end 6 | in 7 | f 1; f 4 8 | end; 9 | -------------------------------------------------------------------------------- /kitdemo/escape2.sml: -------------------------------------------------------------------------------- 1 | fun g() = 2 | let 3 | fun f(x,y) = (if y>3 then x@x else x; 5) 4 | 5 | in 6 | let val x = [5,7] 7 | in f(x, 1); f(x, 4) 8 | end 9 | end; 10 | -------------------------------------------------------------------------------- /kitdemo/fold1.sml: -------------------------------------------------------------------------------- 1 | fun foldl f b xs = 2 | case xs of 3 | [] => b 4 | | x::xs' => foldl f (f x b) xs' 5 | -------------------------------------------------------------------------------- /kitdemo/fold2.sml: -------------------------------------------------------------------------------- 1 | fun foldl f b xs = 2 | let fun loop(p as ([], b)) = p 3 | | loop(x::xs, b) = loop(xs,f x b) 4 | in 5 | #2(loop(xs,b)) 6 | end 7 | -------------------------------------------------------------------------------- /kitdemo/fold3.sml: -------------------------------------------------------------------------------- 1 | fun foldl' f b xs = 2 | let fun loop(p as ([], b))= p 3 | | loop(x::xs, b) = loop(xs,f(x, b)) 4 | in 5 | #2(loop(xs,b)) 6 | end 7 | -------------------------------------------------------------------------------- /kitdemo/fold4.sml: -------------------------------------------------------------------------------- 1 | fun foldl f b xs = 2 | let fun loop([], b) = b 3 | | loop(x::xs, b) = loop(xs,f x b) 4 | in 5 | loop(xs,b) 6 | end 7 | -------------------------------------------------------------------------------- /kitdemo/fromto.sml: -------------------------------------------------------------------------------- 1 | fun fromto(a, b) = if a>b then [] 2 | else a :: fromto(a+1, b) 3 | val l = #1(fromto(1,10), fromto(100,110)) 4 | 5 | -------------------------------------------------------------------------------- /kitdemo/helloworld.sml: -------------------------------------------------------------------------------- 1 | val _ = print "hello world\n"; 2 | -------------------------------------------------------------------------------- /kitdemo/lambda.sml: -------------------------------------------------------------------------------- 1 | val n = let val f = let val xs = [1,2] 2 | in fn ys => length xs + length ys 3 | end 4 | in f [7] 5 | end 6 | -------------------------------------------------------------------------------- /kitdemo/lambda1.sml: -------------------------------------------------------------------------------- 1 | fun apply f x = f x 2 | -------------------------------------------------------------------------------- /kitdemo/lambda2.sml: -------------------------------------------------------------------------------- 1 | val y = apply (fn n => n+1) 5 2 | val z = apply (fn m => m) 9 3 | -------------------------------------------------------------------------------- /kitdemo/lambda3.sml: -------------------------------------------------------------------------------- 1 | fun map f [] = [] 2 | | map f (x::xs) = f(x) :: map f xs 3 | -------------------------------------------------------------------------------- /kitdemo/lambda4.sml: -------------------------------------------------------------------------------- 1 | val x = map (fn x => x+1) [7,11] 2 | -------------------------------------------------------------------------------- /kitdemo/map.sml: -------------------------------------------------------------------------------- 1 | fun map f [] = [] 2 | | map f (x::xs) = f(x) :: map f xs 3 | 4 | val x = map (fn x => x+1) [7,11] 5 | -------------------------------------------------------------------------------- /kitdemo/minilist.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | minilist.sml 3 | -------------------------------------------------------------------------------- /kitdemo/minilist.sml: -------------------------------------------------------------------------------- 1 | val abc = ["a", "b", "c"]; -------------------------------------------------------------------------------- /kitdemo/msort.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | msort.sml 3 | upto.sml 4 | msortrun.sml 5 | -------------------------------------------------------------------------------- /kitdemo/msortreset1.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | upto.sml 3 | msortreset1.sml 4 | 5 | -------------------------------------------------------------------------------- /kitdemo/msortreset2.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | upto.sml 3 | msortreset2.sml 4 | 5 | -------------------------------------------------------------------------------- /kitdemo/msortrun.sml: -------------------------------------------------------------------------------- 1 | 2 | val runmsort = msort(upto(200000)) 3 | 4 | val result = print "Really done\n"; 5 | -------------------------------------------------------------------------------- /kitdemo/mylib.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | mylib.sml 3 | test_mylib.sml 4 | -------------------------------------------------------------------------------- /kitdemo/onetwothree.sml: -------------------------------------------------------------------------------- 1 | let val l = [1, 2, 3]; 2 | val (x::_) = l 3 | in x end; 4 | -------------------------------------------------------------------------------- /kitdemo/projection.sml: -------------------------------------------------------------------------------- 1 | val xy = ((),()) 2 | val x = #1 xy; 3 | -------------------------------------------------------------------------------- /kitdemo/refs1.sml: -------------------------------------------------------------------------------- 1 | fun id(x) = let val r = ref x in ! r end; -------------------------------------------------------------------------------- /kitdemo/refs2.sml: -------------------------------------------------------------------------------- 1 | 2 | val r = ref ([]:string list) 3 | 4 | fun memo_id x = (r:= x:: !r; x) 5 | 6 | val y = memo_id "abc" 7 | val z = memo_id "efg"; -------------------------------------------------------------------------------- /kitdemo/refs3.sml: -------------------------------------------------------------------------------- 1 | val it = let 2 | val x: int ref = ref 3 3 | val y: bool ref = ref true 4 | val z: int ref = if !y then x else ref 5 5 | in 6 | z:= 6; 7 | !x 8 | end 9 | -------------------------------------------------------------------------------- /kitdemo/runmsort.sml: -------------------------------------------------------------------------------- 1 | val runmsort = msort(fromto(1, 50000)) 2 | 3 | val result = output(std_out, "Really done\n"); -------------------------------------------------------------------------------- /kitdemo/scan.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | lib.sml 3 | scan.sml 4 | -------------------------------------------------------------------------------- /kitdemo/scan_rev1.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | lib.sml 3 | scan_rev1.sml 4 | -------------------------------------------------------------------------------- /kitdemo/scan_rev2.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | lib.sml 3 | scan_rev2.sml 4 | -------------------------------------------------------------------------------- /kitdemo/scan_stream.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | lib_stream.sml 3 | scan_stream.sml 4 | -------------------------------------------------------------------------------- /kitdemo/select_second.c: -------------------------------------------------------------------------------- 1 | #include "../src/Runtime/Tagging.h" 2 | 3 | int select_second(int pair) { 4 | return second(pair); 5 | } 6 | -------------------------------------------------------------------------------- /kitdemo/select_second.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | (* select_second.o *) 3 | select_second.sml 4 | 5 | -------------------------------------------------------------------------------- /kitdemo/select_second.sml: -------------------------------------------------------------------------------- 1 | fun second(pair : 'a * 'b) : 'b = 2 | prim("select_second", "select_second", pair) 3 | -------------------------------------------------------------------------------- /kitdemo/sma1.sml: -------------------------------------------------------------------------------- 1 | 2 | fun f [] = [] 3 | | f (x::xs) = x+1 :: f xs 4 | 5 | val n = length(let val l1 = [1,2,3] 6 | in if true then f l1 else l1 7 | end) 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /kitdemo/tail.sml: -------------------------------------------------------------------------------- 1 | local 2 | fun f'(p as (0,b)) = p 3 | | f'(n,b) = f'(n-1,n*b) 4 | in 5 | fun f(a,b) = #2(f'(a,b)) 6 | end; 7 | 8 | -------------------------------------------------------------------------------- /kitdemo/tail2.sml: -------------------------------------------------------------------------------- 1 | fun g (n,b) = h (n-1) b 2 | and h 0 b = b 3 | | h n b = g(n,n*b) 4 | -------------------------------------------------------------------------------- /kitdemo/takeanddrop.sml: -------------------------------------------------------------------------------- 1 | fun take([], i) = [] 2 | | take(x::xs, i) = 3 | if i>0 then x::take(xs, i-1) 4 | else [] 5 | fun drop(l as [], _) = l 6 | | drop(l as (x::xs),i) = if i>0 then drop(xs,i-1) else l; -------------------------------------------------------------------------------- /kitdemo/trees.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | takeanddrop.sml 3 | trees.sml 4 | -------------------------------------------------------------------------------- /kitdemo/tststrcmp.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/kitdemo/tststrcmp.sml -------------------------------------------------------------------------------- /kitdemo/upto.sml: -------------------------------------------------------------------------------- 1 | fun upto n = 2 | let fun loop(p as (0,acc)) = p 3 | | loop(n, acc) = 4 | loop(n-1, n::acc) 5 | in 6 | #2(loop(n,[])) 7 | end 8 | 9 | -------------------------------------------------------------------------------- /kitdemo/utils/ListUtils.sml: -------------------------------------------------------------------------------- 1 | structure ListUtils = 2 | struct 3 | fun pr_list pr list = 4 | let fun loop [] = "}" 5 | | loop [x] = pr x ^ "}" 6 | | loop (x::xs) = pr x ^ "," ^ loop xs 7 | in "{" ^ loop list 8 | end 9 | end -------------------------------------------------------------------------------- /kitdemo/utils/utils.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in 4 | ListUtils.sml 5 | end 6 | -------------------------------------------------------------------------------- /kitdemo/vpprob.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | vpprob.sml 3 | -------------------------------------------------------------------------------- /kitlib/CRASH.sig: -------------------------------------------------------------------------------- 1 | (* CRASH signature: used for internal consistency errors and so on. *) 2 | signature CRASH = 3 | sig 4 | val assert: (string * bool) -> unit 5 | val impossible: string -> 'a 6 | val unimplemented: string -> 'a 7 | 8 | exception CRASH (* So we can catch it and reenter 9 | at top-level. *) 10 | end 11 | -------------------------------------------------------------------------------- /kitlib/IntFinMapPT.sml: -------------------------------------------------------------------------------- 1 | structure IntFinMapPT :> 2 | MONO_FINMAP where type dom = int 3 | = IntFinMapPTImpl -------------------------------------------------------------------------------- /kitlib/IntSet.sml: -------------------------------------------------------------------------------- 1 | structure IntSet :> 2 | MONO_SET where type elt = int 3 | = IntSetImpl -------------------------------------------------------------------------------- /kitlib/NatSet.sml: -------------------------------------------------------------------------------- 1 | structure NatSet :> 2 | MONO_SET where type elt = word 3 | = NatSetImpl -------------------------------------------------------------------------------- /kitlib/OrderSet.sml: -------------------------------------------------------------------------------- 1 | functor OrderSet(Order : ORDER) : MONO_SET = 2 | OrderSetImpl(Order) -------------------------------------------------------------------------------- /kitlib/finmap.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | finmap_impl.mlb 3 | in 4 | IntFinMapPT.sml 5 | end -------------------------------------------------------------------------------- /kitlib/finmap_ext.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/src/Pickle/pickle.mlb 3 | $(SML_LIB)/basis/kitlib/pp.mlb 4 | finmap_impl.mlb 5 | in 6 | MONO_FINMAP_EXT.sml 7 | IntFinMapPTExt.sml 8 | end -------------------------------------------------------------------------------- /kitlib/finmap_impl.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | in 3 | MONO_FINMAP.sml 4 | IntFinMapPTImpl.sml 5 | end -------------------------------------------------------------------------------- /kitlib/kitprofile.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in 4 | kitprofile.sig 5 | kitprofile.sml 6 | end 7 | -------------------------------------------------------------------------------- /kitlib/kitprofile.sig: -------------------------------------------------------------------------------- 1 | signature KIT_PROFILE = 2 | sig 3 | val tellTime: string -> unit (* tellTime(msg) stores msg for printing at next profile tick *) 4 | end -------------------------------------------------------------------------------- /kitlib/kitprofile.sml: -------------------------------------------------------------------------------- 1 | structure KitProfile : KIT_PROFILE = 2 | struct 3 | fun tellTime(s: string) : unit = prim("queueMark", s) 4 | 5 | (* queueMark is a no-op; queueMarkProf does stuff *) 6 | 7 | end -------------------------------------------------------------------------------- /kitlib/pp.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | in 3 | CRASH.sig Crash.sml 4 | REPORT.sig Report.sml 5 | PRETTYPRINT.sig PrettyPrint.sml 6 | end -------------------------------------------------------------------------------- /kitlib/set.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | set_impl.mlb 3 | in 4 | IntSet.sml 5 | NatSet.sml 6 | OrderSet.sml 7 | end -------------------------------------------------------------------------------- /kitlib/set_ext.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/src/Pickle/pickle.mlb 3 | $(SML_LIB)/basis/kitlib/pp.mlb 4 | set_impl.mlb 5 | in 6 | MONO_SET_EXT.sml 7 | IntSetExt.sml 8 | NatSetExt.sml 9 | OrderSetExt.sml 10 | end -------------------------------------------------------------------------------- /kitlib/set_impl.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | in 3 | MONO_SET.sml 4 | IntSetImpl.sml 5 | NatSetImpl.sml 6 | OrderSetImpl.sml 7 | end -------------------------------------------------------------------------------- /man/man1/.gitignore: -------------------------------------------------------------------------------- 1 | kittester.1 2 | smlserverc.1 3 | mlkit-mllex.1 4 | mlkit-mlyacc.1 5 | smltojs.1 6 | mlkit.1 7 | reml.1 8 | rp2ps.1 9 | -------------------------------------------------------------------------------- /ml-yacc-lib/ml-yacc-lib.mlb: -------------------------------------------------------------------------------- 1 | (* load file for ML-Yacc library *) 2 | local 3 | $(SML_LIB)/basis/basis.mlb 4 | in 5 | base.sig 6 | join.sml 7 | lrtable.sml 8 | stream.sml 9 | parser2.sml 10 | end 11 | -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Version.sml 3 | config.h 4 | mlkit 5 | reml 6 | smltojs 7 | smlserverc 8 | MLB 9 | *~ -------------------------------------------------------------------------------- /src/CUtils/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.out 3 | *.res -------------------------------------------------------------------------------- /src/CUtils/binaryheap_test.out.ok: -------------------------------------------------------------------------------- 1 | 5 4 1 7 2 3 6 2 | -------------------------------------------------------------------------------- /src/CUtils/hashfun.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | unsigned long charhashfunction (const char *key); 4 | -------------------------------------------------------------------------------- /src/CUtils/hashmap_typed_test.out.ok: -------------------------------------------------------------------------------- 1 | Carsten : 8 2 | Martin : 3 3 | r = 0; v = 8 4 | -------------------------------------------------------------------------------- /src/Common/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Common/AllInfo.sml: -------------------------------------------------------------------------------- 1 | structure AllInfo: ALL_INFO = 2 | struct 3 | structure SourceInfo = SourceInfo 4 | structure DFInfo = DFInfo 5 | structure ParseInfo = ParseInfo 6 | structure ErrorInfo = ErrorInfo 7 | structure OverloadingInfo = OverloadingInfo 8 | structure ElabInfo = ElabInfo 9 | end 10 | -------------------------------------------------------------------------------- /src/Common/CRASH.sig: -------------------------------------------------------------------------------- 1 | (* CRASH signature: used for internal consistency errors and so on. *) 2 | 3 | signature CRASH = 4 | sig 5 | val assert : (string * bool) -> unit 6 | val impossible : string -> 'a 7 | val unimplemented : string -> 'a 8 | end 9 | -------------------------------------------------------------------------------- /src/Common/DEC_GRAMMAR.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Common/DEC_GRAMMAR.sml -------------------------------------------------------------------------------- /src/Common/DecGrammar.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Common/DecGrammar.sml -------------------------------------------------------------------------------- /src/Common/ERROR_CODE.sml: -------------------------------------------------------------------------------- 1 | 2 | signature ERROR_CODE = (* Support for error testing. *) 3 | sig 4 | type ErrorCode and ErrorInfo 5 | val from_ErrorInfo : ErrorInfo -> ErrorCode 6 | val error_code_parse : ErrorCode 7 | val error_code_eof : ErrorCode 8 | val eq : ErrorCode * ErrorCode -> bool 9 | val pr : ErrorCode -> string 10 | end 11 | -------------------------------------------------------------------------------- /src/Common/ERROR_TRAVERSE.sml: -------------------------------------------------------------------------------- 1 | signature ERROR_TRAVERSE = 2 | sig 3 | structure ErrorCode : ERROR_CODE 4 | 5 | type topdec 6 | type Report 7 | 8 | datatype result = SUCCESS 9 | | FAILURE of Report * ErrorCode.ErrorCode list 10 | 11 | val traverse: topdec -> result 12 | end; 13 | -------------------------------------------------------------------------------- /src/Common/EfficientElab/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Common/EfficientElab/ModuleStatObject.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Common/EfficientElab/ModuleStatObject.sml -------------------------------------------------------------------------------- /src/Common/FunId.sml: -------------------------------------------------------------------------------- 1 | (* Functor identifiers *) 2 | 3 | structure FunId :> FUNID = 4 | struct 5 | type funid = string 6 | 7 | fun mk_FunId x = x 8 | fun pr_FunId x = x 9 | 10 | val op < = fn (str1:string, str2) => str1 < str2 11 | 12 | val pu = Pickle.string 13 | 14 | structure Map = StringFinMap 15 | end 16 | -------------------------------------------------------------------------------- /src/Common/KitDummy.sml: -------------------------------------------------------------------------------- 1 | functor KitDummy() = KitCompiler(ExecutionDummy(ExecutionArgs)) -------------------------------------------------------------------------------- /src/Common/KitKam.sml: -------------------------------------------------------------------------------- 1 | structure K = KitMain(KitCompiler(ExecutionKAM)) 2 | -------------------------------------------------------------------------------- /src/Common/KitMain.sml: -------------------------------------------------------------------------------- 1 | functor KitMain (K : KIT_COMPILER) : sig end = 2 | struct 3 | val name = CommandLine.name() 4 | val args = CommandLine.arguments() 5 | val _ = OS.Process.exit (K.kitexe(name,args)) 6 | end 7 | 8 | -------------------------------------------------------------------------------- /src/Common/KitOnKit.sml: -------------------------------------------------------------------------------- 1 | structure K = KitX86() 2 | val _ = K.kitexe(CommandLine.name(),CommandLine.arguments()) -------------------------------------------------------------------------------- /src/Common/KitSmlserver.sml: -------------------------------------------------------------------------------- 1 | structure Compiler = KitCompiler(ExecutionKAM) 2 | val _ = 3 | Flags.turn_off "garbage_collection"; 4 | Flags.turn_off "cross_module_opt"; (* better module reuse *) 5 | Flags.turn_on "quotation"; (* support for quotation-antiquotation *) 6 | Flags.SMLserver := true; 7 | 8 | structure K = KitMain(Compiler) 9 | -------------------------------------------------------------------------------- /src/Common/KitX64.sml: -------------------------------------------------------------------------------- 1 | 2 | structure K = 3 | let structure KC = KitCompiler(ExecutionX64) 4 | val _ = Flags.turn_on "garbage_collection" 5 | val () = List.app Flags.block_entry 6 | ["export_basis_js"] 7 | in KitMain(KC) 8 | end 9 | -------------------------------------------------------------------------------- /src/Common/KitX86.sml: -------------------------------------------------------------------------------- 1 | 2 | structure K = 3 | let structure KC = KitCompiler(ExecutionX86) 4 | val _ = Flags.turn_on "garbage_collection" 5 | in KitMain(KC) 6 | end 7 | 8 | -------------------------------------------------------------------------------- /src/Common/LIST_SORT.sml: -------------------------------------------------------------------------------- 1 | (*$LIST_SORT*) 2 | signature LIST_SORT = 3 | sig 4 | val sort : ('a * 'a -> bool) -> 'a list -> 'a list 5 | 6 | (* sort lt l sorts l according to the ordering lt *) 7 | end; -------------------------------------------------------------------------------- /src/Common/ORDER.sig: -------------------------------------------------------------------------------- 1 | 2 | signature ORDER = sig 3 | type t 4 | val lt : t * t -> bool 5 | end 6 | -------------------------------------------------------------------------------- /src/Common/ORDSET.sml: -------------------------------------------------------------------------------- 1 | (*$ORDSET*) 2 | signature ORDSET = 3 | sig 4 | type item 5 | val lt: item * item -> bool 6 | 7 | type StringTree 8 | val show: item-> StringTree 9 | end 10 | -------------------------------------------------------------------------------- /src/Common/PostElabDecGrammar.sml: -------------------------------------------------------------------------------- 1 | structure PostElabDecGrammar = 2 | DecGrammar(struct 3 | type GrammarInfo = AllInfo.ElabInfo.ElabInfo 4 | val bogus_info = AllInfo.ElabInfo.from_ParseInfo PreElabDecGrammar.bogus_info 5 | end) 6 | -------------------------------------------------------------------------------- /src/Common/PostElabGrammar.sml: -------------------------------------------------------------------------------- 1 | structure PostElabDecGrammar = 2 | DecGrammar(struct 3 | type GrammarInfo = AllInfo.ElabInfo.ElabInfo 4 | val bogus_info = AllInfo.ElabInfo.from_ParseInfo PreElabDecGrammar.bogus_info 5 | end) 6 | 7 | structure PostElabTopdecGrammar = 8 | TopdecGrammar(PostElabDecGrammar) 9 | -------------------------------------------------------------------------------- /src/Common/PreElabDecGrammar.sml: -------------------------------------------------------------------------------- 1 | structure PreElabDecGrammar = DecGrammar 2 | (struct 3 | type GrammarInfo = ParseInfo.ParseInfo 4 | val bogus_info = 5 | ParseInfo.from_SourceInfo(SourceInfo.from_positions LexBasics.DUMMY LexBasics.DUMMY) 6 | end) 7 | -------------------------------------------------------------------------------- /src/Common/PreElabTopdecGrammar.sml: -------------------------------------------------------------------------------- 1 | structure PreElabTopdecGrammar : TOPDEC_GRAMMAR = 2 | TopdecGrammar(PreElabDecGrammar) 3 | -------------------------------------------------------------------------------- /src/Common/SMLofNJOnKit.sml: -------------------------------------------------------------------------------- 1 | structure SMLofNJ = 2 | struct 3 | structure SysInfo = 4 | struct 5 | fun getHostArch() = "X86" 6 | fun getOSName() = "Linux" 7 | (* fun getOSName() = "BSD" *) 8 | end 9 | fun exportFn(kitbinkit_path,kitexe) = print "SMLofNJ.exportFn not implemented" 10 | end -------------------------------------------------------------------------------- /src/Common/STATOBJECT.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Common/STATOBJECT.sml -------------------------------------------------------------------------------- /src/Common/SigId.sml: -------------------------------------------------------------------------------- 1 | (* Signature identifiers *) 2 | 3 | structure SigId :> SIGID = 4 | struct 5 | type sigid = string 6 | 7 | fun mk_SigId x = x 8 | fun pr_SigId x = x 9 | 10 | val op < = fn (str1:string, str2) => str1 < str2 11 | 12 | val pu = Pickle.string 13 | 14 | structure Map = StringFinMap 15 | end 16 | -------------------------------------------------------------------------------- /src/Common/StringFinMap.sml: -------------------------------------------------------------------------------- 1 | structure StringFinMap = OrderFinMap(struct type t = string 2 | fun lt (s1, s2:string) = s1 < s2 3 | end) 4 | -------------------------------------------------------------------------------- /src/Common/StringFinMapPT.sml: -------------------------------------------------------------------------------- 1 | structure StringFinMap : MONO_FINMAP = 2 | FinMapPT(struct type T = string 3 | val eq = op = 4 | val lt = op < 5 | val hash = strhash 6 | fun toString a = a 7 | end) 8 | -------------------------------------------------------------------------------- /src/Common/StringSet.sml: -------------------------------------------------------------------------------- 1 | 2 | structure StringSet : KIT_MONO_SET = 3 | OrderSet (struct type t = string val lt : t*t -> bool = op < end) 4 | -------------------------------------------------------------------------------- /src/Common/TIMESTAMP.sig: -------------------------------------------------------------------------------- 1 | signature TIMESTAMP = 2 | sig 3 | eqtype stamp 4 | val new: unit -> stamp 5 | val stamp2int : stamp -> int (* an injective mapping from stamps to integers *) 6 | val print: stamp -> string 7 | end; 8 | -------------------------------------------------------------------------------- /src/Common/TYCON.sig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Common/TYCON.sig -------------------------------------------------------------------------------- /src/Common/TYVAR.sig: -------------------------------------------------------------------------------- 1 | (* Explicit type variables *) 2 | 3 | signature TYVAR = 4 | sig 5 | eqtype SyntaxTyVar 6 | 7 | val mk_TyVar: string -> SyntaxTyVar (* NEW PARSER *) 8 | and pr_tyvar: SyntaxTyVar -> string 9 | 10 | val isEquality: SyntaxTyVar -> bool 11 | 12 | val pu : SyntaxTyVar Pickle.pu 13 | end; 14 | -------------------------------------------------------------------------------- /src/Common/Timestamp.sml: -------------------------------------------------------------------------------- 1 | structure Timestamp: TIMESTAMP = 2 | struct 3 | type stamp = int 4 | 5 | val r = ref 0 6 | fun new() = (r := !r + 1; !r) 7 | 8 | fun stamp2int i = i 9 | 10 | fun print i = (*"$" ^*) Int.toString i 11 | end; 12 | -------------------------------------------------------------------------------- /src/Common/md5.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | in MD5.sml 3 | end 4 | -------------------------------------------------------------------------------- /src/Common/test/IntFinMapPT_Test.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | ../../Pickle/pickle.mlb 4 | ../REPORT.sig 5 | ../Report.sml 6 | ../PRETTYPRINT.sig 7 | ../PrettyPrint.sml 8 | ../MONO_FINMAP.sml 9 | ../IntFinMapPT.sml 10 | in 11 | IntFinMapPT_Test.sml 12 | end 13 | -------------------------------------------------------------------------------- /src/Compiler/.gitignore: -------------------------------------------------------------------------------- 1 | MLB 2 | index.html 3 | run.html -------------------------------------------------------------------------------- /src/Compiler/Backend/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Compiler/Backend/JS/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Compiler/Backend/JS/jsast.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | in JS_AST.sml 3 | JsAst.sml 4 | end -------------------------------------------------------------------------------- /src/Compiler/Backend/X64/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Compiler/COMPILE_TO_LAMB.sml: -------------------------------------------------------------------------------- 1 | 2 | signature COMPILE_TO_LAMB = COMPILE_GEN 3 | where type target = LambdaExp.LambdaPgm 4 | and type CompBasis = CompBasisToLamb.CompBasis 5 | 6 | -------------------------------------------------------------------------------- /src/Compiler/Lambda/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Compiler/Lambda/CompileDec.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Compiler/Lambda/CompileDec.sml -------------------------------------------------------------------------------- /src/Compiler/Regions/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Compiler/Regions/EffVarEnv.sml: -------------------------------------------------------------------------------- 1 | structure EffVarEnv= 2 | OrderFinMap(struct 3 | type t = Effect.effect 4 | val lt = Effect.lt_eps_or_rho 5 | end) 6 | -------------------------------------------------------------------------------- /src/Edlib/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Edlib/Makefile: -------------------------------------------------------------------------------- 1 | clean: 2 | rm -rf MLB *~ -------------------------------------------------------------------------------- /src/Edlib/edlib.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | EDLIB_GENERAL.sml EdlibGeneral.sml 4 | LIST.sml (*List.sml *) edList.sml 5 | EQ_SET.sml SET.sig 6 | LIST_PAIR.sml (*ListPair.sml*) edListPair.sml LIST_SORT.sml 7 | in 8 | ListSort.sml 9 | Set.sml 10 | EqSet.sml 11 | ORDERING.sml 12 | (* Edlib.sml *) 13 | end 14 | -------------------------------------------------------------------------------- /src/Kitlib/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Kitlib/RegExp.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Kitlib/RegExp.sml -------------------------------------------------------------------------------- /src/Manager/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Manager/ElabRepository.sml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/Manager/MODCODE_MINI.sml: -------------------------------------------------------------------------------- 1 | signature MODCODE_MINI = sig 2 | type modcode 3 | type linkinfo 4 | type target 5 | val seq : modcode * modcode -> modcode 6 | val empty : modcode 7 | val mk_modcode : target * linkinfo * string -> modcode 8 | val emit : ModuleEnvironments.absprjid * modcode -> modcode 9 | end 10 | -------------------------------------------------------------------------------- /src/Parsing/.gitignore: -------------------------------------------------------------------------------- 1 | MLB 2 | Topdec.grm.desc -------------------------------------------------------------------------------- /src/Pickle/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Pickle/Makefile: -------------------------------------------------------------------------------- 1 | FILES=$(shell ls -1 *.sml *.sig *.mlb Makefile ../../doc/license/copyright.att) 2 | 3 | clean: 4 | rm -rf MLB *~ *.log pickle pickle.tgz 5 | 6 | tgz: 7 | rm -rf pickle pickle.tgz 8 | mkdir pickle 9 | cp $(FILES) pickle/ 10 | tar czvf pickle.tgz pickle 11 | rm -rf pickle 12 | -------------------------------------------------------------------------------- /src/Pickle/PACK_REAL.sml: -------------------------------------------------------------------------------- 1 | (* 2 | * Copyright, Martin Elsman 2003-01-07 3 | * GPL Licence 4 | *) 5 | 6 | signature PACK_REAL = 7 | sig 8 | type real 9 | val bytesPerElem : int 10 | val isBigEndian : bool 11 | val toBytes : real -> Word8Vector.vector 12 | val fromBytes : Word8Vector.vector -> real 13 | end 14 | -------------------------------------------------------------------------------- /src/Pickle/test/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | mlkit test_pickle.mlb -------------------------------------------------------------------------------- /src/Pickle/test/test_pickle.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | ../../../basis/test/test.mlb 4 | ../pickle.mlb 5 | in 6 | test_pickle.sml 7 | end -------------------------------------------------------------------------------- /src/Runtime/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | Makefile 4 | KamInsts.c 5 | KamInsts.h 6 | SysErrTable.h 7 | gen_syserror 8 | jumptbl.h 9 | Prims.c 10 | PrimsApSml.c 11 | PrimsNsSml.c 12 | kam -------------------------------------------------------------------------------- /src/Runtime/Export.h: -------------------------------------------------------------------------------- 1 | 2 | long callExportFun(const char *fun, long i); 3 | 4 | -------------------------------------------------------------------------------- /src/Runtime/GC.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Runtime/GC.c -------------------------------------------------------------------------------- /src/Runtime/Posix.h: -------------------------------------------------------------------------------- 1 | struct syserr_entry 2 | { 3 | char *name; 4 | size_t number; 5 | }; 6 | -------------------------------------------------------------------------------- /src/Runtime/Region.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Runtime/Region.c -------------------------------------------------------------------------------- /src/Tools/Benchmark/.gitignore: -------------------------------------------------------------------------------- 1 | kitbench -------------------------------------------------------------------------------- /src/Tools/Benchmark/KitBench.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | ../Tester/info.mlb 4 | ../Tester/TestFile.sml 5 | MemTime.sml 6 | COMPILE.sml 7 | CompileSMLNJ.sml 8 | (* CompileSMLNJ-110.40.sml *) 9 | CompileMLKIT.sml 10 | CompileMLTON.sml 11 | in 12 | Benchmark.sml 13 | end 14 | -------------------------------------------------------------------------------- /src/Tools/Benchmark/Makefile: -------------------------------------------------------------------------------- 1 | BINDIR=../../../bin 2 | TARGET=kitbench 3 | 4 | include ../../../Makefiledefault 5 | 6 | $(BINDIR)/$(TARGET): $(TARGET) 7 | cp $(TARGET) $(BINDIR)/$(TARGET) 8 | 9 | $(TARGET): KitBench.mlb Makefile *.sml 10 | $(MLCOMP) -output $(TARGET) KitBench.mlb 11 | 12 | clean: 13 | rm -rf MLB *~ $(TARGET) 14 | -------------------------------------------------------------------------------- /src/Tools/MlbMake/.gitignore: -------------------------------------------------------------------------------- 1 | Configuration.sml 2 | Makefile 3 | MLB -------------------------------------------------------------------------------- /src/Tools/MlbMake/CONFIGURATION.sig: -------------------------------------------------------------------------------- 1 | signature CONFIGURATION = 2 | sig 3 | val etcdir : string 4 | end 5 | -------------------------------------------------------------------------------- /src/Tools/MlbMake/Configuration.sml.in: -------------------------------------------------------------------------------- 1 | structure Configuration :> CONFIGURATION = 2 | struct 3 | -------------------------------------------------------------------------------- /src/Tools/MlbMake/ENVIRONMENT.sig: -------------------------------------------------------------------------------- 1 | signature ENVIRONMENT = 2 | sig 3 | val getEnvVal : string -> string option 4 | end 5 | -------------------------------------------------------------------------------- /src/Tools/MlbMake/MLKit.sml: -------------------------------------------------------------------------------- 1 | local structure M = MlbStandAlone() 2 | in 3 | val _ = OS.Process.exit 4 | (M.mlbmake(M.cmdName(), 5 | CommandLine.arguments())) 6 | end -------------------------------------------------------------------------------- /src/Tools/MlbMake/configuration.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in CONFIGURATION.sig Configuration.sml 4 | end -------------------------------------------------------------------------------- /src/Tools/MlbMake/environment.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | ../../Common/tools.mlb 4 | in 5 | configuration.mlb 6 | ENVIRONMENT.sig Environment.sml 7 | end 8 | -------------------------------------------------------------------------------- /src/Tools/MlbMake/sources.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | environment.mlb 3 | mlbmake.mlb 4 | MlbStandAlone.sml 5 | MLKit.sml 6 | -------------------------------------------------------------------------------- /src/Tools/MspComp/.gitignore: -------------------------------------------------------------------------------- 1 | mspcomp -------------------------------------------------------------------------------- /src/Tools/MspComp/Makefile: -------------------------------------------------------------------------------- 1 | BINDIR=../../../bin 2 | 3 | include ../../../Makefiledefault 4 | 5 | $(BINDIR)/mspcomp: mspcomp 6 | cp mspcomp $(BINDIR)/ 7 | 8 | mspcomp: Makefile MspComp.sml 9 | $(MLCOMP) -output mspcomp MspComp.sml 10 | 11 | clean: 12 | rm -rf mspcomp *~ MLB 13 | -------------------------------------------------------------------------------- /src/Tools/Rp2ps/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | rp2ps -------------------------------------------------------------------------------- /src/Tools/Rp2ps/Alloc.h: -------------------------------------------------------------------------------- 1 | #ifndef ALLOC 2 | #define ALLOC 3 | 4 | #include "Types.h" 5 | 6 | void *xrealloc(void *p, int n); 7 | void* xmalloc(int n); 8 | char* MallocString(char *s); 9 | SAMPLEPTR MallocSample(void); 10 | void FreeSample(SAMPLEPTR s); 11 | ENTRYPTR MallocEntry(void); 12 | 13 | #endif /* ALLOC */ 14 | -------------------------------------------------------------------------------- /src/Tools/Rp2ps/Error.h: -------------------------------------------------------------------------------- 1 | #ifndef ERROR 2 | #define ERROR 3 | 4 | void Disaster(char* format); 5 | 6 | #endif /* ERROR */ 7 | -------------------------------------------------------------------------------- /src/Tools/Rp2ps/PostScript.h: -------------------------------------------------------------------------------- 1 | #ifndef _POSTSCRIPT_H 2 | #define _POSTSCRIPT_H 3 | 4 | #include "Output.h" 5 | 6 | extern Format PsOutput; 7 | 8 | #endif /* _POSTSCRIPT_H */ 9 | -------------------------------------------------------------------------------- /src/Tools/SigDoc/.gitignore: -------------------------------------------------------------------------------- 1 | sigdoc 2 | MLB -------------------------------------------------------------------------------- /src/Tools/SigDoc/lib/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif"; 3 | } -------------------------------------------------------------------------------- /src/Tools/SigDoc/sigdoc.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $SML_LIB/basis/basis.mlb 3 | ../../../basis/kitlib.mlb 4 | in 5 | main.sml 6 | end 7 | -------------------------------------------------------------------------------- /src/Tools/Tester/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | kittester -------------------------------------------------------------------------------- /src/Tools/Tester/INFO.sig: -------------------------------------------------------------------------------- 1 | signature INFO = 2 | sig 3 | 4 | val getInfo: string -> 5 | {size:int, rss:int, data:int, 6 | stk:int, exe:int} option (* bytes *) 7 | 8 | end (* signature INFO *) 9 | -------------------------------------------------------------------------------- /src/Tools/Tester/KitTester.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | info.mlb 4 | MemUsage.sml 5 | TestFile.sml 6 | CompilerTimings.sml 7 | test_report.sig 8 | test_report.sml 9 | TestReport.sml 10 | in 11 | Tester.sml 12 | end 13 | -------------------------------------------------------------------------------- /src/Tools/Tester/info.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in 4 | INFO.sig 5 | local LinuxInfo.sml 6 | in Info.sml 7 | end 8 | end -------------------------------------------------------------------------------- /src/Tools/ml-lex/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | MLB 3 | mlkit-mllex 4 | mllex.aux 5 | mllex.log 6 | mllex.toc 7 | -------------------------------------------------------------------------------- /src/Tools/ml-lex/ml-lex.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in 4 | lexgen.sml 5 | ml-lex-mlkit.sml 6 | end 7 | -------------------------------------------------------------------------------- /src/Tools/ml-lex/mllex.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Tools/ml-lex/mllex.pdf -------------------------------------------------------------------------------- /src/Tools/ml-yacc/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | doc/mlyacc.aux 3 | doc/mlyacc.log 4 | doc/mlyacc.toc 5 | mlkit-mlyacc -------------------------------------------------------------------------------- /src/Tools/ml-yacc/doc/mlyacc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/src/Tools/ml-yacc/doc/mlyacc.pdf -------------------------------------------------------------------------------- /src/Tools/ml-yacc/examples/calc/sources.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | 3 | #if defined (NEW_CM) 4 | $/basis.cm 5 | $/ml-yacc-lib.cm 6 | #else 7 | ml-yacc-lib.cm 8 | #endif 9 | 10 | calc.grm 11 | calc.lex 12 | calc.sml 13 | 14 | -------------------------------------------------------------------------------- /src/Tools/ml-yacc/examples/fol/absyn.sml: -------------------------------------------------------------------------------- 1 | signature ABSYN = 2 | sig 3 | type absyn 4 | val null : absyn 5 | end 6 | 7 | structure Absyn :> ABSYN = 8 | struct 9 | datatype absyn = NULL 10 | val null = NULL 11 | end -------------------------------------------------------------------------------- /src/Tools/ml-yacc/examples/fol/list.fol: -------------------------------------------------------------------------------- 1 | append(nil,K,K). 2 | append(cons(X,L),K,cons(X,M)) :- append(L,K,M). 3 | -------------------------------------------------------------------------------- /src/Tools/ml-yacc/examples/fol/sources.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | 3 | #if defined (NEW_CM) 4 | $/basis.cm 5 | $/ml-yacc-lib.cm 6 | #else 7 | ml-yacc-lib.cm 8 | #endif 9 | 10 | fol.lex 11 | fol.grm 12 | 13 | absyn.sml 14 | 15 | interface.sml 16 | 17 | parse.sml 18 | link.sml 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/Tools/ml-yacc/lib/ml-yacc-lib.mlb: -------------------------------------------------------------------------------- 1 | (* sources file for ML-Yacc library *) 2 | 3 | local 4 | $(SML_LIB)/basis/basis.mlb 5 | in 6 | base.sig 7 | join.sml 8 | lrtable.sml 9 | stream.sml 10 | parser2.sml (* error correcting version *) 11 | end -------------------------------------------------------------------------------- /src/Tools/ml-yacc/src/.gitignore: -------------------------------------------------------------------------------- 1 | MLB -------------------------------------------------------------------------------- /src/Tools/ml-yacc/src/README: -------------------------------------------------------------------------------- 1 | These are the sources for the parser-generator part of ML-Yacc. 2 | The file FILES explains what each file contains. 3 | -------------------------------------------------------------------------------- /src/lib/github.com/diku-dk/sml-uref/Makefile: -------------------------------------------------------------------------------- 1 | MLCOMP ?= mlkit 2 | 3 | .PHONY: all 4 | all: 5 | $(MLCOMP) uref.mlb 6 | 7 | .PHONY: test 8 | test: 9 | $(MAKE) -C test test 10 | 11 | .PHONY: clean 12 | clean: 13 | $(MAKE) -C test clean 14 | rm -rf MLB *~ run 15 | -------------------------------------------------------------------------------- /src/lib/github.com/diku-dk/sml-uref/test/.gitignore: -------------------------------------------------------------------------------- 1 | *.res 2 | *.exe 3 | *~ 4 | *.out 5 | MLB -------------------------------------------------------------------------------- /src/lib/github.com/diku-dk/sml-uref/test/test_uref.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | ../uref.mlb 3 | in test_uref.sml 4 | end 5 | -------------------------------------------------------------------------------- /src/lib/github.com/diku-dk/sml-uref/test/test_uref.out.ok: -------------------------------------------------------------------------------- 1 | Testing URef 2 | URef.eq.not: OK 3 | URef.eq.1: OK 4 | URef.eq.1: OK 5 | URef.find.1: OK 6 | URef.find.1: OK 7 | URef.update.1: OK 8 | URef.compare: OK 9 | -------------------------------------------------------------------------------- /src/lib/github.com/diku-dk/sml-uref/uref.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | in uref.sig 3 | uref.sml 4 | end 5 | -------------------------------------------------------------------------------- /src/sml.pkg: -------------------------------------------------------------------------------- 1 | require { 2 | github.com/diku-dk/sml-uref 0.0.1 #bfce9ac7ce2e98abf02036ee33d78cae105a1d70 3 | } 4 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | *.out 3 | *.stderr 4 | MLB 5 | hardlinkA 6 | hardlinkB 7 | testbadl 8 | testcycl 9 | testlink 10 | runexe 11 | KITtimings 12 | KITversion 13 | TESTmessages 14 | test_report*.html 15 | textio.tmp 16 | small1.dat 17 | small2.dat 18 | empty.dat 19 | medium.dat 20 | text.dat 21 | outFuhMishra? 22 | ray/output -------------------------------------------------------------------------------- /test/FuhMishra.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | lib.sml 3 | FuhMishra.sml 4 | -------------------------------------------------------------------------------- /test/PermuteList.sig: -------------------------------------------------------------------------------- 1 | signature PERMUTELIST = 2 | sig 3 | 4 | type 'a permuteList 5 | 6 | val fromList : 'a list -> 'a permuteList 7 | val prj : 'a permuteList -> ('a * 'a permuteList) option 8 | val findSome : ('a -> 'b option) -> 'a permuteList -> 'b option 9 | 10 | end 11 | -------------------------------------------------------------------------------- /test/anoq_Exception.sml: -------------------------------------------------------------------------------- 1 | exception Generic of string 2 | fun reRaise (Generic values) newValue = raise Generic "e" 3 | 4 | -------------------------------------------------------------------------------- /test/anoq_Exception.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** anoq_Exception.sml ************* 4 | 5 | -------------------------------------------------------------------------------- /test/anoq_Exception.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/anoq_Exception.sml.out.ok -------------------------------------------------------------------------------- /test/arr2a.sml: -------------------------------------------------------------------------------- 1 | 2 | local 3 | val a = Array2.array (100,10,23) 4 | fun set(r,c,v) = Array2.update(a,r,c,v) 5 | fun get(r,c) = Array2.sub(a,r,c) 6 | val () = set(5,8,24) 7 | val () = print (Int.toString (get (50,7)) ^ "\n") 8 | val () = print (Int.toString (get (5,8)) ^ "\n") 9 | in 10 | end 11 | -------------------------------------------------------------------------------- /test/atExit0.sml.out.ok: -------------------------------------------------------------------------------- 1 | .hello d - fib(0) = 1 2 | ...hello c - fib(3) = 3 3 | .............hello b - fib(6) = 13 4 | .......................................................hello a - fib(9) = 55 5 | -------------------------------------------------------------------------------- /test/auto2.sml.out.ok: -------------------------------------------------------------------------------- 1 | ok 2 | ok 3 | ok 4 | ok 5 | ok 6 | ok 7 | ok 8 | ok 9 | ok - array 10 | ok - array 11 | ok - array 12 | -------------------------------------------------------------------------------- /test/barnes-hut.mlb: -------------------------------------------------------------------------------- 1 | barnes-hut/sources.mlb 2 | 3 | -------------------------------------------------------------------------------- /test/barnes-hut/sources.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | rand-sig.sml 3 | rand.sml 4 | vector-sig.sml 5 | space.sml 6 | load.sml 7 | grav.sml 8 | getparam.sml 9 | data-io.sml 10 | main.sml 11 | vector3.sml 12 | main2.sml 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/barry/fft.out.ok: -------------------------------------------------------------------------------- 1 | fft by Torben Mogensen (torbenm@diku.dk) 2 | fft'ing... done: 65536 3 | -------------------------------------------------------------------------------- /test/barry/fib35.out.ok: -------------------------------------------------------------------------------- 1 | 24157817 2 | -------------------------------------------------------------------------------- /test/barry/fib35.sml: -------------------------------------------------------------------------------- 1 | (*kitfib35.sml*) 2 | 3 | let 4 | fun fib n = if n < 1 then 1 else fib (n-1) + fib (n-2) 5 | in 6 | print (Int.toString (fib 35) ^ "\n") 7 | end 8 | -------------------------------------------------------------------------------- /test/barry/mandelbrot.out.ok: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /test/barry/msort.out.ok: -------------------------------------------------------------------------------- 1 | Generating list of 100000 random ints... 2 | Sorting... 3 | Ok! 4 | -------------------------------------------------------------------------------- /test/barry/precedence.out.ok: -------------------------------------------------------------------------------- 1 | 28 2 | -------------------------------------------------------------------------------- /test/barry/precedence.sml: -------------------------------------------------------------------------------- 1 | 2 | fun f x = 3 | if !(ref false) then f x 4 | else let val a = ref 4 5 | in fn y => x + y * 2 - ((2 - x) + !a) 6 | end 7 | 8 | val () = print (Int.toString (f 8 9) ^ "\n") 9 | -------------------------------------------------------------------------------- /test/barry/qsort.out.ok: -------------------------------------------------------------------------------- 1 | Ok! 2 | -------------------------------------------------------------------------------- /test/barry/tststrcmp.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/barry/tststrcmp.sml -------------------------------------------------------------------------------- /test/cmdline.sml.out.ok: -------------------------------------------------------------------------------- 1 | This program is invoked as `./runexe' 2 | with arguments: 3 | -------------------------------------------------------------------------------- /test/cobol.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/cobol.sml -------------------------------------------------------------------------------- /test/constraint.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** constraint.sml ************* 4 | 5 | -------------------------------------------------------------------------------- /test/constraint.sml.out.ok: -------------------------------------------------------------------------------- 1 | A(hello,5) 2 | -------------------------------------------------------------------------------- /test/dangle4.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/dangle4.sml.out.ok -------------------------------------------------------------------------------- /test/danwang.mlb: -------------------------------------------------------------------------------- 1 | danwang/sources.mlb 2 | -------------------------------------------------------------------------------- /test/danwang.mlb.out.ok: -------------------------------------------------------------------------------- 1 | start 2 | stop 3 | -------------------------------------------------------------------------------- /test/danwang/go.sml: -------------------------------------------------------------------------------- 1 | val _ = print "start\n"; 2 | val _ = SObjCPS.eval 10 SObjCPS.Nil; 3 | val _ = print "stop\n"; -------------------------------------------------------------------------------- /test/danwang/sources.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | sobj-cps.sig 3 | sobj-cps.sml 4 | sprogs.sml 5 | go.sml 6 | 7 | -------------------------------------------------------------------------------- /test/datatypes.sml.out.ok: -------------------------------------------------------------------------------- 1 | Testing datatypes and unboxing schemes... 2 | test1a OK 3 | test1b OK 4 | test1c OK 5 | test1d OK 6 | test1e OK 7 | test2a OK 8 | test2b OK 9 | test2c OK 10 | test3a OK 11 | test3b OK 12 | test3c OK 13 | test3d OK 14 | test3e OK 15 | -------------------------------------------------------------------------------- /test/date2.sml: -------------------------------------------------------------------------------- 1 | 2 | val d = Date.day (Date.date {year=2014,month=Date.Nov,day=12,hour=0, 3 | minute=0,second=0,offset=NONE}) 4 | 5 | val () = if d = 12 then print "Ok\n" else print "Error\n" 6 | -------------------------------------------------------------------------------- /test/date2.sml.out.ok: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /test/dynlink.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/basis/dynlink.mlb 3 | dynlink.sml 4 | -------------------------------------------------------------------------------- /test/elabDecBug.sml: -------------------------------------------------------------------------------- 1 | type pair = {x : int, y : int} 2 | fun f ([]:pair list) = "Hi There" 3 | and f (xs as x::_ : pair list) = "Hi There again" 4 | -------------------------------------------------------------------------------- /test/elabDecBug.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** elabDecBug.sml ************* 4 | 5 | 6 | elabDecBug.sml, line 2, column 4: 7 | fun f ([]:pair list) = "Hi There" 8 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 9 | and f (xs as x::_ : pair list) = "Hi There again" 10 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 11 | Repeated identifier f. 12 | -------------------------------------------------------------------------------- /test/error1.mlb: -------------------------------------------------------------------------------- 1 | (* It is an error if a source file does not exist *) 2 | notexisting.sml -------------------------------------------------------------------------------- /test/error2.mlb: -------------------------------------------------------------------------------- 1 | (* multible occurrences of a source file in the 2 | * same mlb-file is not allowed *) 3 | 4 | error2.sml 5 | error2b.sml 6 | error2.sml 7 | -------------------------------------------------------------------------------- /test/error2.sml: -------------------------------------------------------------------------------- 1 | val a = 5 2 | -------------------------------------------------------------------------------- /test/error2b.sml: -------------------------------------------------------------------------------- 1 | val b = 8 2 | -------------------------------------------------------------------------------- /test/error3.mlb: -------------------------------------------------------------------------------- 1 | (* The same physical source file may be referenced 2 | * by at most one mlb-file *) 3 | 4 | error3a.mlb 5 | error3.sml -------------------------------------------------------------------------------- /test/error3.sml: -------------------------------------------------------------------------------- 1 | val a = 5 2 | -------------------------------------------------------------------------------- /test/error3a.mlb: -------------------------------------------------------------------------------- 1 | error3.sml -------------------------------------------------------------------------------- /test/error4.mlb: -------------------------------------------------------------------------------- 1 | (* Cycles in mlb-files are not legal! Here is an immediate cycle. *) 2 | 3 | error4a.mlb 4 | error3.sml -------------------------------------------------------------------------------- /test/error4a.mlb: -------------------------------------------------------------------------------- 1 | error4.mlb -------------------------------------------------------------------------------- /test/excon.sml: -------------------------------------------------------------------------------- 1 | datatype t = Opt 2 | 3 | exception Opt2 4 | 5 | val rec Opt = fn (a : int) => a + 6 6 | 7 | fun Opt2 0 = 0 8 | | Opt2 n = n + Opt2(n-1) 9 | 10 | val a = Opt2 10 + Opt 10 11 | 12 | val _ = print (Int.toString a ^ "\n") -------------------------------------------------------------------------------- /test/excon.sml.out.ok: -------------------------------------------------------------------------------- 1 | 71 2 | -------------------------------------------------------------------------------- /test/exn-alpha.sml.out.ok: -------------------------------------------------------------------------------- 1 | now working 2 | done working 3 | -------------------------------------------------------------------------------- /test/exn.sml.out.ok: -------------------------------------------------------------------------------- 1 | now working 2 | done working 3 | -------------------------------------------------------------------------------- /test/explicit_regions/call.sml: -------------------------------------------------------------------------------- 1 | infix + 2 | fun f `[r] () : real = 4.3`r 3 | 4 | fun g () = 5 | let with r2 6 | in 0.0 + f `[r2] () 7 | end 8 | -------------------------------------------------------------------------------- /test/explicit_regions/call.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/call.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/call2.sml: -------------------------------------------------------------------------------- 1 | infix + 2 | fun f `[rr rp] () : real*real = 3 | let val x = 4.3`rr 4 | in (x,x)`rp 5 | end 6 | 7 | fun g `[r] () = 8 | let with r2 9 | val (_,y) = f `[r r2] () 10 | in y + 0.0 11 | end 12 | -------------------------------------------------------------------------------- /test/explicit_regions/call2.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/call2.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/con0.sml: -------------------------------------------------------------------------------- 1 | (* Con0 can be allocated in explicit regions *) 2 | 3 | datatype t = A of int | B (* t is boxed, which means that B and A are allocated *) 4 | 5 | fun f () : int = 6 | let with r 7 | val x = if true then B`[r] else A 9 8 | in case x of 9 | B => 1 10 | | A a => a 11 | end 12 | -------------------------------------------------------------------------------- /test/explicit_regions/con0.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/con0.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/con1.sml: -------------------------------------------------------------------------------- 1 | (* Con1 can be allocated in explicit regions *) 2 | 3 | datatype t = A of int | B (* t is boxed, which means that B and A are allocated *) 4 | 5 | fun f () : int = 6 | let with r 7 | val x = if true then B else A`r 9 8 | in case x of 9 | B => 1 10 | | A a => a 11 | end 12 | -------------------------------------------------------------------------------- /test/explicit_regions/con1.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/con1.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/effty1.sml: -------------------------------------------------------------------------------- 1 | (* A function with a local effect cannot escape *) 2 | 3 | fun printNum (i:int) : unit = prim("printNum", i) 4 | 5 | val f = 6 | let with e 7 | val g : int #e-> int = fn x => x 8 | in g 9 | end 10 | val () = printNum (f 3) 11 | -------------------------------------------------------------------------------- /test/explicit_regions/effty1.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: effty1.sml] 2 | > val f : int -> int 3 | val printNum : int -> unit 4 | effty1.sml, line 6, column 13: 5 | let with e 6 | ^ 7 | Explicit effect variable `e has insufficient scope. 8 | Stopping compilation of MLB-file due to error (code 1). 9 | -------------------------------------------------------------------------------- /test/explicit_regions/er1.sml: -------------------------------------------------------------------------------- 1 | 2 | (* It is an error to declare a region with a name that is already in 3 | * scope *) 4 | 5 | fun f () = 6 | let with r 7 | val a = 3.2`r 8 | with r 9 | in #1 (4,3.2`r,a) 10 | end 11 | -------------------------------------------------------------------------------- /test/explicit_regions/er1.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er1.sml] 2 | 3 | er1.sml, line 8, column 6: 4 | with r 5 | ^^^^^^ 6 | Explicit region variable(s) already in scope: r 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/er10.sml: -------------------------------------------------------------------------------- 1 | (* it is an error for a value in an explicit local 2 | * region to escape *) 3 | 4 | infix + 5 | fun f () : real = 6 | let with r 7 | val y = 3.4`r 8 | in if true then 2.0 else y 9 | end 10 | -------------------------------------------------------------------------------- /test/explicit_regions/er10.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er10.sml] 2 | > infix 0 + 3 | val f : unit -> real 4 | er10.sml, line 6, column 11: 5 | let with r 6 | ^ 7 | Explicit region variable `r has insufficient scope. 8 | Stopping compilation of MLB-file due to error (code 1). 9 | -------------------------------------------------------------------------------- /test/explicit_regions/er11.sml: -------------------------------------------------------------------------------- 1 | (* it is an error for a value in an explicit local 2 | * region to escape; here r must be live as long as 3 | * the closure can be called *) 4 | 5 | fun f `[r] () : unit -> real = 6 | let with r 7 | val y = if true then (3.4,3)`r else (2.0,3) 8 | in fn () => if true then #1 y else 5.0 9 | end 10 | -------------------------------------------------------------------------------- /test/explicit_regions/er11.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er11.sml] 2 | 3 | er11.sml, line 6, column 6: 4 | let with r 5 | ^^^^^^ 6 | Explicit region variable(s) already in scope: r 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/er12.sml: -------------------------------------------------------------------------------- 1 | (* It is an error to refer to a region that is not in 2 | * scope (function parameter) *) 3 | 4 | infix + 5 | fun f `[r] () : real = 4.3`r 6 | fun g () = let with r2 7 | in 0.0 + f `[r3] () 8 | end 9 | -------------------------------------------------------------------------------- /test/explicit_regions/er12.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er12.sml] 2 | > infix 0 + 3 | val f : unit -> real 4 | val g : unit -> real 5 | er12.sml, line 7, column 22: 6 | in 0.0 + f `[r3] () 7 | ^^^^^ 8 | Explicit region variable `r3 not in scope 9 | Stopping compilation of MLB-file due to error (code 1). 10 | -------------------------------------------------------------------------------- /test/explicit_regions/er14.sml: -------------------------------------------------------------------------------- 1 | (* It is an error to give multiple explicit regions to ref *) 2 | 3 | infix + 4 | fun !(x: 'a ref): 'a = prim ("!", x) 5 | 6 | fun f () : int = 7 | let with r 8 | val x = ref`[r r] 8 9 | val y = ref`r 9 10 | in !x + !y 11 | end 12 | -------------------------------------------------------------------------------- /test/explicit_regions/er17.sml: -------------------------------------------------------------------------------- 1 | (* Con1 can be allocated in explicit regions *) 2 | 3 | datatype t = A of int | B (* t is boxed, which means that B and A are allocated *) 4 | 5 | fun f `r0 () : int = 6 | let with r 7 | val x = if true then B`r0 else A`r 9 8 | in case x of 9 | B => 1 10 | | A a => a 11 | end 12 | -------------------------------------------------------------------------------- /test/explicit_regions/er17.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er17.sml] 2 | > datatype t 3 | con A : int -> t 4 | con B : t 5 | val f : unit -> int 6 | er17.sml, line 6, column 13: 7 | let with r 8 | ^ 9 | Cannot unify the explicit region variables `r and `r0 10 | Stopping compilation of MLB-file due to error (code 1). 11 | -------------------------------------------------------------------------------- /test/explicit_regions/er18.sml: -------------------------------------------------------------------------------- 1 | (* Explicit regions cannot be annotated on empty record types *) 2 | 3 | type t = {}`r0 4 | -------------------------------------------------------------------------------- /test/explicit_regions/er18.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er18.sml] 2 | 3 | er18.sml, line 3, column 11: 4 | type t = {}`r0 5 | ^^^ 6 | Unboxed types cannot be annotated with regions 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/er19.sml: -------------------------------------------------------------------------------- 1 | (* It is an error to use an effect variable for allocation *) 2 | 3 | fun !(x: 'a ref): 'a = prim ("!", x) 4 | 5 | val x = ref 4.5 6 | 7 | fun f `[e] () : real = 8 | if true then 3.4`e 9 | else !x 10 | -------------------------------------------------------------------------------- /test/explicit_regions/er2.sml: -------------------------------------------------------------------------------- 1 | 2 | (* It is an error to have duplicate region names in a with declaration *) 3 | 4 | fun f () = 5 | let with r1 r2 r10 r2 r3 6 | val a = 3.2`r10 7 | in #1 (4, 3.2`r2, a, "hi there"`r3) 8 | end 9 | -------------------------------------------------------------------------------- /test/explicit_regions/er2.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er2.sml] 2 | 3 | er2.sml, line 5, column 11: 4 | let with r1 r2 r10 r2 r3 5 | ^^^^^^^^^^^^^^^ 6 | Repeated identifiers r2 and r2. 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/er3.sml: -------------------------------------------------------------------------------- 1 | 2 | (* A region cannot be used for values that belong to different region types *) 3 | 4 | fun f () = 5 | let with r1 6 | val a = 3.2`r1 7 | in #1 (4, a, "hi there"`r1) 8 | end 9 | -------------------------------------------------------------------------------- /test/explicit_regions/er3.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er3.sml] 2 | > val f : unit -> int 3 | er3.sml, line 7, column 25: 4 | in #1 (4, a, "hi there"`r1) 5 | ^^^ 6 | Mismatching region types s and T for explicit region variable `r1 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/er4.sml: -------------------------------------------------------------------------------- 1 | 2 | (* It is an error to refer to a region name that is not in scope *) 3 | 4 | fun f () = 5 | let val a = 3.2`r 6 | with r2 7 | in #1 (4,3.2`r2,a) 8 | end 9 | -------------------------------------------------------------------------------- /test/explicit_regions/er4.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er4.sml] 2 | > val f : unit -> int 3 | er4.sml, line 5, column 17: 4 | let val a = 3.2`r 5 | ^^ 6 | Explicit region variable `r is not in scope. 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/er5.sml: -------------------------------------------------------------------------------- 1 | (* it is an error to declare a region variable that is already in 2 | * scope; we may later allow for shadowing *) 3 | 4 | fun f `[r] () : real = 5 | let with r2 r 6 | in #1 (4.3`r, 4.8`r2) 7 | end 8 | -------------------------------------------------------------------------------- /test/explicit_regions/er5.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er5.sml] 2 | 3 | er5.sml, line 5, column 6: 4 | let with r2 r 5 | ^^^^^^^^^ 6 | Explicit region variable(s) already in scope: r 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/er6.sml: -------------------------------------------------------------------------------- 1 | (* it is an error to unify a region parameter with a 2 | * global region variable *) 3 | 4 | fun !(x: 'a ref): 'a = prim ("!", x) 5 | 6 | val x = ref 4.5 7 | 8 | fun f `[r] () : real = 9 | if true then 3.4`r 10 | else !x 11 | -------------------------------------------------------------------------------- /test/explicit_regions/er6.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er6.sml] 2 | > val ! : 'a ref -> 'a 3 | val f : unit -> real 4 | val x : real ref 5 | er6.sml, line 8, column 6: 6 | fun f `[r] () : real = 7 | ^^^^ 8 | Explicit region variable `r has insufficient scope. 9 | Stopping compilation of MLB-file due to error (code 1). 10 | -------------------------------------------------------------------------------- /test/explicit_regions/er7.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er7.sml] 2 | > infix 0 + 3 | val ! : 'a ref -> 'a 4 | val f : unit -> real 5 | val x : real ref 6 | er7.sml, line 10, column 11: 7 | let with r2 8 | ^^ 9 | Explicit region variable `r2 has insufficient scope. 10 | Stopping compilation of MLB-file due to error (code 1). 11 | -------------------------------------------------------------------------------- /test/explicit_regions/er8.sml: -------------------------------------------------------------------------------- 1 | (* it is an error to unify a local region with a 2 | * region parameter *) 3 | 4 | infix + 5 | fun f `[r1] () : real = 6 | let with r2 7 | val z = 8.0`r1 8 | val y = if true then 3.4`r2 9 | else z 10 | in 2.0 + y 11 | end 12 | -------------------------------------------------------------------------------- /test/explicit_regions/er8.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er8.sml] 2 | > infix 0 + 3 | val f : unit -> real 4 | er8.sml, line 5, column 6: 5 | fun f `[r1] () : real = 6 | ^^^^^ 7 | Cannot unify the explicit region variables `r1 and `r2 8 | Stopping compilation of MLB-file due to error (code 1). 9 | -------------------------------------------------------------------------------- /test/explicit_regions/er9.sml: -------------------------------------------------------------------------------- 1 | (* it is an error to unify two region parameters *) 2 | 3 | infix + 4 | fun f `[r1 r2] () : real = 5 | let val z = 8.0`r1 6 | val y = if true then 3.4`r2 7 | else z 8 | in 2.0 + y 9 | end 10 | -------------------------------------------------------------------------------- /test/explicit_regions/er9.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: er9.sml] 2 | > infix 0 + 3 | val f : unit -> real 4 | er9.sml, line 4, column 6: 5 | fun f `[r1 r2] () : real = 6 | ^^^^^^^^ 7 | Cannot unify the explicit region variables `r1 and `r2 8 | Stopping compilation of MLB-file due to error (code 1). 9 | -------------------------------------------------------------------------------- /test/explicit_regions/err_copylist.sml: -------------------------------------------------------------------------------- 1 | (* Exomorphisms by non-unifiable explicit region variables *) 2 | 3 | infix :: 4 | 5 | fun copy `[r1 r2] (xs : int list`r1) : int list`r2 = 6 | case xs of 7 | nil => nil 8 | | x :: xs => x :: xs 9 | -------------------------------------------------------------------------------- /test/explicit_regions/err_expty1.sml: -------------------------------------------------------------------------------- 1 | (* The global region variable of type T cannot be associated with a pair type *) 2 | 3 | val a = (4,6) : (int * int)`r0top 4 | -------------------------------------------------------------------------------- /test/explicit_regions/err_expty1.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: err_expty1.sml] 2 | > val a : int * int 3 | err_expty1.sml, line 3, column 28: 4 | val a = (4,6) : (int * int)`r0top 5 | ^^^^^ 6 | Explicit region variable r0top is of type T and cannot also be of type p 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/err_expty2.sml: -------------------------------------------------------------------------------- 1 | (* The global region variable of type pair cannot be associated with a function type *) 2 | 3 | val f : (int -> int)`r0pair = fn x => 4 4 | -------------------------------------------------------------------------------- /test/explicit_regions/err_expty3.sml: -------------------------------------------------------------------------------- 1 | (* Escaping functions cannot live in local regions *) 2 | 3 | val f : unit -> int -> int = 4 | (fn () => 5 | let with r 6 | val g = (fn x => 4) : (int -> int)`r 7 | in g 8 | end) 9 | -------------------------------------------------------------------------------- /test/explicit_regions/err_expty3.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: err_expty3.sml] 2 | > val f : unit -> int -> int 3 | err_expty3.sml, line 5, column 17: 4 | let with r 5 | ^ 6 | Explicit region variable `r has insufficient scope. 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/err_funty1.sml: -------------------------------------------------------------------------------- 1 | (* The global region variable of type T cannot be associated with a pair type 2 | (type in function return pattern) 3 | *) 4 | 5 | fun f () : (int * int)`r0top = (4,6) 6 | -------------------------------------------------------------------------------- /test/explicit_regions/err_funty1.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: err_funty1.sml] 2 | > val f : unit -> int * int 3 | err_funty1.sml, line 5, column 23: 4 | fun f () : (int * int)`r0top = (4,6) 5 | ^^^^^ 6 | Explicit region variable r0top is of type T and cannot also be of type p 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/err_funty2.sml: -------------------------------------------------------------------------------- 1 | (* Inconsistent use of a parameter region. A region cannot hold both 2 | * pairs and triples. *) 3 | 4 | fun f `[r] () : (((int * int)`r -> (int * int)`r) * int * bool)`r = 5 | (fn z => z, 3, false) 6 | -------------------------------------------------------------------------------- /test/explicit_regions/err_funty3.sml: -------------------------------------------------------------------------------- 1 | (* Inconsistent use of a parameter region. A region cannot hold both 2 | * pairs and strings. *) 3 | 4 | fun f `[r] (a:string`r) : (int * string)`r = (3, a) 5 | -------------------------------------------------------------------------------- /test/explicit_regions/err_patty1.sml: -------------------------------------------------------------------------------- 1 | (* The global region variable of type T cannot be associated with a pair type 2 | (type in pattern version) 3 | *) 4 | 5 | val a : (int * int)`r0top = (4,6) 6 | -------------------------------------------------------------------------------- /test/explicit_regions/err_patty1.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: err_patty1.sml] 2 | > val a : int * int 3 | err_patty1.sml, line 5, column 20: 4 | val a : (int * int)`r0top = (4,6) 5 | ^^^^^ 6 | Explicit region variable r0top is of type T and cannot also be of type p 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/err_ty1.sml: -------------------------------------------------------------------------------- 1 | (* An effect variable (beginning with 'e') cannot be used as a region variable *) 2 | 3 | val x = 4 | let with e 5 | val a : int #e->string = fn x => "hi" 6 | in (a 3) : string`e 7 | end 8 | -------------------------------------------------------------------------------- /test/explicit_regions/err_ty1.sml.log.ok: -------------------------------------------------------------------------------- 1 | [reading source file: err_ty1.sml] 2 | > val x : string 3 | err_ty1.sml, line 6, column 22: 4 | in (a 3) : string`e 5 | ^ 6 | Expects explicit region variable but e is an explicit effect variable 7 | Stopping compilation of MLB-file due to error (code 1). 8 | -------------------------------------------------------------------------------- /test/explicit_regions/expty1.sml: -------------------------------------------------------------------------------- 1 | (* A local function can be forced into a global region *) 2 | 3 | infix + 4 | fun printNum (i:int) : unit = prim("printNum", i) 5 | 6 | val x : int = 7 | let with r 8 | val t = 3.0 + 4.0 9 | val f : (int->int)`r0top = fn x => #1(x+2,t) 10 | in f 4 11 | end 12 | 13 | val () = printNum x 14 | -------------------------------------------------------------------------------- /test/explicit_regions/expty1.sml.out.ok: -------------------------------------------------------------------------------- 1 | Num: 6 2 | -------------------------------------------------------------------------------- /test/explicit_regions/expty2.sml: -------------------------------------------------------------------------------- 1 | (* A locally generated function that is returned can be stored in a passed region *) 2 | 3 | infix + 4 | fun printNum (i:int) : unit = prim("printNum", i) 5 | 6 | fun g `[r] (a:int) : (int->int)`r = 7 | fn x => #1(x+2,a) 8 | 9 | val () = printNum ((g 6) 8) 10 | -------------------------------------------------------------------------------- /test/explicit_regions/expty2.sml.out.ok: -------------------------------------------------------------------------------- 1 | Num: 10 2 | -------------------------------------------------------------------------------- /test/explicit_regions/funty1.sml: -------------------------------------------------------------------------------- 1 | (* A local function can be forced to have toplevel effect *) 2 | 3 | infix + 4 | fun printNum (i:int) : unit = prim("printNum", i) 5 | 6 | val x = 7 | let val f : int #e0->int = fn x => x+8 8 | in f 3 9 | end 10 | 11 | val () = printNum x 12 | -------------------------------------------------------------------------------- /test/explicit_regions/funty1.sml.out.ok: -------------------------------------------------------------------------------- 1 | Num: 11 2 | -------------------------------------------------------------------------------- /test/explicit_regions/nomut-ok.sml.out.ok: -------------------------------------------------------------------------------- 1 | Hello 2 | Hello again 3 | hi there 4 | -------------------------------------------------------------------------------- /test/explicit_regions/par.sml.out.ok: -------------------------------------------------------------------------------- 1 | Done 2 | -------------------------------------------------------------------------------- /test/explicit_regions/param.sml: -------------------------------------------------------------------------------- 1 | fun f `[r] () : real = 4.3`r 2 | -------------------------------------------------------------------------------- /test/explicit_regions/param.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/param.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/param1.sml: -------------------------------------------------------------------------------- 1 | fun f `r () : real = 4.3`r 2 | -------------------------------------------------------------------------------- /test/explicit_regions/param1.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/param1.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/rec.sml: -------------------------------------------------------------------------------- 1 | (* Records can be allocated in explicit regions *) 2 | fun f () : int = 3 | let with r 4 | val x = {a=3,b=5}`r 5 | in #b x 6 | end 7 | -------------------------------------------------------------------------------- /test/explicit_regions/rec.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/rec.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/ref.sml: -------------------------------------------------------------------------------- 1 | (* Refs can be allocated in explicit regions *) 2 | 3 | infix + 4 | fun !(x: 'a ref): 'a = prim ("!", x) 5 | 6 | fun f () : int = 7 | let with r 8 | val x = ref`[r] 8 9 | val y = ref`r 9 10 | in !x + !y 11 | end 12 | -------------------------------------------------------------------------------- /test/explicit_regions/ref.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/ref.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/string.sml: -------------------------------------------------------------------------------- 1 | (* Strings can be allocated in explicit regions *) 2 | 3 | fun size (s : string) : int = prim ("__bytetable_size", s) 4 | 5 | fun f () : int = 6 | let with r 7 | val x = "Hi there"`r 8 | in size x 9 | end 10 | -------------------------------------------------------------------------------- /test/explicit_regions/string.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/string.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/tup.sml: -------------------------------------------------------------------------------- 1 | (* Tuples can be allocated in explicit regions *) 2 | fun f () : int = 3 | let with r 4 | val x = (3,5)`r 5 | in #1 x 6 | end 7 | -------------------------------------------------------------------------------- /test/explicit_regions/tup.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/tup.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/tup2.sml: -------------------------------------------------------------------------------- 1 | (* Two tuples can be allocated in the same explicit region *) 2 | 3 | infix + 4 | fun f () : int = 5 | let with r 6 | val x = (3,5)`r 7 | val y = (5,8)`r 8 | in #1 x + #2 y 9 | end 10 | -------------------------------------------------------------------------------- /test/explicit_regions/tup2.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/tup2.sml.out.ok -------------------------------------------------------------------------------- /test/explicit_regions/ty1.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/explicit_regions/ty1.sml.out.ok -------------------------------------------------------------------------------- /test/export.sml: -------------------------------------------------------------------------------- 1 | val a = ref 34 2 | fun incr (x:int) = x + !a before a:=2 3 | 4 | val _ = _export ("incr", incr) 5 | 6 | (* Call to do work in C *) 7 | val _ = (prim("work",()):unit) -------------------------------------------------------------------------------- /test/export2.sml.out.ok: -------------------------------------------------------------------------------- 1 | Result: 3 2 | -------------------------------------------------------------------------------- /test/export3.sml.out.ok: -------------------------------------------------------------------------------- 1 | Result: 109 2 | -------------------------------------------------------------------------------- /test/fft.sml.out.ok: -------------------------------------------------------------------------------- 1 | 2 | fft by Torben Mogensen (torbenm@diku.dk) 3 | 4 | fft'ing... done 5 | -------------------------------------------------------------------------------- /test/fns.sml.out.ok: -------------------------------------------------------------------------------- 1 | Testing function applications, etc... 2 | test1 OK 3 | test2 OK 4 | test3 OK 5 | -------------------------------------------------------------------------------- /test/foldbug.sml: -------------------------------------------------------------------------------- 1 | datatype 'a tree = L | T of 'a tree * 'a * 'a tree 2 | 3 | fun fold (_, L, acc) = acc 4 | | fold (f, T (l, x, r), acc) = fold (f, l, (f (x, fold (f, r, acc)))) 5 | 6 | val v = fold (fn (x, a) => x+a, T(L,40,T(L,2,L)), 0) 7 | 8 | val () = print (Int.toString v ^ "\n") 9 | -------------------------------------------------------------------------------- /test/foldbug.sml.out.ok: -------------------------------------------------------------------------------- 1 | 42 2 | -------------------------------------------------------------------------------- /test/fork.sml: -------------------------------------------------------------------------------- 1 | val _ = case Posix.Process.fork() of 2 | SOME i => print "In Parrent\n" 3 | | NONE => print "In Child\n" -------------------------------------------------------------------------------- /test/freedatatype.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** freedatatype.sml ************* 4 | 5 | 6 | freedatatype.sml, line 17, column 19: 7 | let datatype t = C of 'c 8 | ^^^^^^^^^^^ 9 | unbound type variable 'c. 10 | -------------------------------------------------------------------------------- /test/freedatatype2.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** freedatatype2.sml ************* 4 | 5 | 6 | freedatatype2.sml, line 17, column 19: 7 | let datatype t = C of 'a 8 | ^^^^^^^^^^^ 9 | unbound type variable 'a. 10 | -------------------------------------------------------------------------------- /test/ftv.sml: -------------------------------------------------------------------------------- 1 | fun g h v = h v 2 | 3 | functor F() : sig end = 4 | struct 5 | val z = g (fn _ => ()) 6 | end 7 | 8 | structure S1 = F() 9 | 10 | structure S2 = F(); -------------------------------------------------------------------------------- /test/ftv.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/ftv.sml.out.ok -------------------------------------------------------------------------------- /test/functor.sml.out.ok: -------------------------------------------------------------------------------- 1 | value is A(K) 2 | value is A(J) 3 | -------------------------------------------------------------------------------- /test/functor2.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/functor2.sml.out.ok -------------------------------------------------------------------------------- /test/functor3.sml: -------------------------------------------------------------------------------- 1 | structure S = 2 | struct 3 | fun f a = a 4 | end 5 | 6 | functor A() = S 7 | 8 | functor B ( val f : string -> string ) = 9 | struct val f = f 10 | end 11 | 12 | functor C() = B( A() ) 13 | 14 | structure M = C() 15 | 16 | val _ = print (M.f "Ok\n") -------------------------------------------------------------------------------- /test/functor3.sml.out.ok: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /test/functor4.sml: -------------------------------------------------------------------------------- 1 | signature R = sig type r(*58*) val R : r end 2 | 3 | functor A(R : R (*59*)) = 4 | struct 5 | type r(*59*) = R.r 6 | end 7 | 8 | structure R = struct datatype r(*62*) = R end 9 | 10 | structure B = A(R) 11 | 12 | -------------------------------------------------------------------------------- /test/gc0.sml.out.ok: -------------------------------------------------------------------------------- 1 | now working 2 | done working 3 | done 4 | -------------------------------------------------------------------------------- /test/gc01.sml.out.ok: -------------------------------------------------------------------------------- 1 | now working 2 | done working 3 | done 4 | -------------------------------------------------------------------------------- /test/globalbotrho.sml: -------------------------------------------------------------------------------- 1 | fun go () a : ('a -> 'b) * ('a -> unit) = 2 | let val b = ref 7 3 | in 4 | (fn a => raise Match, 5 | fn a => ()) 6 | end -------------------------------------------------------------------------------- /test/hatch1.sml.out.ok: -------------------------------------------------------------------------------- 1 | hi1 2 | hi2 3 | ok 4 | -------------------------------------------------------------------------------- /test/helsen.sml: -------------------------------------------------------------------------------- 1 | val test = let val g = fn y (* : int *) => y in 2 | fn y => (let val f1 = fn x => (g 7) 3 | val f2 = fn f => 4 4 | in 5 | f2 f1 6 | end) 7 | end 2 -------------------------------------------------------------------------------- /test/host.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in host.sml 4 | end 5 | -------------------------------------------------------------------------------- /test/input_to_testdyn2: -------------------------------------------------------------------------------- 1 | Potato 2 | hello 3 | -------------------------------------------------------------------------------- /test/intinf2.sml.out.ok: -------------------------------------------------------------------------------- 1 | Ok 2 | Ok 3 | Ok 4 | Ok 5 | Ok 6 | Ok 7 | -------------------------------------------------------------------------------- /test/kitdangle.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/kitdangle.sml.out.ok -------------------------------------------------------------------------------- /test/kitdangle3.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/kitdangle3.sml.out.ok -------------------------------------------------------------------------------- /test/kitfib35.sml: -------------------------------------------------------------------------------- 1 | (*kitfib35.sml*) 2 | 3 | let 4 | infix + - < 5 | fun fib n = if n < 1 then 1 else fib (n-1) + fib (n-2) 6 | in 7 | fib 35; () 8 | end 9 | -------------------------------------------------------------------------------- /test/kitfib35.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/kitfib35.sml.out.ok -------------------------------------------------------------------------------- /test/kitfib35_mlton.sml: -------------------------------------------------------------------------------- 1 | (*kitfib35.sml*) 2 | 3 | val _ = 4 | let 5 | infix + - < 6 | fun fib n = if n < 1 then 1 else fib (n-1) + fib (n-2) 7 | in 8 | fib 35; () 9 | end 10 | -------------------------------------------------------------------------------- /test/kitfib35_smlnj.sml: -------------------------------------------------------------------------------- 1 | (*kitfib35.sml*) 2 | 3 | fun doit() = 4 | let 5 | infix + - < 6 | fun fib n = if n < 1 then 1 else fib (n-1) + fib (n-2) 7 | in 8 | fib 35; () 9 | end 10 | -------------------------------------------------------------------------------- /test/kitloop2.sml.out.ok: -------------------------------------------------------------------------------- 1 | 2 | looping... 3 | 4 | done 5 | -------------------------------------------------------------------------------- /test/kitmandelbrot.sml.out.ok: -------------------------------------------------------------------------------- 1 | 4194304 iterations 2 | 4194304 iterations 3 | 4194304 iterations 4 | -------------------------------------------------------------------------------- /test/kitmolgard.sml.out.ok: -------------------------------------------------------------------------------- 1 | init_stateSim.createCreating instances... 2 | Initializing markings... 3 | Iter: 0 4 | Iter: 1 5 | Iter: 2 6 | Iter: 3 7 | Iter: 4 8 | Iter: 5 9 | -------------------------------------------------------------------------------- /test/kitqsort.sml.out.ok: -------------------------------------------------------------------------------- 1 | Ok! 2 | -------------------------------------------------------------------------------- /test/kitreynolds2.sml.out.ok: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /test/kitreynolds3.sml.out.ok: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /test/kittmergesort.sml.out.ok: -------------------------------------------------------------------------------- 1 | 2 | List generated 3 | Doing tmergesort... 4 | Sorted 100000 5 | numbers 6 | 7 | -------------------------------------------------------------------------------- /test/layout.sml: -------------------------------------------------------------------------------- 1 | 2 | fun layout (cbs : (string * real) list list) : string = 3 | let 4 | val layoutcb = 5 | map (fn (con,_) => con) 6 | 7 | fun layoutdb cb = "{" ^ concat(layoutcb cb) ^ "}" 8 | in concat(map layoutdb cbs) 9 | end 10 | -------------------------------------------------------------------------------- /test/layout.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** layout.sml ************* 4 | 5 | -------------------------------------------------------------------------------- /test/layout.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/layout.sml.out.ok -------------------------------------------------------------------------------- /test/lex.sml: -------------------------------------------------------------------------------- 1 | 2 | fun token0(tokFn) = tokFn 3 | 4 | and token1(tokFn, value) = tokFn(value) 5 | 6 | val a = token1(fn _ => "1", 2) 7 | -------------------------------------------------------------------------------- /test/lex.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** lex.sml ************* 4 | 5 | -------------------------------------------------------------------------------- /test/lex.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/lex.sml.out.ok -------------------------------------------------------------------------------- /test/listpair.sml.out.ok: -------------------------------------------------------------------------------- 1 | 2 | File listpair.sml: Testing structure ListPair... 3 | test1 OK 4 | test2a OK 5 | test2b OK 6 | test3a OK 7 | checkv OK 8 | checkv OK 9 | test5a OK 10 | test5b OK 11 | test5c OK 12 | checkv OK 13 | checkv OK 14 | test6 OK 15 | test7 OK 16 | -------------------------------------------------------------------------------- /test/listsort.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/basis/kitlib.mlb 3 | in listsort.sml 4 | end -------------------------------------------------------------------------------- /test/listsort.mlb.out.ok: -------------------------------------------------------------------------------- 1 | 2 | File listsort.sml: Testing structure Listsort... 3 | test1 OK 4 | test2 OK 5 | -------------------------------------------------------------------------------- /test/lllllll.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/lllllll.txt -------------------------------------------------------------------------------- /test/llv.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/llv.sml.out.ok -------------------------------------------------------------------------------- /test/logic.mlb: -------------------------------------------------------------------------------- 1 | logic/sources.mlb 2 | -------------------------------------------------------------------------------- /test/logic.mlb.out.ok: -------------------------------------------------------------------------------- 1 | Yes 2 | -------------------------------------------------------------------------------- /test/logic/sources.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | term.sml 3 | trail.sml 4 | unify.sml 5 | data.sml 6 | main.sml 7 | 8 | -------------------------------------------------------------------------------- /test/logic/sources_mlton.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | term.sml 3 | trail.sml 4 | unify.sml 5 | data.sml 6 | main.sml 7 | 8 | -------------------------------------------------------------------------------- /test/logic/sources_smlnj.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | term.sml 3 | trail.sml 4 | unify.sml 5 | data.sml 6 | main_smlnj.sml 7 | 8 | -------------------------------------------------------------------------------- /test/logic/term.sml: -------------------------------------------------------------------------------- 1 | (* term.sml *) 2 | 3 | structure Term = 4 | struct 5 | datatype term 6 | = STR of string * term list 7 | | INT of int31 8 | | CON of string 9 | | REF of term option ref 10 | 11 | exception BadArg of string 12 | end; 13 | -------------------------------------------------------------------------------- /test/logic_mlton.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | logic/sources_mlton.cm 3 | -------------------------------------------------------------------------------- /test/logic_smlnj.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | logic/sources_smlnj.cm 3 | -------------------------------------------------------------------------------- /test/mlbtest/B.sml: -------------------------------------------------------------------------------- 1 | val _ = case length ["Hello ", "World\n"] of 2 | 2 => print "OK" 3 | | _ => print "Error" -------------------------------------------------------------------------------- /test/mlbtest/ab.mlb: -------------------------------------------------------------------------------- 1 | (* Initial allows for other modules to be discharged at link time *) 2 | 3 | A.sml 4 | B.sml 5 | -------------------------------------------------------------------------------- /test/mlbtest/char.mlb: -------------------------------------------------------------------------------- 1 | char.sml 2 | charsig.sml -------------------------------------------------------------------------------- /test/mlbtest/char.sml: -------------------------------------------------------------------------------- 1 | structure S :> sig type t end = 2 | struct 3 | datatype s = S of char 4 | datatype t = T of s 5 | end 6 | 7 | open S -------------------------------------------------------------------------------- /test/mlbtest/charsig.sml: -------------------------------------------------------------------------------- 1 | signature X = 2 | sig datatype s = S of t 3 | end 4 | 5 | structure K :> X = 6 | struct 7 | datatype s = S of t 8 | end 9 | 10 | val f = fn t => K.S t -------------------------------------------------------------------------------- /test/mlbtest/d1/a.sml: -------------------------------------------------------------------------------- 1 | val a = "hello" -------------------------------------------------------------------------------- /test/mlbtest/d1/d.mlb: -------------------------------------------------------------------------------- 1 | a.sml 2 | -------------------------------------------------------------------------------- /test/mlbtest/d1/f.mlb: -------------------------------------------------------------------------------- 1 | f.sml -------------------------------------------------------------------------------- /test/mlbtest/d1/f.sml: -------------------------------------------------------------------------------- 1 | functor F() = struct 2 | val a = 6 3 | end 4 | -------------------------------------------------------------------------------- /test/mlbtest/d1/f2.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | f.mlb 3 | f2.sml -------------------------------------------------------------------------------- /test/mlbtest/d1/f2.sml: -------------------------------------------------------------------------------- 1 | structure S2 = F() 2 | val _ = print (Int.toString S2.a) 3 | -------------------------------------------------------------------------------- /test/mlbtest/d2/b.sml: -------------------------------------------------------------------------------- 1 | val b = (c, "world") -------------------------------------------------------------------------------- /test/mlbtest/d2/c.sml: -------------------------------------------------------------------------------- 1 | val c = (a, " ") -------------------------------------------------------------------------------- /test/mlbtest/d2/d.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | d2.mlb 3 | ../A.sml 4 | b.sml 5 | -------------------------------------------------------------------------------- /test/mlbtest/d2/d2.mlb: -------------------------------------------------------------------------------- 1 | ../d1/d.mlb 2 | c.sml 3 | -------------------------------------------------------------------------------- /test/mlbtest/datatype/d.mlb: -------------------------------------------------------------------------------- 1 | d1.sml -------------------------------------------------------------------------------- /test/mlbtest/datatype/d1.sml: -------------------------------------------------------------------------------- 1 | signature SIG = sig type t val a : t end 2 | 3 | structure S : SIG = 4 | struct 5 | datatype u = U 6 | datatype t = T of u 7 | val a : t = T U 8 | end -------------------------------------------------------------------------------- /test/mlbtest/dir.mlb: -------------------------------------------------------------------------------- 1 | d1/d.mlb 2 | d2/d.mlb -------------------------------------------------------------------------------- /test/mlbtest/dir2.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | d1/a.sml 3 | dir2.sml -------------------------------------------------------------------------------- /test/mlbtest/f1.mlb: -------------------------------------------------------------------------------- 1 | d1/f.mlb 2 | f1.sml -------------------------------------------------------------------------------- /test/mlbtest/f1.sml: -------------------------------------------------------------------------------- 1 | structure S = F() 2 | -------------------------------------------------------------------------------- /test/mlbtest/functor.mlb: -------------------------------------------------------------------------------- 1 | functor1.sml 2 | functor2.sml 3 | functor3.sml 4 | functor4.sml -------------------------------------------------------------------------------- /test/mlbtest/functor1.sml: -------------------------------------------------------------------------------- 1 | val a = "Not used" 2 | val b = "Hello" -------------------------------------------------------------------------------- /test/mlbtest/functor2.sml: -------------------------------------------------------------------------------- 1 | functor A() = 2 | struct 3 | val c = (b,"World") 4 | end -------------------------------------------------------------------------------- /test/mlbtest/functor3.sml: -------------------------------------------------------------------------------- 1 | functor B() = 2 | struct 3 | structure A = A() 4 | val d = (A.c,"Today") 5 | end 6 | -------------------------------------------------------------------------------- /test/mlbtest/functor4.sml: -------------------------------------------------------------------------------- 1 | structure B = B() -------------------------------------------------------------------------------- /test/mlbtest/sig.mlb: -------------------------------------------------------------------------------- 1 | sig.sig 2 | sig.sml -------------------------------------------------------------------------------- /test/mlbtest/sig.sig: -------------------------------------------------------------------------------- 1 | signature S = 2 | sig 3 | type t 4 | val a : t 5 | end -------------------------------------------------------------------------------- /test/mlbtest/sig.sml: -------------------------------------------------------------------------------- 1 | structure S : S = 2 | struct 3 | type t = int 4 | val a = 5 5 | end -------------------------------------------------------------------------------- /test/msort.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | msort.sml 3 | upto.sml 4 | msortrun.sml 5 | -------------------------------------------------------------------------------- /test/msort.mlb.out.ok: -------------------------------------------------------------------------------- 1 | Really done 2 | -------------------------------------------------------------------------------- /test/msortrun.sml: -------------------------------------------------------------------------------- 1 | 2 | val runmsort = msort(upto(50000)) 3 | 4 | val result = print "Really done\n"; 5 | -------------------------------------------------------------------------------- /test/multiarg.sml: -------------------------------------------------------------------------------- 1 | infix - + 2 | 3 | 4 | fun myfun (a,b) = (b+1,a-1) 5 | 6 | 7 | fun one (a) = a+1 8 | 9 | fun myfun2 (a,b) c : int = a+b+c 10 | fun myfun3 a b c : int = a+b+c 11 | 12 | fun myfun4 a (b,c) : int = a+b+c 13 | -------------------------------------------------------------------------------- /test/nucleic.mlb: -------------------------------------------------------------------------------- 1 | nucleic/sources.mlb 2 | -------------------------------------------------------------------------------- /test/nucleic.mlb.out.ok: -------------------------------------------------------------------------------- 1 | 179 2 | -------------------------------------------------------------------------------- /test/nucleic/sources.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | nucleic.sml 3 | main.sml 4 | 5 | -------------------------------------------------------------------------------- /test/oh-no.sml: -------------------------------------------------------------------------------- 1 | local 2 | exception S of int 3 | in 4 | fun f 0 : unit = raise S 1 5 | | f a = f a 6 | 7 | end -------------------------------------------------------------------------------- /test/oh-no.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** oh-no.sml ************* 4 | 5 | > val f : int -> unit 6 | -------------------------------------------------------------------------------- /test/oh-no.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/oh-no.sml.out.ok -------------------------------------------------------------------------------- /test/oh-no2.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** oh-no2.sml ************* 4 | 5 | > datatype 'a map 6 | con E : 'a map 7 | con N : 'a map * 'a map -> 'a map 8 | exception Impossible of string 9 | val plus : 'a map * 'a map -> 'a map 10 | -------------------------------------------------------------------------------- /test/oh-no2.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/oh-no2.sml.out.ok -------------------------------------------------------------------------------- /test/opaque.sml.out.ok: -------------------------------------------------------------------------------- 1 | f.a = 232 2 | g.A = A 3 | g.B = B 4 | h.b = 343 5 | i.c = (A,C) 6 | -------------------------------------------------------------------------------- /test/opaque2.sml.out.ok: -------------------------------------------------------------------------------- 1 | uncaught exception Match 2 | -------------------------------------------------------------------------------- /test/opaque3.sml: -------------------------------------------------------------------------------- 1 | signature A = 2 | sig 3 | type t 4 | val C : t 5 | end 6 | 7 | functor F() = 8 | struct 9 | type t = int 10 | val C : t = 4 11 | end :> A 12 | 13 | structure S0 = F() :> A 14 | -------------------------------------------------------------------------------- /test/opaque3.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/opaque3.sml.out.ok -------------------------------------------------------------------------------- /test/packreal.sml.out.ok: -------------------------------------------------------------------------------- 1 | Testing structure PackRealBig... 2 | [r = 0.0, sz(vector) = 8, sz(bs) 8, r' = 0.0] 3 | [r = 2.0, sz(vector) = 8, sz(bs) 8, r' = 2.0] 4 | [r = 43.23, sz(vector) = 8, sz(bs) 8, r' = 43.23] 5 | [r = ~43.2, sz(vector) = 8, sz(bs) 8, r' = ~43.2] 6 | test1 OK 7 | -------------------------------------------------------------------------------- /test/packreal2.sml.out.ok: -------------------------------------------------------------------------------- 1 | big: C0,A,48,27,B6,FE,2E,6F 2 | little: 6F,2E,FE,B6,27,48,A,C0 3 | -------------------------------------------------------------------------------- /test/packreal3.sml.out.ok: -------------------------------------------------------------------------------- 1 | Testing PackRealBig 2 | OK 3 | OK 4 | OK 5 | OK 6 | Testing PackRealLittle 7 | OK 8 | OK 9 | OK 10 | OK 11 | -------------------------------------------------------------------------------- /test/parallelism/cores.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/basis/par.mlb 4 | in 5 | cores.sml 6 | end 7 | -------------------------------------------------------------------------------- /test/parallelism/cores.sml.out.ok: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /test/parallelism/exn1.sml.out.ok: -------------------------------------------------------------------------------- 1 | Num: 1 2 | Num: 2 3 | Num: 3 4 | Num: 4 5 | Num: 5 6 | Num: 6 7 | Num: 7 8 | Num: 8 9 | Num: 9 10 | Num: 10 11 | Num: 11 12 | Num: 12 13 | Num: 13 14 | Num: 14 15 | Num: 15 16 | Num: 16 17 | Num: 17 18 | Num: 18 19 | Num: 19 20 | Num: 20 21 | Num: 0 22 | -------------------------------------------------------------------------------- /test/parallelism/exn2.sml.out.ok: -------------------------------------------------------------------------------- 1 | Num: 1 2 | Num: 1 3 | Num: 1 4 | -------------------------------------------------------------------------------- /test/parallelism/spawn.sml.out.ok: -------------------------------------------------------------------------------- 1 | Num: 32 2 | Num: 18 3 | Num: 8 4 | Num: 2 5 | -------------------------------------------------------------------------------- /test/parallelism/spawn_simple.sml.out.ok: -------------------------------------------------------------------------------- 1 | Hi - 1 2 | Hi - 2 3 | Hi - 3 4 | Starting thread 5 | hi 6 | Done 7 | -------------------------------------------------------------------------------- /test/parallelism/spawn_simple2.sml.out.ok: -------------------------------------------------------------------------------- 1 | hi there 2 | Hi 3 | -------------------------------------------------------------------------------- /test/parallelism/spawn_simple3.sml.out.ok: -------------------------------------------------------------------------------- 1 | Fib(23) by created thread: 2 | Num: 46368 3 | Fib(23) by main thread: 4 | Num: 46368 5 | -------------------------------------------------------------------------------- /test/parallelism/spawn_simple4.sml.out.ok: -------------------------------------------------------------------------------- 1 | starting... 2 | Num: 17711 3 | Num: 28657 4 | Num: 46368 5 | goodbye. 6 | -------------------------------------------------------------------------------- /test/parallelism/spawn_simple5.sml.out.ok: -------------------------------------------------------------------------------- 1 | starting... 2 | Num: 121392 3 | Num: 46368 4 | Num: 17710 5 | goodbye. 6 | -------------------------------------------------------------------------------- /test/parallelism/spawn_simple6.sml.out.ok: -------------------------------------------------------------------------------- 1 | starting... 2 | Num: 5050 3 | Num: 75024 4 | Num: 20100 5 | goodbye. 6 | -------------------------------------------------------------------------------- /test/pat.sml: -------------------------------------------------------------------------------- 1 | 2 | val (f, hd::tail) = (fn x => x, [fn y => (y,y)]) 3 | 4 | val (s,_) = f (hd "hello world\n") 5 | 6 | val _ = print (s) 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/pat.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** pat.sml ************* 4 | 5 | > val f : 'a -> 'a 6 | val hd : 'a -> 'a * 'a 7 | val s : string 8 | val tail : ('a -> 'a * 'a) list 9 | *** Warnings *** 10 | pat.sml, line 2, column 4: 11 | val (f, hd::tail) = (fn x => x, [fn y => (y,y)]) 12 | ^^^^^^^^^^^^^ 13 | Pattern not exhaustive. 14 | -------------------------------------------------------------------------------- /test/pat.sml.out.ok: -------------------------------------------------------------------------------- 1 | hello world 2 | -------------------------------------------------------------------------------- /test/patricia.sml.out.ok: -------------------------------------------------------------------------------- 1 | OK : test1 2 | OK : test2 3 | OK : test3 4 | OK : test4 5 | OK : test5 6 | OK : test6 7 | OK : test6 8 | OK : test7 9 | OK : test8 10 | OK : test9 11 | OK : test10 12 | OK : test11 13 | OK : test12 14 | -------------------------------------------------------------------------------- /test/perm.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | perm1.sml 3 | perm.sml -------------------------------------------------------------------------------- /test/perm1.sml: -------------------------------------------------------------------------------- 1 | fun composePartial (f, g) x = 2 | case g x of 3 | NONE => NONE 4 | | SOME y => f y 5 | -------------------------------------------------------------------------------- /test/pickletest.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | pickle.mlb 4 | in 5 | pickletest.sml 6 | end 7 | -------------------------------------------------------------------------------- /test/poll.sml.out.ok: -------------------------------------------------------------------------------- 1 | OK! 2 | -------------------------------------------------------------------------------- /test/professor.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/professor.sml -------------------------------------------------------------------------------- /test/rank.sml: -------------------------------------------------------------------------------- 1 | local 2 | val f = let val f = (fn x => x) (fn x => x) 3 | in f 4 | end 5 | 6 | datatype t = A 7 | 8 | val g = fn x => let val d = #1 x 9 | val k = #2 x 10 | val s = f (d,k) 11 | val _ = if true then (d,k) else x 12 | in s 13 | end 14 | in 15 | val a : t * t = g (A,A) 16 | end -------------------------------------------------------------------------------- /test/rank.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** rank.sml ************* 4 | 5 | 6 | rank.sml, line 15, column 16: 7 | val a : t * t = g (A,A) 8 | ^^^^^^^ 9 | Type rank error, 10 | expecting: t * t -> t * t 11 | found: 'a * 'b -> 'a * 'b 12 | The generative type t is newer than the free type variable 'a. 13 | -------------------------------------------------------------------------------- /test/ratio-regions.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** ratio-regions.sml ************* 4 | 5 | -------------------------------------------------------------------------------- /test/ray.mlb: -------------------------------------------------------------------------------- 1 | ray/sources.mlb 2 | -------------------------------------------------------------------------------- /test/ray.mlb.out.ok: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /test/ray/README: -------------------------------------------------------------------------------- 1 | Ray: 2 | 3 | Input: file input 4 | Output: file output - should match DATA/TEST 5 | -------------------------------------------------------------------------------- /test/ray/input: -------------------------------------------------------------------------------- 1 | 100 0 0 0 8 8 8 color sphere 2 | /./ray/output raytrace 3 | stop 4 | -------------------------------------------------------------------------------- /test/ray/load: -------------------------------------------------------------------------------- 1 | exception Fail of string; (** not present in old versions **) 2 | 3 | app use [ 4 | "objects.sml", 5 | "ray.sml", 6 | "interp.sml", 7 | "interface.sml", 8 | "main.sml" 9 | ]; 10 | -------------------------------------------------------------------------------- /test/ray/sources.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | objects.sml 3 | ray.sml 4 | interp.sml 5 | interface.sml 6 | main.sml 7 | 8 | -------------------------------------------------------------------------------- /test/real_match.sml: -------------------------------------------------------------------------------- 1 | local 2 | fun print (s:string) : unit = prim("printStringML", s) 3 | datatype t = A of real | B 4 | fun pp p = case p of 5 | A _ => "OK\n" 6 | | B => "ERR\n" 7 | in 8 | val () = print "test: " 9 | val b = A 1.0 10 | val () = print (pp b) 11 | end 12 | -------------------------------------------------------------------------------- /test/real_match.sml.out.ok: -------------------------------------------------------------------------------- 1 | test: OK 2 | -------------------------------------------------------------------------------- /test/regexp.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/regexp.sml -------------------------------------------------------------------------------- /test/regexp.sml.out.ok: -------------------------------------------------------------------------------- 1 | Testing RegExp... 2 | test1a OK 3 | test2a OK 4 | test2b OK 5 | test3a OK 6 | test3b OK 7 | -------------------------------------------------------------------------------- /test/regexp1.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/basis/kitlib.mlb 3 | in regexp1.sml 4 | end -------------------------------------------------------------------------------- /test/regexp1.mlb.out.ok: -------------------------------------------------------------------------------- 1 | Testing RegExp... 2 | test1a OK 3 | test2a OK 4 | test2b OK 5 | test3a OK 6 | test3b OK 7 | -------------------------------------------------------------------------------- /test/regexp1.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/regexp1.sml -------------------------------------------------------------------------------- /test/regexp2.mlb: -------------------------------------------------------------------------------- 1 | local $(SML_LIB)/basis/basis.mlb 2 | $(SML_LIB)/basis/kitlib.mlb 3 | in regexp2.sml 4 | end -------------------------------------------------------------------------------- /test/regexp2.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/regexp2.sml -------------------------------------------------------------------------------- /test/repl/.gitignore: -------------------------------------------------------------------------------- 1 | *.res 2 | run 3 | complog.txt -------------------------------------------------------------------------------- /test/repl/a.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | hello.sml 3 | -------------------------------------------------------------------------------- /test/repl/basis.cmd: -------------------------------------------------------------------------------- 1 | val a = Int32.maxInt 2 | val b = List.tabulate(4, fn i => i) 3 | val c = 1234567890123456789012345678901234567890 4 | val d = c * c 5 | val e = IntInf.toString d 6 | val f = SOME {x = 34, y = 34.2} 7 | val g = case f of SOME r => Real.toString (#y r) | _ => "NO"; 8 | :quit; 9 | -------------------------------------------------------------------------------- /test/repl/chdir.cmd: -------------------------------------------------------------------------------- 1 | val a = Int.toString ~23 2 | val () = OS.FileSys.chDir ".." 3 | val b = a ^ " - " ^ Real.toString 34.0 4 | -------------------------------------------------------------------------------- /test/repl/chdir.out.ok: -------------------------------------------------------------------------------- 1 | . . . . > val a = "~23" : string 2 | val b = "~23 - 34.0" : string 3 | Parse error - no input! 4 | Exiting 5 | -------------------------------------------------------------------------------- /test/repl/hello.sml: -------------------------------------------------------------------------------- 1 | structure Hello = struct 2 | val text = "hello" 3 | end 4 | -------------------------------------------------------------------------------- /test/repl/load.cmd: -------------------------------------------------------------------------------- 1 | :load a.mlb; 2 | val x = Hello.text ^ " world"; 3 | :quit; 4 | -------------------------------------------------------------------------------- /test/repl/load.out.ok: -------------------------------------------------------------------------------- 1 | . > structure Hello : 2 | sig 3 | val text : string 4 | end 5 | . > val x = "hello world" : string 6 | -------------------------------------------------------------------------------- /test/repl/simple.cmd: -------------------------------------------------------------------------------- 1 | val a = 3434; 2 | :quit; 3 | -------------------------------------------------------------------------------- /test/repl/simple.out.ok: -------------------------------------------------------------------------------- 1 | . > val a = 3434 : int 2 | -------------------------------------------------------------------------------- /test/repl/simple2.cmd: -------------------------------------------------------------------------------- 1 | infix + 2 | val a = 3434 + 23; 3 | :quit; 4 | -------------------------------------------------------------------------------- /test/repl/simple2.out.ok: -------------------------------------------------------------------------------- 1 | . . > infix 0 + 2 | val a = 3457 : int 3 | -------------------------------------------------------------------------------- /test/seltuptup.sml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fun f () : int * int * int = 4 | #1((1,2,3),4) 5 | handle X => raise X 6 | 7 | val () = print (if f() = (1,2,3) then "Ok\n" else "Wrong\n") 8 | -------------------------------------------------------------------------------- /test/seltuptup.sml.out.ok: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /test/server.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in server.sml 4 | end 5 | -------------------------------------------------------------------------------- /test/sharing.sml: -------------------------------------------------------------------------------- 1 | signature S = sig 2 | type t = int 3 | type u 4 | end 5 | 6 | functor F (structure S1 : S 7 | structure S2 : S 8 | sharing S1 = S2) = struct 9 | end 10 | -------------------------------------------------------------------------------- /test/sigs-avail.sml.out.ok: -------------------------------------------------------------------------------- 1 | All ok! 2 | -------------------------------------------------------------------------------- /test/stream.mlb: -------------------------------------------------------------------------------- 1 | $(SML_LIB)/basis/basis.mlb 2 | stream.sig 3 | stream.sml 4 | streamtest.sml 5 | -------------------------------------------------------------------------------- /test/stream.mlb.out.ok: -------------------------------------------------------------------------------- 1 | Testing stream structure (part of Pickle library)... 2 | sz(s) = 8112 3 | test1 OK 4 | sz(s) = 5900 5 | test2 OK 6 | sz(s) = 7006 7 | test3 OK 8 | sz(s) = 7006 9 | test4 OK 10 | sz(s) = 6 11 | test5 OK 12 | -------------------------------------------------------------------------------- /test/stringcvt.sml.out.ok: -------------------------------------------------------------------------------- 1 | 2 | File stringcvt.sml: Testing structure StringCvt... 3 | test1 OK 4 | test2 OK 5 | test3 OK 6 | test4 OK 7 | test5 OK 8 | test6 OK 9 | test7 OK 10 | test8 OK 11 | test9 OK 12 | test10 OK 13 | -------------------------------------------------------------------------------- /test/stringsz.sml.out.ok: -------------------------------------------------------------------------------- 1 | Trying with 1024: ok 2 | Trying with 1048576: ok 3 | Trying with 1073741824: ok 4 | Trying with 10485760: ok 5 | Trying concat (^): ok 6 | Trying with 20971520: ok 7 | -------------------------------------------------------------------------------- /test/structs-avail.sml.out.ok: -------------------------------------------------------------------------------- 1 | All ok 2 | -------------------------------------------------------------------------------- /test/tak.sml: -------------------------------------------------------------------------------- 1 | fun tak (x,y,z) = 2 | if not (y < x) 3 | then z 4 | else tak (tak (x - 1, y, z), 5 | tak (y - 1, z, x), 6 | tak (z - 1, x, y)) 7 | 8 | val rec f = 9 | fn 0 => () 10 | | n => (tak (18,12,6); f (n-1)) 11 | 12 | structure Main = 13 | struct 14 | fun doit () = f 5000 15 | end 16 | 17 | val _ = Main.doit() -------------------------------------------------------------------------------- /test/timer.sml.out.ok: -------------------------------------------------------------------------------- 1 | 2 | File timer.sml: Testing structure Timer... 3 | test1 OK 4 | test2 OK 5 | test3 OK 6 | test4 OK 7 | -------------------------------------------------------------------------------- /test/tststrcmp.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/tststrcmp.sml -------------------------------------------------------------------------------- /test/type_sharing.sml: -------------------------------------------------------------------------------- 1 | 2 | (* The following two signatures should elaborate *) 3 | 4 | signature S1 = 5 | sig 6 | type t 7 | sharing type t = t 8 | end where type t = int 9 | 10 | signature S2 = 11 | sig 12 | type t 13 | sharing type t = t 14 | sharing type t = t 15 | end 16 | -------------------------------------------------------------------------------- /test/unbox.sml: -------------------------------------------------------------------------------- 1 | (* Test to see if optimization of argument unboxing works ok *) 2 | 3 | fun do_list i = 4 | case i 5 | of 1 => (1,1) 6 | | _ => do_list 1 7 | 8 | fun doit (a:int,b:int) () = doit (do_list 1) () 9 | 10 | val _ = print "Ok\n" -------------------------------------------------------------------------------- /test/unbox.sml.out.ok: -------------------------------------------------------------------------------- 1 | Ok 2 | -------------------------------------------------------------------------------- /test/upto.sml: -------------------------------------------------------------------------------- 1 | fun upto n = 2 | let fun loop(p as (0,acc)) = p 3 | | loop(n, acc) = 4 | loop(n-1, n::acc) 5 | in 6 | #2(loop(n,[])) 7 | end 8 | 9 | -------------------------------------------------------------------------------- /test/valrecpat.sml: -------------------------------------------------------------------------------- 1 | val rec ( f ) = fn x => x 2 | 3 | val _ = print (f "OK\n") -------------------------------------------------------------------------------- /test/valrecpat.sml.out.ok: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /test/valrecpat1.sml: -------------------------------------------------------------------------------- 1 | val rec _ = fn x => x 2 | 3 | val _ = print "OK\n" -------------------------------------------------------------------------------- /test/valrecpat1.sml.out.ok: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /test/valrecpat2.sml: -------------------------------------------------------------------------------- 1 | datatype t = f; 2 | val rec f = fn x => x 3 | 4 | val _ = print (f "OK\n") -------------------------------------------------------------------------------- /test/valrecpat2.sml.out.ok: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /test/valrecpat3.sml: -------------------------------------------------------------------------------- 1 | val a = "OK\n" 2 | val a = "ERROR\n" 3 | and rec f = fn x => g x 4 | and g = fn y => (a, y) 5 | 6 | val _ = print (#1(f 23)) -------------------------------------------------------------------------------- /test/valrecpat3.sml.out.ok: -------------------------------------------------------------------------------- 1 | OK 2 | -------------------------------------------------------------------------------- /test/valrecpat4.sml: -------------------------------------------------------------------------------- 1 | val rec (f as g as _) = fn x => x 2 | 3 | val _ = print (f "it ") 4 | val _ = print (g "works\n") -------------------------------------------------------------------------------- /test/valrecpat4.sml.out.ok: -------------------------------------------------------------------------------- 1 | it works 2 | -------------------------------------------------------------------------------- /test/vector.sml.out.ok: -------------------------------------------------------------------------------- 1 | Testing Vector... 2 | test1: OK 3 | test2: OK 4 | test3: OK 5 | test4a: OK 6 | test4b: OK 7 | test4c: OK 8 | test5: OK 9 | test6a: OK 10 | test6b: OK 11 | test6c: OK 12 | test7: OK 13 | test8: OK 14 | test10a: OK 15 | test11a: OK 16 | -------------------------------------------------------------------------------- /test/vesa2.sml: -------------------------------------------------------------------------------- 1 | functor F (A : sig type a end) = 2 | struct 3 | type u = A.a 4 | type s = A.a 5 | end :> 6 | sig 7 | type s 8 | type u = A.a 9 | end 10 | 11 | functor G () = F (datatype a = S) 12 | 13 | structure R = G () 14 | -------------------------------------------------------------------------------- /test/vesa2.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/vesa2.sml.out.ok -------------------------------------------------------------------------------- /test/weeks.sml: -------------------------------------------------------------------------------- 1 | functor F(structure S: sig type 'a t end) = 2 | struct 3 | datatype t = T of u S.t 4 | withtype u = int 5 | end 6 | -------------------------------------------------------------------------------- /test/weeks.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** weeks.sml ************* 4 | 5 | -------------------------------------------------------------------------------- /test/weeks.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/weeks.sml.out.ok -------------------------------------------------------------------------------- /test/weeks2.sml: -------------------------------------------------------------------------------- 1 | 2 | datatype t = K of t (* this one should not be accepted *) 3 | withtype t = int 4 | -------------------------------------------------------------------------------- /test/weeks2.sml.log.ok: -------------------------------------------------------------------------------- 1 | 2 | 3 | ********** weeks2.sml ************* 4 | 5 | weeks2.sml, line 2, column 9: 6 | datatype t = K of t (* this one should not be accepted *) 7 | ^ 8 | type constructor t is bound by both datatype binding and withtype binding 9 | -------------------------------------------------------------------------------- /test/weeks3.sml: -------------------------------------------------------------------------------- 1 | structure S = 2 | struct 3 | datatype 'a t = T of 'a u 4 | and 'a u = U 5 | end 6 | 7 | functor F() = S 8 | 9 | structure K = F() 10 | 11 | val a = K.U = K.U -------------------------------------------------------------------------------- /test/weeks5.sml: -------------------------------------------------------------------------------- 1 | val s = Array.sub and u = Array.update 2 | 3 | fun s2 x = s x 4 | 5 | (* or: 6 | fun f x = x 7 | fun g x = x 8 | val a = f and b = g 9 | 10 | fun h x = a x 11 | *) -------------------------------------------------------------------------------- /test/weeks5.sml.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test/weeks5.sml.out.ok -------------------------------------------------------------------------------- /test/with-escape.sml.out.ok: -------------------------------------------------------------------------------- 1 | hello 2 | -------------------------------------------------------------------------------- /test_dev/.gitignore: -------------------------------------------------------------------------------- 1 | *.exe 2 | *.out 3 | *.res 4 | MLB 5 | *.mlbres 6 | *.mlbexe 7 | *.mlbout 8 | complog.txt -------------------------------------------------------------------------------- /test_dev/Initial.out.ok: -------------------------------------------------------------------------------- 1 | Starting 2 | Time 3 | Timer 4 | Real 5 | Math 6 | TextIO 7 | Posix 8 | - get 9 | - getTi 10 | - getT 11 | - getT 12 | - getT 13 | - getT 14 | - getN 15 | - getNS 16 | Done 17 | -------------------------------------------------------------------------------- /test_dev/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test_dev/README -------------------------------------------------------------------------------- /test_dev/README_KAM.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test_dev/README_KAM.md -------------------------------------------------------------------------------- /test_dev/a.mlb: -------------------------------------------------------------------------------- 1 | a1.sml 2 | a2.sml 3 | -------------------------------------------------------------------------------- /test_dev/a.mlbout.ok: -------------------------------------------------------------------------------- 1 | Hello world 2 | This is also a string 3 | -------------------------------------------------------------------------------- /test_dev/a1.out.ok: -------------------------------------------------------------------------------- 1 | Hello -------------------------------------------------------------------------------- /test_dev/a1.sml: -------------------------------------------------------------------------------- 1 | fun print (s:string) : unit = prim("printStringML", s) 2 | local 3 | val _ = print "Hello " 4 | in 5 | 6 | end 7 | -------------------------------------------------------------------------------- /test_dev/a2.sml: -------------------------------------------------------------------------------- 1 | local 2 | val _ = print "world\n" 3 | val a = "This is also a string\n" 4 | val _ = print a 5 | in 6 | 7 | end 8 | -------------------------------------------------------------------------------- /test_dev/app1.sml: -------------------------------------------------------------------------------- 1 | infix :: + 2 | 3 | fun print (s:string) : unit = prim("printStringML", "printStringML", s) 4 | 5 | fun app f x = f x 6 | -------------------------------------------------------------------------------- /test_dev/app2.sml: -------------------------------------------------------------------------------- 1 | 2 | (* 3 | val _ = print "***Hello***\n" 4 | val _ = myprint "***MyHello***\n" 5 | *) 6 | 7 | val _ = app print "\n***Abe***\n" 8 | 9 | (* 10 | val _ = print "\n***End***\n" 11 | *) -------------------------------------------------------------------------------- /test_dev/auto.out.ok: -------------------------------------------------------------------------------- 1 | Num: 42 2 | Num: 42 3 | ok: i64 4 | Num: 42 5 | ok: i32 6 | ok: i64 7 | ok: i64(2) 8 | ok: i32 res 9 | ok: i32 res2 10 | hello 11 | ok: chararray 12 | -------------------------------------------------------------------------------- /test_dev/b.mlb: -------------------------------------------------------------------------------- 1 | b1.sml 2 | b2.sml 3 | -------------------------------------------------------------------------------- /test_dev/b.mlbout.ok: -------------------------------------------------------------------------------- 1 | Hi 2 | HelloHej Med dig -------------------------------------------------------------------------------- /test_dev/b1.sml: -------------------------------------------------------------------------------- 1 | val a = "Hello" 2 | val b = ("Hej", "Med dig") -------------------------------------------------------------------------------- /test_dev/b2.sml: -------------------------------------------------------------------------------- 1 | 2 | local 3 | fun print (s:string) : unit = prim("printStringML", s) 4 | val () = print "Hi\n" 5 | val () = print a 6 | val () = (print (#1 b); print " "; print (#2 b)) 7 | in 8 | 9 | end 10 | -------------------------------------------------------------------------------- /test_dev/b3.out.ok: -------------------------------------------------------------------------------- 1 | Hej Med dig -------------------------------------------------------------------------------- /test_dev/b3.sml: -------------------------------------------------------------------------------- 1 | local 2 | val b = ("Hej", "Med dig") 3 | fun print (s:string) : unit = prim("printStringML", s) 4 | in 5 | val () = print (#1 b) 6 | val () = print " " 7 | val () = print (#2 b) 8 | end 9 | -------------------------------------------------------------------------------- /test_dev/build.out.ok: -------------------------------------------------------------------------------- 1 | Hi there 2 | Num: 1010 3 | Num: 1009 4 | Num: 1008 5 | Num: 1007 6 | Num: 1006 7 | Num: 1005 8 | Num: 1004 9 | Num: 1003 10 | Num: 1002 11 | Num: 1001 12 | Num: 1000 13 | -------------------------------------------------------------------------------- /test_dev/c.mlb: -------------------------------------------------------------------------------- 1 | c1.sml 2 | c2.sml 3 | -------------------------------------------------------------------------------- /test_dev/c.mlbout.ok: -------------------------------------------------------------------------------- 1 | Hello world -------------------------------------------------------------------------------- /test_dev/c1.sml: -------------------------------------------------------------------------------- 1 | val a = "Hello " 2 | -------------------------------------------------------------------------------- /test_dev/ccall.out.ok: -------------------------------------------------------------------------------- 1 | Num: 1096 2 | -------------------------------------------------------------------------------- /test_dev/ceil.sml: -------------------------------------------------------------------------------- 1 | 2 | 3 | fun ceil (x : real) : int = prim ("ceilFloat", "ceilFloat", x) (* may raise Overflow *) 4 | 5 | val _ = ceil 1E32 handle Overflow => 43 6 | 7 | val _ = raise Match 8 | -------------------------------------------------------------------------------- /test_dev/div.sml: -------------------------------------------------------------------------------- 1 | infix div 2 | fun printNum (i:int) : unit = prim("printNum", "printNum", i) 3 | 4 | val a = 5232 div 3 5 | 6 | val _ = printNum a 7 | -------------------------------------------------------------------------------- /test_dev/div0.sml: -------------------------------------------------------------------------------- 1 | infix div 2 | fun printNum (i:int) : unit = prim("printNum", "printNum", i) 3 | 4 | val a = 5232 div 0 5 | 6 | val _ = printNum a 7 | -------------------------------------------------------------------------------- /test_dev/empty.sml: -------------------------------------------------------------------------------- 1 | (* the empty program *) 2 | -------------------------------------------------------------------------------- /test_dev/empty_loop.sml: -------------------------------------------------------------------------------- 1 | fun go() = go() 2 | 3 | val _ = go() 4 | -------------------------------------------------------------------------------- /test_dev/eqdat.sml: -------------------------------------------------------------------------------- 1 | fun print (s:string) : unit = prim("printStringML", "printStringML", s) 2 | 3 | val _ = 4 | let 5 | val _ = print "Start...\n" 6 | datatype k = A of int * string 7 | 8 | val k1 = A(5,"hej") 9 | 10 | in 11 | case k1 of 12 | A(i,s) => (print s) ; 13 | print "End\n" 14 | end 15 | -------------------------------------------------------------------------------- /test_dev/er1_err.sml: -------------------------------------------------------------------------------- 1 | 2 | val region = (4,3) 3 | -------------------------------------------------------------------------------- /test_dev/exception1.out.ok: -------------------------------------------------------------------------------- 1 | E raised, ok 2 | -------------------------------------------------------------------------------- /test_dev/exception3.out.ok: -------------------------------------------------------------------------------- 1 | OK-Something else... 2 | -------------------------------------------------------------------------------- /test_dev/exception4.out.ok: -------------------------------------------------------------------------------- 1 | Ok - In handle BIND0 2 | Ok - In handle BIND1 3 | Ok, - no error... 4 | OK - In handle MATCH0 5 | Ok, - Match no error... 6 | OK if uncaught exception Match 7 | -------------------------------------------------------------------------------- /test_dev/exception5.out.ok: -------------------------------------------------------------------------------- 1 | Num: 1 2 | hej 3 | Testing generative exceptions: 4 | Enter f with x=Num: 1 5 | 6 | Enter f with x=Num: 0 7 | 8 | In handle _ 9 | Ok - exn - generative... 10 | -------------------------------------------------------------------------------- /test_dev/exception6.sml: -------------------------------------------------------------------------------- 1 | 2 | local 3 | in (* end of prelude *) 4 | val _ = raise Match 5 | end -------------------------------------------------------------------------------- /test_dev/exn1.out.ok: -------------------------------------------------------------------------------- 1 | uncaught exception E 2 | -------------------------------------------------------------------------------- /test_dev/exn1.sml: -------------------------------------------------------------------------------- 1 | exception E 2 | 3 | val a : int = raise E -------------------------------------------------------------------------------- /test_dev/exn2.out.ok: -------------------------------------------------------------------------------- 1 | **9** -------------------------------------------------------------------------------- /test_dev/exn2.sml: -------------------------------------------------------------------------------- 1 | exception E 2 | 3 | fun print (s:string) : unit = prim("printStringML", s) 4 | 5 | val a : string = ("**5**"; raise E) handle _ => "**9**" 6 | 7 | val _ = print a 8 | -------------------------------------------------------------------------------- /test_dev/exn3.out.ok: -------------------------------------------------------------------------------- 1 | **ok** -------------------------------------------------------------------------------- /test_dev/exn4.out.ok: -------------------------------------------------------------------------------- 1 | Div 2 | Match 3 | Bind 4 | Overflow 5 | ThisIsAnException 6 | ***Success*** 7 | -------------------------------------------------------------------------------- /test_dev/exn5.sml: -------------------------------------------------------------------------------- 1 | 2 | local 3 | val a = 5 4 | 5 | val _ = ceil 1E23 handle _ => 34 6 | 7 | fun f b = a + b 8 | in 9 | val _ = print (Int.toString (f 8)) 10 | end -------------------------------------------------------------------------------- /test_dev/explode.sml: -------------------------------------------------------------------------------- 1 | infix < 2 | 3 | fun print (s:string) : unit = prim("printStringML", "printStringML", s) 4 | val _ = if ~1 < 0 then print "OK" 5 | else print "ERROR" 6 | -------------------------------------------------------------------------------- /test_dev/expr.out.ok: -------------------------------------------------------------------------------- 1 | Num: 38.20 2 | -------------------------------------------------------------------------------- /test_dev/f1.out.ok: -------------------------------------------------------------------------------- 1 | Num: 10 2 | Num: 9 3 | Num: 8 4 | Num: 7 5 | Num: 6 6 | Num: 5 7 | Num: 4 8 | Num: 3 9 | Num: 2 10 | Num: 1 11 | Num: 42 12 | -------------------------------------------------------------------------------- /test_dev/f1.sml: -------------------------------------------------------------------------------- 1 | let 2 | infix - 3 | infix 3 := o 4 | fun !(x: 'a ref): 'a = prim ("!", x) 5 | fun print (s:string) : unit = prim("printStringML", s) 6 | 7 | fun printNum (i:int) : unit = prim("printNum", i) 8 | val r = ref 42 9 | val free = !r 10 | fun f 0 = printNum free 11 | | f n = (printNum n;f (n-1)) 12 | in 13 | f 10 14 | end 15 | -------------------------------------------------------------------------------- /test_dev/f2.out.ok: -------------------------------------------------------------------------------- 1 | Num: -1 2 | Num: 0 3 | Num: 1 4 | -------------------------------------------------------------------------------- /test_dev/f64_1.out.ok: -------------------------------------------------------------------------------- 1 | Num: 7.00 2 | -------------------------------------------------------------------------------- /test_dev/f64_1.sml: -------------------------------------------------------------------------------- 1 | infix 7 * / div mod 2 | infix 6 + - 3 | infix 4 = <> > >= < <= 4 | 5 | fun f (a,b,c:real) = a * b - c 6 | 7 | fun printReal (n:real):unit = prim("printReal",n) 8 | 9 | val () = printReal (f(5.0,2.0,3.0)) (* 7.00 *) 10 | -------------------------------------------------------------------------------- /test_dev/f64_2.out.ok: -------------------------------------------------------------------------------- 1 | Num: 135.00 2 | -------------------------------------------------------------------------------- /test_dev/f64_2.sml: -------------------------------------------------------------------------------- 1 | infix 7 * / div mod 2 | infix 6 + - 3 | infix 4 = <> > >= < <= 4 | 5 | fun f (a,b,c:real,d,e,f,g,h,i,j,k,l) = a * b - c + d*e+f*g+i*j+k*l 6 | 7 | fun printReal (n:real):unit = prim("printReal",n) 8 | 9 | val () = printReal (f(5.0,2.0,3.0, 1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0)) 10 | -------------------------------------------------------------------------------- /test_dev/f64_3.out.ok: -------------------------------------------------------------------------------- 1 | Num: 70.00 2 | -------------------------------------------------------------------------------- /test_dev/f64_4.out.ok: -------------------------------------------------------------------------------- 1 | Num: 39.00 2 | -------------------------------------------------------------------------------- /test_dev/f64_simple.sml: -------------------------------------------------------------------------------- 1 | infix 7 * / div mod 2 | infix 6 + - 3 | infix 4 = <> > >= < <= 4 | 5 | val a = (1.0,2.0,3.0) 6 | val b = (4.0,5.0,6.0) 7 | 8 | fun f () = 9 | #1(a) * #2(a) + #3(b) * #3(a) + #1(b) - #2(b) 10 | (* 1 * 2 + 6 * 3 + 4 - 5 = 19 *) 11 | 12 | fun printReal (n:real):unit = prim("printReal",n) 13 | val () = printReal (f()) 14 | -------------------------------------------------------------------------------- /test_dev/f64_simple1.sml: -------------------------------------------------------------------------------- 1 | infix 7 * / div mod 2 | infix 6 + - 3 | infix 4 = <> > >= < <= 4 | 5 | val a = (1.0,2.0,3.0) 6 | val b = (4.0,5.0,6.0) 7 | 8 | fun f () = 9 | #1(a) - #2(b) 10 | (* 1 - 5 = -4 *) 11 | 12 | fun printReal (n:real):unit = prim("printReal",n) 13 | val () = printReal (f()) 14 | -------------------------------------------------------------------------------- /test_dev/f64_simple2.sml: -------------------------------------------------------------------------------- 1 | infix 7 * / div mod 2 | infix 6 + - 3 | infix 4 = <> > >= < <= 4 | 5 | fun f () = 2.2 + 1.1 6 | 7 | fun printReal (n:real):unit = prim("printReal",n) 8 | val () = printReal (f()) 9 | -------------------------------------------------------------------------------- /test_dev/fft_no_basislib.out.ok: -------------------------------------------------------------------------------- 1 | Fft'ing... 2 | Num: 65536.00 3 | Num: -25785591.33 4 | Done 5 | -------------------------------------------------------------------------------- /test_dev/fib0.out.ok: -------------------------------------------------------------------------------- 1 | Num: 1346269 2 | -------------------------------------------------------------------------------- /test_dev/fib0.sml: -------------------------------------------------------------------------------- 1 | infix - + 2 | 3 | fun printNum (i:int) : unit = prim("printNum", i) 4 | 5 | fun fib 0 = 1 6 | | fib 1 = 1 7 | | fib n = fib(n-1) + fib(n-2) 8 | 9 | val _ = printNum(fib 30) (* 1346269 *) 10 | -------------------------------------------------------------------------------- /test_dev/floor.sml: -------------------------------------------------------------------------------- 1 | fun print (s:string) : unit = prim("printStringML", "printStringML", s) 2 | 3 | fun getCtx () : foreignptr = prim("__get_ctx",()) 4 | fun floor (x : real) : int = prim ("floorFloat", "floorFloat", (getCtx(),x)) (* may raise Overflow *) 5 | val _ = floor (23.0E23) handle Overflow => 4 6 | val _ = print "End\n"; 7 | -------------------------------------------------------------------------------- /test_dev/foldl.out.ok: -------------------------------------------------------------------------------- 1 | Before fold 2 | Efter fold 3 | Num: 55 4 | Num: 55 5 | hej 6 | -------------------------------------------------------------------------------- /test_dev/global_region.out.ok: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/melsman/mlkit/1733d3d90fc3ebd6157e1c34bcd68de51ab0d722/test_dev/global_region.out.ok -------------------------------------------------------------------------------- /test_dev/global_region.sml: -------------------------------------------------------------------------------- 1 | 2 | val p = (1,2) 3 | fun f (a,b,c,d,e,f,g,h,i,j) = if true then p else (2,3) 4 | val k = f(0,1,2,3,4,5,6,7,8,9) -------------------------------------------------------------------------------- /test_dev/hello.out.ok: -------------------------------------------------------------------------------- 1 | It works! 2 | -------------------------------------------------------------------------------- /test_dev/if.out.ok: -------------------------------------------------------------------------------- 1 | It works! -------------------------------------------------------------------------------- /test_dev/if.sml: -------------------------------------------------------------------------------- 1 | 2 | let 3 | infix <= 4 | infix < 5 | infix > 6 | infix >= 7 | fun print (s:string) : unit = prim("printStringML", s) 8 | in 9 | if 3<=3 andalso 2<4 andalso 2>1 andalso 4>=4 then 10 | print "It works!" 11 | else 12 | print "It does not work" 13 | end 14 | -------------------------------------------------------------------------------- /test_dev/if2.sml: -------------------------------------------------------------------------------- 1 | 2 | let 3 | infix <= 4 | infix < 5 | infix > 6 | infix >= 7 | fun print (s:string) : unit = prim("printStringML", "printStringML", s) 8 | in 9 | if 3<4 then 10 | print "It works!" 11 | else 12 | print "It does not work" 13 | end 14 | -------------------------------------------------------------------------------- /test_dev/immedString.out.ok: -------------------------------------------------------------------------------- 1 | It works -------------------------------------------------------------------------------- /test_dev/int_first.out.ok: -------------------------------------------------------------------------------- 1 | Hi there 2 | Hello there 3 | Div it is! 4 | -------------------------------------------------------------------------------- /test_dev/int_overflow.out.ok: -------------------------------------------------------------------------------- 1 | OK (+) 2 | OK (-) 3 | OK (*) 4 | OK (*) 5 | OK (~) 6 | -------------------------------------------------------------------------------- /test_dev/interrupt.sml: -------------------------------------------------------------------------------- 1 | val n = ref 0 2 | fun loop () = 3 | (n := ((!n + 1) handle Overflow => 0); 4 | loop ()) 5 | 6 | fun f () = (loop () 7 | handle Interrupt => (print (Int.toString (!n) ^ "\n"); f ())) 8 | 9 | val _ = f () 10 | -------------------------------------------------------------------------------- /test_dev/jt.out.ok: -------------------------------------------------------------------------------- 1 | Num: 5 2 | Num: 8 3 | -------------------------------------------------------------------------------- /test_dev/kit.script: -------------------------------------------------------------------------------- 1 | (* 2 | val optimiser : bool = false 3 | *) 4 | (* 5 | val print_physical_size_inference_expression : bool = true 6 | *) 7 | val print_call_explicit_expression : bool = true -------------------------------------------------------------------------------- /test_dev/kitqsort_no_basislib.out.ok: -------------------------------------------------------------------------------- 1 | Ok! 2 | -------------------------------------------------------------------------------- /test_dev/kitreynolds2_no_basislib.out.ok: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /test_dev/kitreynolds3_no_basislib.out.ok: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /test_dev/kittmergesort_no_basislib.out.ok: -------------------------------------------------------------------------------- 1 | 2 | List generated 3 | Doing tmergesort... 4 | Sorted 25000 5 | numbers 6 | 7 | -------------------------------------------------------------------------------- /test_dev/l1.out.ok: -------------------------------------------------------------------------------- 1 | It works n gives lhej igenHej -------------------------------------------------------------------------------- /test_dev/list_nh.out.ok: -------------------------------------------------------------------------------- 1 | Num: 1 2 | ::Num: 2 3 | ::Num: 3 4 | ::Num: 4 5 | ::Num: 5 6 | ::[] 7 | str1::str2::str3::str4::str5::[] 8 | Num: 1 9 | ::Num: 2 10 | ::Num: 3 11 | ::Num: 4 12 | ::Num: 5 13 | ::[] 14 | intOK5 15 | strOK5 16 | datatypeOKniels 17 | Martin Elsman datatypeOKmartin 18 | noname OK 19 | true OK 20 | false OK 21 | -------------------------------------------------------------------------------- /test_dev/many_args.sml: -------------------------------------------------------------------------------- 1 | infix 6 + 2 | 3 | fun f x = x+x 4 | fun add (x1,x2,x3,x4,x5) = (f x1+x4,f x4+x3,#2(add(f x5+x2,x1,x4,x2,x4)),f x1+x3,f x3+x5+(#3(add(x1,x2,x4,x3,x5)))) 5 | 6 | val _ = #3(add(1,2,3,4,5)) -------------------------------------------------------------------------------- /test_dev/p1.sml: -------------------------------------------------------------------------------- 1 | val () = 2 | let 3 | (* infix - 4 | infix 3 := o 5 | 6 | fun printNum (i:int) : unit = prim("printNum", "printNum", i) 7 | fun f 0 = printNum free 8 | | f n = (printNum n;f (n-1)) 9 | *) 10 | fun print (s:string) : unit = prim("printStringML", s) 11 | in 12 | print "Hello\n" 13 | end 14 | -------------------------------------------------------------------------------- /test_dev/r.c: -------------------------------------------------------------------------------- 1 | #include