├── .smackspec ├── ca └── terpstra │ ├── math │ ├── README │ ├── algebra.fun │ ├── algebra.sig │ ├── c.fun │ ├── c.sml │ ├── factor.fun │ ├── factor.sml │ ├── galois.fun │ ├── galois.sml │ ├── gcd.fun │ ├── groups.fun │ ├── groups.sig │ ├── log.fun │ ├── math.mlb │ ├── mersenne.fun │ ├── mersenne.sml │ ├── ops.sig │ ├── ops.sml │ ├── order.sml │ ├── permutation.sml │ ├── polynomial.fun │ ├── q.fun │ ├── q.sml │ ├── r.fun │ ├── r.sml │ ├── rings.fun │ ├── rings.sig │ ├── test │ │ ├── test.mlb │ │ ├── test.sml │ │ ├── test2.sml │ │ ├── test3.mlb │ │ ├── test3.sml │ │ ├── test4.mlb │ │ └── test4.sml │ ├── z.fun │ └── z.sml │ ├── pickle │ ├── Makefile │ ├── README │ ├── ast.sml │ ├── export.sml │ ├── gen.sml │ ├── import.sml │ ├── lib │ │ ├── binary.sml │ │ ├── pickle.mlb │ │ ├── pickle.sig │ │ ├── pickle.sml │ │ └── text.sml │ ├── main.sml │ ├── method.sml │ ├── pickle.mlb │ ├── tag.sml │ ├── tests │ │ ├── Makefile │ │ ├── double.test │ │ ├── rebind.test │ │ ├── recursive.test │ │ ├── scope.test │ │ └── tree.test │ ├── tml.grm │ ├── tml.lex │ ├── tree.sml │ └── type.sml │ ├── regexp │ ├── README │ ├── automata.fun │ ├── automata.mlb │ ├── automata.sig │ ├── btree.sml │ ├── compare.dot │ ├── compare.mlb │ ├── compare.sml │ ├── todot.mlb │ ├── todot.sml │ └── ztree.sml │ ├── sqlite3-sml │ ├── README │ ├── buffer.sig │ ├── buffer.sml │ ├── debug.sml │ ├── demo.mlb │ ├── demo.sml │ ├── fold.sig │ ├── fold.sml │ ├── function.sml │ ├── pair.sml │ ├── pointers.sml │ ├── prim.sig │ ├── prim.sml │ ├── query.sml │ ├── ring.sig │ ├── ring.sml │ ├── sql.sig │ ├── sql.sml │ └── sqlite.mlb │ └── st │ ├── Makefile │ ├── README │ ├── data.sig │ ├── data.sml │ ├── edge.fun │ ├── epoll.h │ ├── epoll.sig │ ├── epoll.sml │ ├── ioevent.sig │ ├── ioevent.sml │ ├── kevent.h │ ├── kqueue.sml │ ├── level.fun │ ├── lpoll.sig │ ├── open.sml │ ├── scheduler.sig │ ├── socket.sml │ ├── st.mlb │ ├── state.sig │ ├── state.sml │ ├── test.mlb │ ├── test.sml │ ├── thread.sig │ ├── thread.sml │ ├── timeout.sig │ └── timeout.sml ├── com ├── entain │ └── javascript │ │ └── unstable │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README │ │ ├── control.fun │ │ ├── control.sig │ │ ├── javascript.fun │ │ ├── javascript.grm │ │ ├── javascript.lex │ │ ├── javascript.mlb │ │ ├── javascript.sig │ │ ├── javascript.sml │ │ ├── join-lattice.fun │ │ ├── join-lattice.sig │ │ ├── lex-internals.sig │ │ ├── lex.fun │ │ ├── lex.sig │ │ ├── lib.mlb │ │ ├── main.sig │ │ ├── main.sml │ │ ├── mjs.mlb │ │ ├── mlb-path-map │ │ ├── parse.fun │ │ ├── parse.sig │ │ ├── regexp.fun │ │ ├── regexp.sig │ │ ├── region.fun │ │ ├── region.sig │ │ ├── source-pos.fun │ │ ├── source-pos.sig │ │ ├── source.fun │ │ ├── source.sig │ │ ├── stream.sig │ │ ├── stream.sml │ │ ├── token.fun │ │ ├── token.sig │ │ ├── top-down-parser.fun │ │ ├── top-down-parser.mlb │ │ ├── top-down-parser.sig │ │ ├── top-down-parser.sml │ │ ├── two-point-lattice.fun │ │ ├── two-point-lattice.sig │ │ └── util.sml ├── ssh │ ├── all-unstable.cm │ ├── async │ │ └── unstable │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── Test.sh │ │ │ ├── detail │ │ │ ├── async.sml │ │ │ └── ml │ │ │ │ └── smlnj │ │ │ │ └── unsealed.cm │ │ │ ├── example │ │ │ ├── actor │ │ │ │ ├── actor.sml │ │ │ │ ├── counter-example.mlb │ │ │ │ ├── counter-example.sml │ │ │ │ └── counter.sml │ │ │ ├── poll-loop │ │ │ │ ├── lib.mlb │ │ │ │ ├── lib.use │ │ │ │ └── poll-loop.sml │ │ │ └── smlbot │ │ │ │ ├── Build.bgb │ │ │ │ ├── Makefile │ │ │ │ ├── allowed-modules │ │ │ │ ├── main.sml │ │ │ │ ├── make-sandbox-prefix.sh │ │ │ │ ├── run-sandboxed-sml.sh │ │ │ │ ├── show-bindings.sml │ │ │ │ ├── smlbot.mlb │ │ │ │ ├── smlbot.sml │ │ │ │ ├── smlbot.use │ │ │ │ ├── text-io.sml │ │ │ │ └── text-prim-io.sml │ │ │ ├── lib.cm │ │ │ ├── lib.mlb │ │ │ ├── lib.use │ │ │ ├── public │ │ │ ├── async.sig │ │ │ └── export.sml │ │ │ ├── test.mlb │ │ │ ├── test.use │ │ │ └── test │ │ │ ├── app │ │ │ ├── generic.mlb │ │ │ └── generic.use │ │ │ └── async.sml │ ├── extended-basis │ │ └── unstable │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── basis.cm │ │ │ ├── basis.mlb │ │ │ ├── basis.use │ │ │ ├── detail │ │ │ ├── basic.sml │ │ │ ├── bootstrap.sml │ │ │ ├── concept │ │ │ │ ├── mk-bounded.fun │ │ │ │ ├── mk-cstringable.fun │ │ │ │ ├── mk-equality.fun │ │ │ │ ├── mk-monad.fun │ │ │ │ ├── mk-ordered.fun │ │ │ │ ├── mk-scannable.fun │ │ │ │ ├── mk-stringable.fun │ │ │ │ └── mk-word-flags.fun │ │ │ ├── control │ │ │ │ ├── exit.sml │ │ │ │ ├── exn.sml │ │ │ │ ├── iter.sml │ │ │ │ └── with.sml │ │ │ ├── data │ │ │ │ ├── bool.sml │ │ │ │ ├── option.sml │ │ │ │ ├── order.sml │ │ │ │ ├── pair.sml │ │ │ │ ├── product.sml │ │ │ │ ├── ref.sml │ │ │ │ ├── sq.sml │ │ │ │ ├── sum.sml │ │ │ │ ├── univ-exn.sml │ │ │ │ └── univ-ref.sml │ │ │ ├── debug │ │ │ │ └── contract.sml │ │ │ ├── fn │ │ │ │ ├── bin-fn.sml │ │ │ │ ├── bin-op.sml │ │ │ │ ├── bin-pr.sml │ │ │ │ ├── cmp.sml │ │ │ │ ├── cps.sml │ │ │ │ ├── effect.sml │ │ │ │ ├── fn.sml │ │ │ │ ├── thunk.sml │ │ │ │ ├── un-op.sml │ │ │ │ └── un-pr.sml │ │ │ ├── fold │ │ │ │ ├── fold.sml │ │ │ │ └── fru.sml │ │ │ ├── generic │ │ │ │ ├── emb.sml │ │ │ │ ├── fix.sml │ │ │ │ ├── iso.sml │ │ │ │ └── tie.sml │ │ │ ├── io │ │ │ │ ├── ios-monad.sml │ │ │ │ ├── reader.sml │ │ │ │ ├── text-io.sml │ │ │ │ └── writer.sml │ │ │ ├── lazy │ │ │ │ └── lazy.sml │ │ │ ├── ml │ │ │ │ ├── common │ │ │ │ │ ├── basis.sml │ │ │ │ │ ├── ext.sml │ │ │ │ │ ├── mono-seqs.sml │ │ │ │ │ └── scalars.sml │ │ │ │ ├── mlkit │ │ │ │ │ ├── basis.sml │ │ │ │ │ ├── extensions.mlb │ │ │ │ │ ├── ints.sml │ │ │ │ │ ├── mono-array-slices.sml │ │ │ │ │ ├── mono-arrays.sml │ │ │ │ │ ├── mono-vector-slices.sml │ │ │ │ │ ├── mono-vectors.sml │ │ │ │ │ ├── pervasive.mlb │ │ │ │ │ ├── reals.sml │ │ │ │ │ ├── texts.sml │ │ │ │ │ ├── univ.sml │ │ │ │ │ ├── words.sml │ │ │ │ │ ├── workarounds.mlb │ │ │ │ │ └── workarounds │ │ │ │ │ │ ├── ieee-real.sig │ │ │ │ │ │ ├── ieee-real.sml │ │ │ │ │ │ ├── mk-real-sane.fun │ │ │ │ │ │ ├── real.sig │ │ │ │ │ │ ├── reals.sml │ │ │ │ │ │ ├── string.sig │ │ │ │ │ │ ├── text.sig │ │ │ │ │ │ └── text.sml │ │ │ │ ├── mlton │ │ │ │ │ ├── basis.sml │ │ │ │ │ ├── ext.sml │ │ │ │ │ ├── extensions.mlb │ │ │ │ │ ├── ints.sml │ │ │ │ │ ├── mono-array-slices.sml │ │ │ │ │ ├── mono-arrays.sml │ │ │ │ │ ├── mono-vector-slices.sml │ │ │ │ │ ├── mono-vectors.sml │ │ │ │ │ ├── pervasive.mlb │ │ │ │ │ ├── reals.sml │ │ │ │ │ ├── texts.sml │ │ │ │ │ ├── univ.sml │ │ │ │ │ ├── words.sml │ │ │ │ │ └── workarounds.mlb │ │ │ │ ├── polyml │ │ │ │ │ ├── basis.sml │ │ │ │ │ ├── extensions.use │ │ │ │ │ ├── ints.sml │ │ │ │ │ ├── mono-array-slices.sml │ │ │ │ │ ├── mono-arrays.sml │ │ │ │ │ ├── mono-vector-slices.sml │ │ │ │ │ ├── mono-vectors.sml │ │ │ │ │ ├── reals.sml │ │ │ │ │ ├── texts.sml │ │ │ │ │ ├── univ.sml │ │ │ │ │ ├── words.sml │ │ │ │ │ └── workarounds.use │ │ │ │ └── smlnj │ │ │ │ │ ├── basis-minus-extensions.cm │ │ │ │ │ ├── basis-rebound.cm │ │ │ │ │ ├── basis.sml │ │ │ │ │ ├── bootstrap.cm │ │ │ │ │ ├── ext.sml │ │ │ │ │ ├── extensions.use │ │ │ │ │ ├── ints.sml │ │ │ │ │ ├── mono-array-slices.sml │ │ │ │ │ ├── mono-arrays.sml │ │ │ │ │ ├── mono-vector-slices.sml │ │ │ │ │ ├── mono-vectors.sml │ │ │ │ │ ├── reals.sml │ │ │ │ │ ├── sigs.cm │ │ │ │ │ ├── texts.sml │ │ │ │ │ ├── univ.sml │ │ │ │ │ ├── unsealed.cm │ │ │ │ │ ├── words.sml │ │ │ │ │ ├── workarounds.use │ │ │ │ │ └── workarounds │ │ │ │ │ ├── basis-minus-sane.cm │ │ │ │ │ ├── basis.cm │ │ │ │ │ ├── char.sig │ │ │ │ │ ├── funs.cm │ │ │ │ │ ├── mk-real-sane.fun │ │ │ │ │ ├── real.sig │ │ │ │ │ ├── reals.sml │ │ │ │ │ ├── sane.cm │ │ │ │ │ ├── string.sig │ │ │ │ │ ├── text.sig │ │ │ │ │ └── text.sml │ │ │ ├── numeric │ │ │ │ ├── mk-int-inf-ext.fun │ │ │ │ ├── mk-integer-ext.fun │ │ │ │ ├── mk-real-ext.fun │ │ │ │ └── mk-word-ext.fun │ │ │ ├── os │ │ │ │ └── os.sml │ │ │ ├── sequence │ │ │ │ ├── array-slice.sml │ │ │ │ ├── array.sml │ │ │ │ ├── buffer.sml │ │ │ │ ├── list.sml │ │ │ │ ├── mk-buffer-common.fun │ │ │ │ ├── mk-mono-array-ext.fun │ │ │ │ ├── mk-mono-array-slice-ext.fun │ │ │ │ ├── mk-mono-seq-common-ext.fun │ │ │ │ ├── mk-mono-vector-ext.fun │ │ │ │ ├── mk-mono-vector-slice-ext.fun │ │ │ │ ├── mk-seq-common-ext.fun │ │ │ │ ├── resizable-array.sml │ │ │ │ ├── stream.sml │ │ │ │ ├── vector-slice.sml │ │ │ │ └── vector.sml │ │ │ ├── text │ │ │ │ ├── cvt.sml │ │ │ │ └── mk-text-ext.fun │ │ │ ├── time │ │ │ │ └── time.sml │ │ │ └── typing │ │ │ │ ├── phantom.sml │ │ │ │ └── static-sum.sml │ │ │ ├── example │ │ │ └── iter │ │ │ │ ├── countdown.mlb │ │ │ │ ├── countdown.sml │ │ │ │ ├── eratosthenes.mlb │ │ │ │ ├── eratosthenes.sml │ │ │ │ ├── mean.mlb │ │ │ │ ├── mean.sml │ │ │ │ ├── number.mlb │ │ │ │ ├── number.sml │ │ │ │ ├── pancakes.mlb │ │ │ │ ├── pancakes.sml │ │ │ │ ├── pythagoras.mlb │ │ │ │ └── pythagoras.sml │ │ │ ├── extensions.cm │ │ │ ├── extensions.mlb │ │ │ ├── extensions.use │ │ │ └── public │ │ │ ├── basic.sig │ │ │ ├── concept │ │ │ ├── bitwise.sig │ │ │ ├── bounded.sig │ │ │ ├── cased.sig │ │ │ ├── cstringable.sig │ │ │ ├── empty.sig │ │ │ ├── equality.sig │ │ │ ├── etaexp.sig │ │ │ ├── flags.sig │ │ │ ├── formattable.sig │ │ │ ├── func.sig │ │ │ ├── intable.sig │ │ │ ├── largeable.sig │ │ │ ├── monad.sig │ │ │ ├── ordered.sig │ │ │ ├── scannable.sig │ │ │ ├── shiftable.sig │ │ │ ├── signed.sig │ │ │ ├── stringable.sig │ │ │ ├── t.sig │ │ │ └── wordable.sig │ │ │ ├── control │ │ │ ├── exit.sig │ │ │ ├── exn.sig │ │ │ ├── iter.sig │ │ │ └── with.sig │ │ │ ├── data │ │ │ ├── bool.sig │ │ │ ├── id.sig │ │ │ ├── option.sig │ │ │ ├── order.sig │ │ │ ├── pair.sig │ │ │ ├── product-type.sig │ │ │ ├── product.sig │ │ │ ├── ref.sig │ │ │ ├── sq.sig │ │ │ ├── sum.sig │ │ │ ├── unit.sig │ │ │ └── univ.sig │ │ │ ├── debug │ │ │ └── contract.sig │ │ │ ├── export │ │ │ ├── common.sml │ │ │ ├── infixes.sml │ │ │ ├── mlkit.sml │ │ │ ├── mlton.sml │ │ │ ├── open-top-level.sml │ │ │ ├── polyml.sml │ │ │ ├── smlnj.sml │ │ │ └── top-level.sml │ │ │ ├── fn │ │ │ ├── bin-fn.sig │ │ │ ├── bin-op.sig │ │ │ ├── bin-pr.sig │ │ │ ├── cmp.sig │ │ │ ├── cps.sig │ │ │ ├── effect.sig │ │ │ ├── fn.sig │ │ │ ├── shift-op.sig │ │ │ ├── thunk.sig │ │ │ ├── un-op.sig │ │ │ └── un-pr.sig │ │ │ ├── fold │ │ │ ├── fold.sig │ │ │ └── fru.sig │ │ │ ├── generic │ │ │ ├── emb.sig │ │ │ ├── fix.sig │ │ │ ├── iso.sig │ │ │ └── tie.sig │ │ │ ├── io │ │ │ ├── ios-monad.sig │ │ │ ├── reader.sig │ │ │ ├── text-io.sig │ │ │ └── writer.sig │ │ │ ├── lazy │ │ │ └── lazy.sig │ │ │ ├── numeric │ │ │ ├── int-inf.sig │ │ │ ├── integer.sig │ │ │ ├── real.sig │ │ │ └── word.sig │ │ │ ├── os │ │ │ ├── os-file-sys.sig │ │ │ └── os.sig │ │ │ ├── sequence │ │ │ ├── array-slice.sig │ │ │ ├── array.sig │ │ │ ├── buffer.sig │ │ │ ├── list.sig │ │ │ ├── mono-array-slice.sig │ │ │ ├── mono-array.sig │ │ │ ├── mono-vector-slice.sig │ │ │ ├── mono-vector.sig │ │ │ ├── resizable-array.sig │ │ │ ├── stream.sig │ │ │ ├── vector-slice.sig │ │ │ └── vector.sig │ │ │ ├── text │ │ │ ├── char.sig │ │ │ ├── cvt.sig │ │ │ ├── string.sig │ │ │ ├── substring.sig │ │ │ └── text.sig │ │ │ ├── time │ │ │ └── time.sig │ │ │ └── typing │ │ │ ├── phantom.sig │ │ │ ├── static-sum.sig │ │ │ └── void.sig │ ├── generic │ │ └── unstable │ │ │ ├── Check.bgb │ │ │ ├── Check.sh │ │ │ ├── Generate-combination.sh │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── Test-mlton.sh │ │ │ ├── Test-polyml.sh │ │ │ ├── Test-smlnj.sh │ │ │ ├── Test.bgb │ │ │ ├── detail │ │ │ ├── extra │ │ │ │ ├── close-pretty-with-extra.fun │ │ │ │ ├── reg-basis-exns.fun │ │ │ │ └── with-extra.fun │ │ │ ├── framework │ │ │ │ ├── close-generic.fun │ │ │ │ ├── generics.sml │ │ │ │ ├── layer-generic.fun │ │ │ │ ├── root-generic.sml │ │ │ │ └── ty.sml │ │ │ ├── generic.sml │ │ │ ├── ml │ │ │ │ ├── common │ │ │ │ │ └── cast-real.sig │ │ │ │ ├── mlkit │ │ │ │ │ ├── cast-real.sml │ │ │ │ │ ├── extensions.mlb │ │ │ │ │ └── pack-real.sml │ │ │ │ ├── mlton │ │ │ │ │ ├── cast-real.sml │ │ │ │ │ ├── extensions.mlb │ │ │ │ │ └── pack-real.sml │ │ │ │ ├── polyml │ │ │ │ │ └── extensions.use │ │ │ │ └── smlnj │ │ │ │ │ ├── cast-real.sml │ │ │ │ │ ├── extensions.cm │ │ │ │ │ ├── extensions.use │ │ │ │ │ ├── pack-real.sml │ │ │ │ │ ├── sigs.cm │ │ │ │ │ └── unsealed.cm │ │ │ ├── util │ │ │ │ ├── generics-util.sml │ │ │ │ ├── hash-univ.sml │ │ │ │ ├── ops.sml │ │ │ │ ├── opt-int.sml │ │ │ │ └── sml-syntax.sml │ │ │ └── value │ │ │ │ ├── arbitrary.sml │ │ │ │ ├── data-rec-info.sml │ │ │ │ ├── debug.sml │ │ │ │ ├── dynamic.sml │ │ │ │ ├── enum.sml │ │ │ │ ├── eq.sml │ │ │ │ ├── fmap.sml │ │ │ │ ├── hash.sml │ │ │ │ ├── ord.sml │ │ │ │ ├── pickle.sml │ │ │ │ ├── pretty.sml │ │ │ │ ├── read.sml │ │ │ │ ├── reduce.sml │ │ │ │ ├── seq.sml │ │ │ │ ├── shrink.sml │ │ │ │ ├── size.sml │ │ │ │ ├── some.sml │ │ │ │ ├── transform.sml │ │ │ │ ├── type-exp.sml │ │ │ │ ├── type-hash.sml │ │ │ │ ├── type-info.sml │ │ │ │ └── uniplate.sml │ │ │ ├── example │ │ │ ├── canonize-rt.mlb │ │ │ ├── canonize-rt.sml │ │ │ ├── canonize-uni.mlb │ │ │ ├── canonize-uni.sml │ │ │ ├── memoize.mlb │ │ │ ├── memoize.ok │ │ │ ├── memoize.sml │ │ │ └── memoize.use │ │ │ ├── lib.cm │ │ │ ├── lib.mlb │ │ │ ├── lib.use │ │ │ ├── public │ │ │ ├── export.sml │ │ │ ├── extra │ │ │ │ └── generic-extra.sig │ │ │ ├── framework │ │ │ │ ├── cases.sig │ │ │ │ ├── closed-cases.sig │ │ │ │ ├── closed-rep.sig │ │ │ │ ├── generic.sig │ │ │ │ ├── generics.sig │ │ │ │ ├── layer-cases-fun.sig │ │ │ │ ├── layer-dep-cases-fun.sig │ │ │ │ ├── layer-rep-fun.sig │ │ │ │ ├── layered-rep.sig │ │ │ │ ├── open-cases.sig │ │ │ │ ├── open-rep.sig │ │ │ │ ├── rep.sig │ │ │ │ └── ty.sig │ │ │ ├── util │ │ │ │ └── generics-util.sig │ │ │ └── value │ │ │ │ ├── arbitrary.sig │ │ │ │ ├── data-rec-info.sig │ │ │ │ ├── dynamic.sig │ │ │ │ ├── enum.sig │ │ │ │ ├── eq.sig │ │ │ │ ├── fmap.sig │ │ │ │ ├── hash.sig │ │ │ │ ├── ord.sig │ │ │ │ ├── pickle.sig │ │ │ │ ├── pretty.sig │ │ │ │ ├── read.sig │ │ │ │ ├── reduce.sig │ │ │ │ ├── seq.sig │ │ │ │ ├── shrink.sig │ │ │ │ ├── size.sig │ │ │ │ ├── some.sig │ │ │ │ ├── transform.sig │ │ │ │ ├── type-exp.sig │ │ │ │ ├── type-hash.sig │ │ │ │ ├── type-info.sig │ │ │ │ └── uniplate.sig │ │ │ ├── test.cm │ │ │ ├── test.mlb │ │ │ ├── test.use │ │ │ ├── test │ │ │ ├── app │ │ │ │ ├── generic.cm │ │ │ │ ├── generic.mlb │ │ │ │ ├── generic.sml │ │ │ │ └── generic.use │ │ │ ├── fmap.sml │ │ │ ├── pickle.sml │ │ │ ├── pretty.sml │ │ │ ├── read.sml │ │ │ ├── reduce.sml │ │ │ ├── some.sml │ │ │ ├── transform.sml │ │ │ ├── uniplate.sml │ │ │ └── utils.fun │ │ │ └── with │ │ │ ├── arbitrary.sml │ │ │ ├── close-pretty-with-extra.sml │ │ │ ├── close.sml │ │ │ ├── data-rec-info.sml │ │ │ ├── dynamic.sml │ │ │ ├── enum.sml │ │ │ ├── eq.sml │ │ │ ├── extra.sml │ │ │ ├── fmap.sml │ │ │ ├── generic.sml │ │ │ ├── hash.sml │ │ │ ├── infix-product.sml │ │ │ ├── ord.sml │ │ │ ├── pickle.sml │ │ │ ├── pretty.sml │ │ │ ├── read.sml │ │ │ ├── reduce.sml │ │ │ ├── reg-basis-exns.sml │ │ │ ├── seq.sml │ │ │ ├── shrink.sml │ │ │ ├── size.sml │ │ │ ├── some.sml │ │ │ ├── transform.sml │ │ │ ├── type-exp.sml │ │ │ ├── type-hash.sml │ │ │ ├── type-info.sml │ │ │ ├── types-mlton.sml │ │ │ ├── types-polyml.sml │ │ │ ├── types.sml │ │ │ └── uniplate.sml │ ├── ipc │ │ └── unstable │ │ │ ├── LICENSE │ │ │ ├── detail │ │ │ ├── internal.mlb │ │ │ ├── ipc.sml │ │ │ └── raw-mem.sml │ │ │ ├── lib.mlb │ │ │ ├── public │ │ │ ├── export.sml │ │ │ └── ipc.sig │ │ │ ├── test.mlb │ │ │ └── test │ │ │ └── raw-mem.sml │ ├── misc-util │ │ └── unstable │ │ │ ├── Build.bgb │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README │ │ │ ├── arbitrary.sml │ │ │ ├── assoc-test.sml │ │ │ ├── basic.sml │ │ │ ├── bit-flags.sml │ │ │ ├── cache.sig │ │ │ ├── cache.sml │ │ │ ├── compare.sml │ │ │ ├── dbg.sml │ │ │ ├── dummy.sml │ │ │ ├── eq.sml │ │ │ ├── glob.sml │ │ │ ├── infixes.sml │ │ │ ├── int-obj.sig │ │ │ ├── lazy-test.sml │ │ │ ├── lib.mlb │ │ │ ├── lift.sml │ │ │ ├── maybe.sml │ │ │ ├── misc-test.sml │ │ │ ├── misc.sml │ │ │ ├── mk-int-obj-cache.fun │ │ │ ├── mk-random-gen.fun │ │ │ ├── node.sml │ │ │ ├── prettier-test.sml │ │ │ ├── prettier.sml │ │ │ ├── ptr-cache-test.sml │ │ │ ├── ptr-cache.sml │ │ │ ├── ptr-int-obj.h │ │ │ ├── qc-test-example.sml │ │ │ ├── queue.sig │ │ │ ├── queue.sml │ │ │ ├── random-dev-mlton.sml │ │ │ ├── random-dev.sig │ │ │ ├── random-gen.sig │ │ │ ├── ranqd1-gen.sml │ │ │ ├── ref-cache.sml │ │ │ ├── rng.sig │ │ │ ├── show-test.sml │ │ │ ├── show.sml │ │ │ ├── sml-syntax.sml │ │ │ ├── sorted-list-test.sml │ │ │ ├── sorted-list.sml │ │ │ ├── structural-type-pair.fun │ │ │ ├── structural-type-to-type.fun │ │ │ ├── structural-type.sig │ │ │ ├── test.mlb │ │ │ ├── type-info.sml │ │ │ ├── type-pair.fun │ │ │ ├── type-support.sml │ │ │ ├── type-util.sml │ │ │ ├── type.sig │ │ │ ├── type.sml │ │ │ ├── unit-test.mlb │ │ │ ├── unit-test.sml │ │ │ ├── unlinkable-list.sml │ │ │ ├── word-table.sig │ │ │ └── word-table.sml │ ├── prettier │ │ └── unstable │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── detail │ │ │ ├── ml │ │ │ │ └── smlnj │ │ │ │ │ └── unsealed.cm │ │ │ └── prettier.sml │ │ │ ├── lib-no-infixes.mlb │ │ │ ├── lib.cm │ │ │ ├── lib.mlb │ │ │ ├── lib.use │ │ │ └── public │ │ │ ├── export.sml │ │ │ ├── infixes.sml │ │ │ └── prettier.sig │ ├── random │ │ └── unstable │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── detail │ │ │ ├── mk-random-gen.fun │ │ │ ├── ml │ │ │ │ ├── common │ │ │ │ │ └── random-dev.sml │ │ │ │ ├── mlkit │ │ │ │ │ └── random-dev.mlb │ │ │ │ ├── mlton │ │ │ │ │ ├── random-dev.mlb │ │ │ │ │ └── random-dev.sml │ │ │ │ ├── polyml │ │ │ │ │ └── random-dev.use │ │ │ │ └── smlnj │ │ │ │ │ ├── random-dev.use │ │ │ │ │ └── unsealed.cm │ │ │ ├── numerical-recipes.sml │ │ │ ├── ran0-gen.sml │ │ │ └── ranqd1-gen.sml │ │ │ ├── lib.cm │ │ │ ├── lib.mlb │ │ │ ├── lib.use │ │ │ └── public │ │ │ ├── export.sml │ │ │ ├── numerical-recipes.sig │ │ │ ├── random-dev.sig │ │ │ ├── random-gen.sig │ │ │ └── rng.sig │ ├── unit-test │ │ └── unstable │ │ │ ├── Example.sh │ │ │ ├── LICENSE │ │ │ ├── README │ │ │ ├── detail │ │ │ ├── maybe.sml │ │ │ ├── ml │ │ │ │ └── smlnj │ │ │ │ │ └── unsealed.cm │ │ │ ├── sorted-list.cm │ │ │ ├── sorted-list.mlb │ │ │ ├── sorted-list.sml │ │ │ ├── sorted-list.use │ │ │ └── unit-test.sml │ │ │ ├── example.cm │ │ │ ├── example.mlb │ │ │ ├── example.use │ │ │ ├── example │ │ │ ├── app │ │ │ │ ├── generic.cm │ │ │ │ ├── generic.mlb │ │ │ │ ├── generic.sml │ │ │ │ └── generic.use │ │ │ ├── assoc-test.sml │ │ │ ├── qc-test.sml │ │ │ ├── rev-test.sml │ │ │ └── sms-test.sml │ │ │ ├── lib.cm │ │ │ ├── lib.mlb │ │ │ ├── lib.use │ │ │ └── public │ │ │ ├── export.sml │ │ │ └── unit-test.sig │ └── windows │ │ └── unstable │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README │ │ ├── detail │ │ ├── constants.sml.cpp │ │ ├── ffi │ │ │ └── windows.h │ │ ├── lib │ │ │ └── windows.c │ │ └── windows.sml │ │ ├── lib.mlb │ │ └── public │ │ ├── export.sml │ │ ├── windows-ex.sig │ │ └── windows.sig └── sweeks │ ├── async │ └── unstable │ │ ├── async.sig │ │ ├── async.sml │ │ └── lib.mlb │ └── basic │ └── unstable │ ├── EXPORT │ ├── Makefile │ ├── README │ ├── array-slice.sig │ ├── array-slice.sml │ ├── array.0.sml │ ├── array.1.sml │ ├── array.sig │ ├── basis.sml │ ├── bit-flags.fun │ ├── bit-flags.sig │ ├── bool.sig │ ├── bool.sml │ ├── char.sig │ ├── char.sml │ ├── date.sig │ ├── date.sml │ ├── dir.sig │ ├── dir.sml │ ├── endian.sig │ ├── endian.sml │ ├── enumerable.fun │ ├── enumerable.sig │ ├── enumerate-get.fun │ ├── enumerate.sig │ ├── exn.sig │ ├── exn.sml │ ├── export.sig │ ├── export.sml │ ├── fields-and-tokens.fun │ ├── file.sig │ ├── file.sml │ ├── generic-array.sig │ ├── generic-slice.sig │ ├── generic-vector.sig │ ├── get.fun │ ├── get.sig │ ├── in.sig │ ├── in.sml │ ├── int-inf.sig │ ├── int-inf.sml │ ├── int.fun │ ├── int.sig │ ├── int.sml │ ├── io-desc.sig │ ├── io-desc.sml │ ├── lazy.sig │ ├── lazy.sml │ ├── lib.mlb │ ├── list.0.sml │ ├── list.1.sml │ ├── list.sig │ ├── mono-array.sig │ ├── mono-slice.sig │ ├── mono-vector-slice.sig │ ├── mono-vector.sig │ ├── net.sig │ ├── net.sml │ ├── open-export.sml │ ├── option.0.sml │ ├── option.1.sml │ ├── option.sig │ ├── order.sig │ ├── order.sml │ ├── ordered.sig │ ├── out.sig │ ├── out.sml │ ├── packable-real.fun │ ├── packable-real.sig │ ├── packable-word.fun │ ├── packable-word.sig │ ├── path.sig │ ├── path.sml │ ├── poll.sig │ ├── poll.sml │ ├── posix.sig │ ├── posix.sml │ ├── primitive.sml │ ├── process.sig │ ├── process.sml │ ├── radix.sig │ ├── radix.sml │ ├── ram-sequence.fun │ ├── real-structs.sml │ ├── real.fun │ ├── real.sig │ ├── real.sml │ ├── recur.fun │ ├── ref.sig │ ├── ref.sml │ ├── scanner.0.sml │ ├── scanner.1.sml │ ├── scanner.sig │ ├── seq.0.sml │ ├── seq.1.sml │ ├── seq.2.sml │ ├── seq.sig │ ├── sequence.sig │ ├── slice.fun │ ├── slice.sig │ ├── sliceable.sig │ ├── static-sum.sig │ ├── static-sum.sml │ ├── string.0.sml │ ├── string.1.sml │ ├── string.sig │ ├── substring.sig │ ├── substring.sml │ ├── subtypes.sml │ ├── sys-error.sig │ ├── sys-error.sml │ ├── thunk.sig │ ├── thunk.sml │ ├── time.sig │ ├── time.sml │ ├── unit.sig │ ├── unit.sml │ ├── util.sig │ ├── util.sml │ ├── vector-slice.sig │ ├── vector-slice.sml │ ├── vector.sig │ ├── vector.sml │ ├── word.fun │ ├── word.sig │ ├── word.sml │ └── word8.sig └── org └── mlton ├── mike └── opengl │ └── unstable │ ├── .gitignore │ ├── .ignore │ ├── GL.cm │ ├── GL.sig │ ├── GL.sml │ ├── GLU.cm │ ├── GLU.sig │ ├── GLU.sml │ ├── GLUT.cm │ ├── GLUT.sig │ ├── GLUT.sml │ ├── GLUT_c.c │ ├── GLU_c.c │ ├── GL_c.c │ ├── Makefile │ ├── atom.cm │ ├── atom.sml │ ├── bits.cm │ ├── bits.sml │ ├── blender.cm │ ├── blender.sml │ ├── hello.cm │ ├── hello.sml │ ├── menus.cm │ ├── menus.sml │ ├── molehill.cm │ ├── molehill.sml │ ├── opengl.cm │ ├── platform.h │ ├── points.cm │ ├── points.sml │ ├── shortest.cm │ ├── shortest.sml │ ├── solar.cm │ ├── solar.sml │ ├── spin_cube.cm │ ├── spin_cube.sml │ ├── triangle.cm │ └── triangle.sml ├── vesak ├── LICENSE ├── ds │ └── unstable │ │ ├── LICENSE │ │ ├── README │ │ ├── detail │ │ ├── hash-map.sml │ │ ├── linked-queue.sml │ │ ├── ml │ │ │ └── smlnj │ │ │ │ └── unsealed.cm │ │ ├── node.sml │ │ └── unlinkable-list.sml │ │ ├── lib.cm │ │ ├── lib.mlb │ │ ├── lib.use │ │ └── public │ │ ├── export.sml │ │ ├── hash-map.sig │ │ ├── linked-queue.sig │ │ ├── node.sig │ │ ├── queue.sig │ │ └── unlinkable-list.sig ├── libc │ └── unstable │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README │ │ ├── detail │ │ ├── config-gen.c │ │ ├── declare.h │ │ └── define.h │ │ ├── libc.mlb │ │ └── public │ │ ├── errno.h │ │ ├── stdio.h │ │ ├── string.h │ │ └── time.h ├── math3d │ └── unstable │ │ ├── LICENSE │ │ ├── README │ │ ├── detail │ │ ├── mk-plane.fun │ │ ├── mk-quat.fun │ │ ├── mk-rbt.fun │ │ ├── mk-rot.fun │ │ ├── mk-seq.fun │ │ ├── mk-vec.fun │ │ └── ml │ │ │ ├── common.sml │ │ │ ├── mlton.sml │ │ │ └── polyml.sml │ │ ├── lib-no-infixes.mlb │ │ ├── lib.mlb │ │ ├── lib.use │ │ └── public │ │ ├── export │ │ ├── common.sml │ │ ├── infixes.sml │ │ ├── mlton.sml │ │ └── polyml.sml │ │ ├── plane.sig │ │ ├── quat.sig │ │ ├── rbt.sig │ │ ├── rot.sig │ │ ├── scalar.sig │ │ ├── seq.sig │ │ └── vec.sig ├── parsec │ └── unstable │ │ ├── LICENSE │ │ ├── detail │ │ ├── mk-parsec.fun │ │ ├── ml │ │ │ └── smlnj │ │ │ │ └── unsealed.cm │ │ └── string-sequence.sml │ │ ├── lib.cm │ │ ├── lib.mlb │ │ ├── lib.use │ │ ├── public │ │ ├── export.sml │ │ ├── parsec.sig │ │ └── sequence.sig │ │ ├── test.mlb │ │ └── test │ │ ├── app │ │ └── generic.mlb │ │ └── parsec.sml ├── rpc-lib │ └── unstable │ │ ├── LICENSE │ │ ├── README │ │ ├── detail │ │ ├── client.sml │ │ ├── common.mlb │ │ ├── common.use │ │ ├── protocol.sml │ │ ├── server.sml │ │ └── socket-events.sml │ │ ├── example │ │ └── assoc │ │ │ ├── Build.bgb │ │ │ ├── Build.sh │ │ │ ├── app │ │ │ ├── generic.mlb │ │ │ └── generic.use │ │ │ ├── client.mlb │ │ │ ├── client.sml │ │ │ ├── client.use │ │ │ ├── common.sml │ │ │ ├── server.mlb │ │ │ ├── server.sml │ │ │ └── server.use │ │ ├── lib-client.mlb │ │ ├── lib-client.use │ │ ├── lib-server.mlb │ │ ├── lib-server.use │ │ └── public │ │ ├── client │ │ ├── client.sig │ │ └── export.sml │ │ ├── protocol.sig │ │ └── server │ │ ├── export.sml │ │ └── server.sig ├── sdl │ └── unstable │ │ ├── Build.sh │ │ ├── Generate-FFI.sh │ │ ├── README │ │ ├── detail │ │ ├── config │ │ │ ├── amd64-linux.h │ │ │ └── x86-linux.h │ │ ├── lib │ │ │ ├── util.c │ │ │ └── util.h │ │ ├── sdl-key-sym.sml │ │ └── sdl.sml │ │ ├── example │ │ └── bounce │ │ │ ├── Build.bgb │ │ │ ├── Build.sh │ │ │ ├── bounce.mlb │ │ │ ├── bounce.sml │ │ │ └── chest.bmp │ │ ├── lib.mlb │ │ └── public │ │ ├── export.sml │ │ ├── sdl-key-sym.sig │ │ └── sdl.sig ├── tech │ ├── cermlang │ │ ├── example │ │ │ ├── echo.mlb │ │ │ └── echo.sml │ │ └── lib │ │ │ ├── cermlang.sig │ │ │ ├── cermlang.sml │ │ │ ├── infixes.sml │ │ │ └── lib.mlb │ ├── generics │ │ ├── lgd.sml │ │ └── syb.sml │ └── oo │ │ ├── framework │ │ ├── any.sig │ │ ├── any.sml │ │ ├── lib.mlb │ │ ├── lib.use │ │ ├── prelude.sml │ │ ├── sub.fun │ │ └── var.sml │ │ └── imperative-shapes │ │ ├── README │ │ ├── circle.sig │ │ ├── circle.sml │ │ ├── main.mlb │ │ ├── main.sml │ │ ├── main.use │ │ ├── rectangle.sig │ │ ├── rectangle.sml │ │ ├── shape.sig │ │ └── shape.sml ├── toys │ ├── ant │ │ └── serial │ │ │ ├── Build.bgb │ │ │ ├── Makefile │ │ │ ├── ant.mlb │ │ │ └── ant.sml │ ├── chameneos │ │ └── async │ │ │ ├── Build.bgb │ │ │ ├── Makefile │ │ │ ├── chameneos.mlb │ │ │ └── chameneos.sml │ ├── cheap-concurrency │ │ └── async │ │ │ ├── Build.bgb │ │ │ ├── Makefile │ │ │ ├── cheap-concurrency.mlb │ │ │ └── cheap-concurrency.sml │ ├── common.mk │ ├── n-body │ │ ├── Build.bgb │ │ ├── Makefile │ │ ├── app │ │ │ └── generic.mlb │ │ ├── n-body.mlb │ │ └── n-body.sml │ ├── simplify │ │ ├── Build.bgb │ │ ├── Makefile │ │ ├── bench.sml │ │ ├── rational.sml │ │ ├── simplify.mlb │ │ └── simplify.sml │ └── spectral-norm │ │ ├── Build.bgb │ │ ├── Makefile │ │ ├── spectral-norm.mlb │ │ └── spectral-norm.sml ├── use-lib │ └── unstable │ │ ├── Make.sh │ │ ├── README │ │ ├── detail │ │ ├── ml │ │ │ ├── alice │ │ │ │ └── workarounds.sml │ │ │ └── mosml │ │ │ │ └── workarounds.sml │ │ └── use-lib.sml │ │ └── public │ │ ├── export.sml │ │ └── use-lib.sig └── var-ed │ └── unstable │ ├── detail │ └── var-ed.sml │ ├── lib.mlb │ └── public │ ├── export.sml │ └── var-ed.sig └── ville ├── mersenne-twister └── unstable │ ├── LICENSE │ ├── Makefile │ ├── README │ ├── detail │ └── mt-19937.sml │ ├── lib.mlb │ ├── public │ ├── export.sml │ └── rng.sig │ ├── test │ ├── first-5000.ok │ └── first-5000.sml │ └── tests.mlb └── misc └── unstable ├── GNUmakefile ├── README ├── common.mk ├── detail ├── bit-field.sml ├── histogram.sml ├── mk-deck.sml ├── mk-random.sml ├── probability-vector.sml ├── subsets.sml └── time-limit.sml ├── generic.mlb ├── lib.mlb ├── mlb-path-map ├── public ├── bit-field.sig ├── deck.sig ├── export.sml ├── histogram.sig ├── option-parser.sig ├── probability-vector.sig ├── random.sig ├── subsets.sig └── time-limit.sig └── tests ├── histogram-test.mlb └── histogram-test.sml /.smackspec: -------------------------------------------------------------------------------- 1 | description: The MLtonLibrary repository 2 | maintainer: Matthew Fluet 3 | keywords: SML,library 4 | license: MLTon 5 | -------------------------------------------------------------------------------- /ca/terpstra/math/c.sml: -------------------------------------------------------------------------------- 1 | structure C = ComplexOfField(R) 2 | 3 | structure C32 = ComplexOfField(R32) 4 | structure C64 = ComplexOfField(R64) 5 | -------------------------------------------------------------------------------- /ca/terpstra/math/galois.sml: -------------------------------------------------------------------------------- 1 | local 2 | structure P4 = 3 | struct 4 | structure W = Word4 5 | val base : W.word = 0wx3 6 | end 7 | structure P5 = 8 | struct 9 | structure W = Word5 10 | val base : W.word = 0wx9 11 | end 12 | structure P8 = 13 | struct 14 | structure W = Word8 15 | val base : W.word = 0wx1B 16 | end 17 | in 18 | structure Galois4 = GaloisFromTable(P4) 19 | structure Galois5 = GaloisFromTable(P5) 20 | structure Galois8 = GaloisFromTable(P8) 21 | end 22 | -------------------------------------------------------------------------------- /ca/terpstra/math/ops.sig: -------------------------------------------------------------------------------- 1 | (****************************************************************** Groups *) 2 | 3 | datatype order = FINITE of LargeInt.int | COUNTABLE | UNCOUNTABLE 4 | 5 | signature SET = 6 | sig 7 | type t 8 | val order: order 9 | val EQ: (t * t) -> bool 10 | end 11 | 12 | signature BINARY_OPERATION = 13 | sig 14 | include SET 15 | val MUL: (t * t) -> t 16 | end 17 | 18 | signature ENDOFUNCTION = 19 | sig 20 | include BINARY_OPERATION 21 | type v 22 | val EVAL: t -> v -> v 23 | end 24 | -------------------------------------------------------------------------------- /ca/terpstra/math/ops.sml: -------------------------------------------------------------------------------- 1 | (****************************************************************** Operators *) 2 | 3 | infix 8 ++% **% (* additive and multiplicative exponentiation *) 4 | infix 7 *% /% %% //% (* //% = (/%, %%) = (div, mod) *) 5 | infix 6 +% -% 6 | infix 4 =% !=% <% (* <>% would imply <% which does not always exist *) 7 | nonfix ~% !% #% 8 | 9 | (* the operators in an algebra are always these (above for scalars) *) 10 | infix 8 ++$ **$ 11 | infix 7 *$ /$ %$ //$ 12 | infix 6 +$ -$ 13 | infix 4 =$ !=$ <$ 14 | nonfix ~$ !$ #$ 15 | 16 | infix 7 *& (* for scalar operations with a vector *) 17 | -------------------------------------------------------------------------------- /ca/terpstra/math/q.sml: -------------------------------------------------------------------------------- 1 | structure Q = QuotientOfEuclideanDomain(Z) 2 | 3 | (* these are vulnerable to overflow *) 4 | structure Q64 = QuotientOfEuclideanDomain(Z64) 5 | structure Q32 = QuotientOfEuclideanDomain(Z32) 6 | structure Q16 = QuotientOfEuclideanDomain(Z16) 7 | structure Q8 = QuotientOfEuclideanDomain(Z8) 8 | -------------------------------------------------------------------------------- /ca/terpstra/math/r.sml: -------------------------------------------------------------------------------- 1 | structure R = FieldOfReal(LargeReal) 2 | 3 | structure R32 = FieldOfReal(Real32) 4 | structure R64 = FieldOfReal(Real64) 5 | -------------------------------------------------------------------------------- /ca/terpstra/math/test/test.mlb: -------------------------------------------------------------------------------- 1 | ann 2 | "warnUnused true" 3 | "warnMatch true" 4 | "sequenceUnit true" 5 | in 6 | local 7 | $(MLTON_ROOT)/basis/basis.mlb 8 | ../math.mlb 9 | in 10 | test.sml 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /ca/terpstra/math/test/test3.mlb: -------------------------------------------------------------------------------- 1 | ann 2 | "warnUnused true" 3 | "warnMatch true" 4 | "sequenceUnit true" 5 | in 6 | local 7 | $(MLTON_ROOT)/basis/basis.mlb 8 | ../math.mlb 9 | in 10 | test3.sml 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /ca/terpstra/math/test/test4.mlb: -------------------------------------------------------------------------------- 1 | ann 2 | "warnUnused true" 3 | "warnMatch true" 4 | "sequenceUnit true" 5 | in 6 | local 7 | $(MLTON_ROOT)/basis/basis.mlb 8 | ../math.mlb 9 | in 10 | test4.sml 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/Makefile: -------------------------------------------------------------------------------- 1 | TARGETS = pickle 2 | 3 | all: $(TARGETS) 4 | 5 | clean: 6 | rm -f *.grm.* *.lex.* *.dep $(TARGETS) 7 | 8 | %.dep: %.mlb 9 | echo -en "$(basename $@) $@:\t" > $@.tmp 10 | mlton -stop f $< | sed 's/^/ /;s/$$/ \\/' >> $@.tmp 11 | mv $@.tmp $@ 12 | 13 | %: %.mlb 14 | mlton -output $@ $< 15 | 16 | %.grm.sml %.grm.sig %.grm.desc: %.grm 17 | mlyacc $< 18 | 19 | %.lex.sml: %.lex 20 | mllex $< 21 | 22 | -include $(patsubst %.mlb,%.dep,$(wildcard *.mlb)) 23 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/README: -------------------------------------------------------------------------------- 1 | Since MLton has no automatic serialization capability, this attempts to 2 | build one as a library. The idea was that a protocol could be specified as 3 | a SML type and the compiled into a serializer for C and SML. 4 | 5 | The serializers are built as functors. This way they can be instantiated on 6 | a binary or text serializer for basic types. 7 | 8 | Compile the compiler with: 9 | make 10 | The test directory includes example SML types suitable for compilation 11 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/lib/pickle.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in 4 | pickle.sig 5 | pickle.sml 6 | binary.sml 7 | text.sml 8 | end 9 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/lib/pickle.sml: -------------------------------------------------------------------------------- 1 | functor Pickle(P : PICKLER_SIMPLE) :> PICKLE = 2 | struct 3 | structure Base = P.Base 4 | type 'a pickle = { r: 'a Base.r, w: 'a Base.w } 5 | type t = P.t 6 | 7 | fun compose1 {r=rf, w=wf} {r=r1, w=w1} = {r=rf r1, w=wf w1} 8 | fun compose2 {r=rf, w=wf} ({r=r1, w=w1}, {r=r2, w=w2}) = {r=rf(r1,r2), w=wf(w1,w2)} 9 | 10 | fun pickle ({r, w}: 'a pickle) = 11 | { r = fn t => (#2 o r o (#r P.convert)) t, 12 | w = fn x => (#w P.convert) (w (P.eof, x)) } 13 | end 14 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/pickle.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | $(SML_LIB)/mlyacc-lib/mlyacc-lib.mlb 4 | in 5 | tree.sml 6 | ast.sml 7 | tml.grm.sig 8 | tml.lex.sml 9 | tml.grm.sml 10 | gen.sml 11 | tag.sml 12 | type.sml 13 | import.sml 14 | export.sml 15 | method.sml 16 | main.sml 17 | end 18 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/tests/Makefile: -------------------------------------------------------------------------------- 1 | TARGETS = $(patsubst %.test,%,$(wildcard *.test)) 2 | 3 | all: $(TARGETS) 4 | clean: 5 | rm -f *.sml $(TARGETS) 6 | 7 | %.sml: %.test 8 | cp ../sb.sig $@.tmp 9 | ../pickle Test < $< >> $@.tmp 10 | mv $@.tmp $@ 11 | 12 | %: %.sml 13 | mlton $< 14 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/tests/double.test: -------------------------------------------------------------------------------- 1 | datatype ('a, 'b) union = LEFT of 'a | RIGHT of 'b 2 | type ('a, 'b) pair = 'a * 'b 3 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/tests/rebind.test: -------------------------------------------------------------------------------- 1 | (* use old binding *) 2 | type pair = string * int 3 | 4 | (* flip bindings *) 5 | type int = string 6 | and string = int 7 | 8 | datatype opt = 9 | VECTOR of opt * string * int 10 | | NADA of opt * pair 11 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/tests/recursive.test: -------------------------------------------------------------------------------- 1 | type 'a x = 'a vector list set 2 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/tests/scope.test: -------------------------------------------------------------------------------- 1 | (* Note that {} and unit are different because unit can be rebound *) 2 | datatype d1 = C of { baz : d1 * int } list | D of {} | E of t1 3 | and d2 = F of d1 | G of d2 | Q of t2 4 | withtype t1 = string * d2 5 | and t2 = string * unit 6 | 7 | datatype 'a d3 = datatype list 8 | -------------------------------------------------------------------------------- /ca/terpstra/pickle/tests/tree.test: -------------------------------------------------------------------------------- 1 | datatype color = RED | BLACK 2 | datatype 'a tree = LEAF | NODE of color * 'a tree * 'a * 'a tree 3 | -------------------------------------------------------------------------------- /ca/terpstra/regexp/automata.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | in 4 | ztree.sml 5 | btree.sml 6 | automata.sig 7 | automata.fun 8 | end 9 | -------------------------------------------------------------------------------- /ca/terpstra/regexp/compare.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | automata.mlb 4 | in 5 | compare.sml 6 | end 7 | -------------------------------------------------------------------------------- /ca/terpstra/regexp/todot.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | automata.mlb 4 | in 5 | todot.sml 6 | end 7 | -------------------------------------------------------------------------------- /ca/terpstra/regexp/todot.sml: -------------------------------------------------------------------------------- 1 | structure T = Automata(Alphabet) 2 | structure DFA = T.Deterministic 3 | structure NFA = T.NonDeterministic 4 | structure E = T.Expression 5 | structure RE = T.RegularExpression 6 | open E 7 | 8 | val exp = (RE.toExpression o RE.fromString o hd o CommandLine.arguments) () 9 | val s = toDFA exp 10 | val () = print (DFA.toDot ("dotfile", s)) 11 | -------------------------------------------------------------------------------- /ca/terpstra/sqlite3-sml/demo.mlb: -------------------------------------------------------------------------------- 1 | (* 2 | ** 2007 February 18 3 | ** 4 | ** The author disclaims copyright to this source code. In place of 5 | ** a legal notice, here is a blessing: 6 | ** 7 | ** May you do good and not evil. 8 | ** May you find forgiveness for yourself and forgive others. 9 | ** May you share freely, never taking more than you give. 10 | ** 11 | ************************************************************************* 12 | ** $Id$ 13 | *) 14 | $(SML_LIB)/basis/basis.mlb 15 | sqlite.mlb 16 | demo.sml 17 | -------------------------------------------------------------------------------- /ca/terpstra/sqlite3-sml/pair.sml: -------------------------------------------------------------------------------- 1 | (* 2 | ** 2007 February 18 3 | ** 4 | ** The author disclaims copyright to this source code. In place of 5 | ** a legal notice, here is a blessing: 6 | ** 7 | ** May you do good and not evil. 8 | ** May you find forgiveness for yourself and forgive others. 9 | ** May you share freely, never taking more than you give. 10 | ** 11 | ************************************************************************* 12 | ** $Id$ 13 | *) 14 | datatype ('a, 'b) pair = & of 'a * 'b 15 | infix & 16 | -------------------------------------------------------------------------------- /ca/terpstra/st/Makefile: -------------------------------------------------------------------------------- 1 | all: st 2 | 3 | epoll/epoll.mlb: epoll.h /usr/include/x86_64-linux/i386-linux/sys/epoll.h 4 | kevent/kevent.mlb: kevent.h /usr/include/sys/event.h 5 | 6 | %.mlb: 7 | mlnlffigen -allSU true -linkage static -dir $(@D) -mlbfile $(@F) $^ 8 | 9 | -include $(patsubst %.mlb,%.dep,$(wildcard *.mlb)) 10 | -------------------------------------------------------------------------------- /ca/terpstra/st/README: -------------------------------------------------------------------------------- 1 | This is a simple work-alike of state-threads.sf.net for Standard ML. 2 | It helps in building event driven state machines with non-concurrent threads. 3 | 4 | For an example, see test.sml 5 | 6 | To use on osx: 7 | make kevent/kevent.mlb 8 | mlton test.mlb 9 | 10 | To use on linux: 11 | edit st.mlb to use epoll.mlb instead of kevent.mlb 12 | make epoll/epoll.mlb 13 | mlton test.mlb 14 | 15 | The test program downloads two webpages from google concurrently, while 16 | answering TCP connections on port 12467 and printing a heart beat. 17 | -------------------------------------------------------------------------------- /ca/terpstra/st/epoll.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | enum EPOLL_CTL { 4 | CTL_ADD = EPOLL_CTL_ADD, 5 | CTL_DEL = EPOLL_CTL_DEL, 6 | CTL_MOD = EPOLL_CTL_MOD 7 | }; 8 | 9 | int close(int); 10 | -------------------------------------------------------------------------------- /ca/terpstra/st/epoll.sig: -------------------------------------------------------------------------------- 1 | signature EPOLL = 2 | sig 3 | type poll 4 | type ioh = IoEvent.ioh 5 | 6 | val create: int -> poll 7 | val close: poll -> unit 8 | 9 | (* Track changes to state of the io handle *) 10 | val add: poll * ioh -> unit 11 | val remove: poll * ioh -> unit 12 | 13 | (* will automatically change IoEvent's status *) 14 | val wait: poll * Time.time option -> unit 15 | end 16 | -------------------------------------------------------------------------------- /ca/terpstra/st/open.sml: -------------------------------------------------------------------------------- 1 | open State 2 | open Thread 3 | open Timeout 4 | open IoEvent 5 | open Scheduler 6 | -------------------------------------------------------------------------------- /ca/terpstra/st/scheduler.sig: -------------------------------------------------------------------------------- 1 | signature SCHEDULER = 2 | sig 3 | val main: unit -> unit 4 | end 5 | 6 | signature SCHEDULER_EXTRA = 7 | sig 8 | include SCHEDULER 9 | structure IoEvent: IOEVENT 10 | end 11 | -------------------------------------------------------------------------------- /ca/terpstra/st/test.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | st.mlb 4 | in 5 | test.sml 6 | end 7 | -------------------------------------------------------------------------------- /ca/terpstra/st/thread.sig: -------------------------------------------------------------------------------- 1 | signature THREAD = 2 | sig 3 | (* start a new thread, which will be run later *) 4 | val spawn: (unit -> unit) -> unit 5 | val yield: 'a -> 'a (* release control for a tick *) 6 | 7 | val stopTill: (bool, 'a) State.state -> unit 8 | val select: ((bool, 'b) State.state * 'a) list -> 'a list 9 | end 10 | 11 | signature THREAD_EXTRA = 12 | sig 13 | include THREAD 14 | 15 | datatype loop = COMPLETE | PENDING 16 | val run: unit -> loop (* process queue till completed or stopped *) 17 | val stop: unit -> unit (* stop processing queue and return soon *) 18 | end 19 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/control.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature CONTROL_STRUCTS = 8 | sig 9 | structure Region: REGION 10 | end 11 | 12 | signature CONTROL = 13 | sig 14 | include CONTROL_STRUCTS 15 | 16 | val acceptMozillaExtensions: bool ref 17 | val errorStr: Region.t * string -> unit 18 | end 19 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/javascript.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Source = Source () 8 | structure Regexp = Regexp () 9 | structure Token = Token (structure Regexp = Regexp) 10 | structure Lex = Lex (structure Source = Source 11 | structure Token = Token) 12 | structure Javascript = Javascript (structure Regexp = Regexp) 13 | structure Parse = Parse (structure Javascript = Javascript 14 | structure Token = Token) 15 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/lex.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature LEX_STRUCTS = 8 | sig 9 | structure Source: SOURCE 10 | structure Token: TOKEN 11 | end 12 | 13 | signature LEX = 14 | sig 15 | include LEX_STRUCTS 16 | 17 | val lexFile: File.t -> Token.t Stream.t 18 | val lexString: string -> Token.t Stream.t 19 | val showTokens: bool ref 20 | end 21 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/lib.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(MLTON_LIB)/sources.mlb 8 | stream.sig 9 | stream.sml 10 | util.sml 11 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/main.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature MAIN = 8 | sig 9 | val commandLine: string list -> Process.Status.t 10 | end 11 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/mjs.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | ann 8 | "warnUnused true" 9 | in 10 | lib.mlb 11 | javascript.mlb 12 | main.sig 13 | main.sml 14 | end 15 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/mlb-path-map: -------------------------------------------------------------------------------- 1 | MLTON_LIB <... put path to MLton lib here ...> 2 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/parse.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature PARSE_STRUCTS = 8 | sig 9 | structure Javascript: JAVASCRIPT 10 | structure Token: TOKEN 11 | sharing Javascript.Regexp = Token.Regexp 12 | end 13 | 14 | signature PARSE = 15 | sig 16 | include PARSE_STRUCTS 17 | 18 | val parse: Token.t Stream.t -> Javascript.Program.t option 19 | val showConsider: bool ref 20 | val showAutoSemi: bool ref 21 | end 22 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/regexp.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor Regexp (S: REGEXP_STRUCTS): REGEXP = 8 | struct 9 | 10 | open S 11 | 12 | datatype t = T of {body: string, 13 | flags: string} 14 | 15 | fun equals (T {body = b, flags = f}, T {body = b', flags = f'}) = 16 | b = b' andalso f = f' 17 | 18 | val make = T 19 | 20 | fun toString (T {body, flags}) = concat ["/", body, "/", flags] 21 | 22 | val layout = Layout.str o toString 23 | 24 | end 25 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/regexp.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature REGEXP_STRUCTS = 8 | sig 9 | end 10 | 11 | signature REGEXP = 12 | sig 13 | include REGEXP_STRUCTS 14 | 15 | type t 16 | 17 | val equals: t * t -> bool 18 | val make: {body: string, flags: string} -> t 19 | val toString: t -> string 20 | val layout: t -> Layout.t 21 | end 22 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/top-down-parser.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | lib.mlb 9 | two-point-lattice.sig 10 | two-point-lattice.fun 11 | join-lattice.sig 12 | join-lattice.fun 13 | top-down-parser.sig 14 | top-down-parser.fun 15 | top-down-parser.sml 16 | in 17 | structure TopDownParser 18 | end 19 | -------------------------------------------------------------------------------- /com/entain/javascript/unstable/top-down-parser.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Entain, Inc. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure TopDownParser = TopDownParser () 8 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/detail/ml/smlnj/unsealed.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group is 8 | $MLTON_LIB/org/mlton/vesak/ds/unstable/lib.cm 9 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 10 | ../../../public/async.sig 11 | ../../async.sml 12 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/example/actor/counter-example.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | ../../lib.mlb 10 | 11 | ann 12 | "nonexhaustiveExnMatch ignore" 13 | "sequenceNonUnit warn" 14 | "warnUnused true" 15 | in 16 | actor.sml 17 | counter.sml 18 | counter-example.sml 19 | end 20 | in 21 | end 22 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/example/poll-loop/lib.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | in 10 | ann 11 | "forceUsed" 12 | "sequenceNonUnit warn" 13 | "warnUnused true" 14 | in 15 | poll-loop.sml 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/example/poll-loop/lib.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "poll-loop.sml"] ; 9 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/example/smlbot/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "SML-Bot" 8 | :shell "nice -n5 make all") 9 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/example/smlbot/show-bindings.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | val () = CM.State.showBindings () 8 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/example/smlbot/smlbot.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "../../lib.use", 9 | "../poll-loop/lib.use", 10 | "text-io.sml", 11 | "text-prim-io.sml", 12 | "smlbot.sml", 13 | "main.sml"] ; 14 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/example/smlbot/text-io.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure TextIO = struct 8 | open TextIO 9 | val getReader = StreamIO.getReader o getInstream 10 | val getWriter = StreamIO.getWriter o getOutstream 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/lib.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(public/export.sml) 9 | is 10 | detail/ml/smlnj/unsealed.cm 11 | public/export.sml 12 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/lib.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | $(MLTON_LIB)/org/mlton/vesak/ds/unstable/lib.mlb 10 | in 11 | ann 12 | "forceUsed" 13 | "sequenceNonUnit warn" 14 | "warnUnused true" 15 | in 16 | local 17 | public/async.sig 18 | detail/async.sml 19 | in 20 | public/export.sml 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/lib.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/org/mlton/vesak/ds/unstable/lib.use", 8 | "${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 9 | "public/async.sig", 10 | "detail/async.sml", 11 | "public/export.sml"] ; 12 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported Signatures == *) 8 | 9 | signature ASYNC = ASYNC 10 | 11 | (** == Exported Structures == *) 12 | 13 | structure Async : ASYNC = Async 14 | -------------------------------------------------------------------------------- /com/ssh/async/unstable/test.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/unit-test/unstable/lib.use", 8 | "${MLTON_LIB}/com/ssh/generic/unstable/lib.use", 9 | "${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 10 | "${APPLICATION}/generic.use", 11 | "lib.use", 12 | "test/async.sml"] ; 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/basis.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | library(detail/ml/smlnj/basis-minus-extensions.cm) 9 | library(extensions.cm) 10 | is 11 | extensions.cm 12 | detail/ml/smlnj/basis-minus-extensions.cm 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/basis.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (* 8 | * This basis file defines the extended basis library including all of the 9 | * original basis library. The idea is that users refer to this instead 10 | * of the original basis library. 11 | *) 12 | 13 | $(SML_LIB)/basis/basis.mlb 14 | extensions.mlb 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/basis.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (* The use files of this library assume that they are used from the root 8 | * directory of this library (the directory of this file). 9 | *) 10 | 11 | lib ["extensions.use"] ; 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/concept/mk-cstringable.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor MkCStringable (Core : CSTRINGABLE_CORE) : CSTRINGABLE = struct 8 | open Core 9 | type cstringable_ex = cstringable 10 | val (toCString, fromCString) = embCString 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/concept/mk-equality.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor MkEquality (Core : EQUALITY_CORE) : EQUALITY = struct 8 | open Core 9 | type equality_ex = equality 10 | val op != = not o op == 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/concept/mk-scannable.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor MkScannable (Core : SCANNABLE_CORE) : SCANNABLE = Core 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/concept/mk-stringable.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor MkStringable (Core : STRINGABLE_CORE) : STRINGABLE = struct 8 | open Core 9 | type stringable_ex = stringable 10 | val (toString, fromString) = embString 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/control/exit.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Exit :> EXIT = struct 8 | type 'a t = 'a -> exn 9 | 10 | fun within block = let 11 | exception EscapedExit of 'a 12 | in 13 | block EscapedExit 14 | handle EscapedExit value => value 15 | end 16 | 17 | fun to exit value = raise exit value 18 | 19 | fun call block = within (block o to) 20 | end 21 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/data/sq.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Sq :> SQ = struct 8 | open Sq 9 | fun mk x = (x, x) 10 | fun map f (x, y) = (f x, f y) 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/fn/bin-fn.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure BinFn :> BIN_FN = struct 8 | open BinFn 9 | fun map (f, g) = Fn.map (Sq.map f, g) 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/fn/bin-op.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure BinOp :> BIN_OP = struct 8 | open BinOp 9 | val map = BinFn.map 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/fn/bin-pr.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure BinPr :> BIN_PR = struct 8 | open BinPr 9 | fun map f = UnPr.map (Sq.map f) 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/fn/cps.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure CPS :> CPS = struct 8 | open Fn CPS 9 | fun return x f = f x 10 | fun op >>= (aM, a2bM) = aM o flip a2bM 11 | type ('a, 'c) cont = 'a -> 'c 12 | fun callcc b k = b k k 13 | fun throw k x _ = k x 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/fn/effect.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Effect :> EFFECT = struct 8 | open Effect 9 | val ignore = ignore 10 | val nop = ignore 11 | fun obs ef x = (ef x : Unit.t ; x) 12 | fun past ef x = (ef () : Unit.t ; x) 13 | fun tabulate n ef = ignore (Basic.repeat (fn i => (ef i : Unit.t ; i+1)) n 0) 14 | fun map b2a a = a o b2a 15 | fun iso (a2b, b2a) = (map b2a, map a2b) 16 | end 17 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/fn/thunk.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Thunk :> THUNK = struct 8 | open Thunk 9 | val mk = Fn.const 10 | fun map a2b a = a2b o a 11 | val isoValue = (fn th => th (), mk) 12 | fun iso (a2b, b2a) = (map a2b, map b2a) 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/fn/un-op.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure UnOp :> UN_OP = struct 8 | open UnOp 9 | val map = Fn.map 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/fn/un-pr.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure UnPr :> UN_PR = struct 8 | open UnPr 9 | fun map f p = p o f 10 | fun op andAlso (p, q) ? = p ? andalso q ? 11 | fun op orElse (p, q) ? = p ? orelse q ? 12 | fun neg p = not o p 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/generic/emb.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Emb :> EMB = struct 8 | open Emb 9 | 10 | infix <--> 11 | 12 | val id = (Fn.id, SOME) 13 | 14 | val to = Pair.fst 15 | val from = Pair.snd 16 | 17 | fun (a2b, b2aOpt) <--> (c2a, a2cOpt) = 18 | (a2b o c2a, Option.composePartial (a2cOpt, b2aOpt)) 19 | end 20 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/generic/fix.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Fix :> FIX = struct 8 | open Fix 9 | exception Fix 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/generic/iso.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Iso :> ISO = struct 8 | open Iso 9 | 10 | infix <--> 11 | 12 | val id = (Fn.id, Fn.id) 13 | 14 | val to = Pair.fst 15 | val from = Pair.snd 16 | val swap = Pair.swap 17 | 18 | fun (a2b, b2a) <--> (c2a, a2c) = (a2b o c2a, a2c o b2a) 19 | 20 | fun map (l, r) iso = r <--> iso <--> l 21 | end 22 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/common/ext.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Ext = struct 8 | structure Exn = struct 9 | fun addMessager _ = () 10 | fun history _ = [] 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/basis.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure BasisFixedInt = FixedInt 8 | structure BasisInt31 = Int31 9 | structure BasisInt32 = Int32 10 | structure BasisIntInf = IntInf 11 | structure BasisReal64 = Real64 12 | structure BasisSysWord = SysWord 13 | structure BasisWord31 = Word31 14 | structure BasisWord32 = Word32 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/extensions.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(SML_LIB)/basis/basis.mlb 9 | in 10 | ../common/ext.sml 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/ints.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {INTEGER} and {INT_INF} modules for MLKit == *) 8 | 9 | structure Int31 : INTEGER = MkIntegerExt (Int31) 10 | structure Int32 : INTEGER = MkIntegerExt (Int32) 11 | 12 | structure IntInf : INT_INF = MkIntInfExt (IntInf) 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/mono-array-slices.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_ARRAY_SLICE} modules for MLKit == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/mono-arrays.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_ARRAY} modules for MLKit == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/mono-vector-slices.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_VECTOR_SLICE} modules for MLKit == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/mono-vectors.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_VECTOR} modules for MLKit == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/pervasive.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(SML_LIB)/basis/basis.mlb 8 | workarounds.mlb 9 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/reals.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {REAL} modules for MLKit == *) 8 | 9 | structure Real64 : REAL = MkRealExt (Real64) 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/texts.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {TEXT} modules for MLKit == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/univ.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Univ :> UNIV = UnivRef 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/words.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {WORD} modules for MLKit == *) 8 | 9 | structure SysWord : WORD = MkWordExt (SysWord) 10 | 11 | structure Word31 : WORD = MkWordExt (Word31) 12 | structure Word32 : WORD = MkWordExt (Word32) 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/workarounds.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(SML_LIB)/basis/basis.mlb 9 | in 10 | workarounds/ieee-real.sig 11 | workarounds/ieee-real.sml 12 | 13 | workarounds/mk-real-sane.fun 14 | workarounds/real.sig 15 | workarounds/reals.sml 16 | 17 | workarounds/string.sig 18 | workarounds/text.sig 19 | workarounds/text.sml 20 | end 21 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/workarounds/reals.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Real : REAL = MkRealSane (Real) 8 | structure LargeReal : REAL = MkRealSane (LargeReal) 9 | structure Real64 : REAL = MkRealSane (Real64) 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/workarounds/string.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature STRING = sig 8 | include STRING 9 | val scan : (Char.char, 'a) StringCvt.reader -> (string, 'a) StringCvt.reader 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlkit/workarounds/text.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Text = struct 8 | open Text 9 | structure String = struct 10 | val scan = fn _ => raise Fail "MLKit does not implement String.scan" 11 | open String 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlton/ext.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Ext = struct 8 | structure Exn = struct 9 | local 10 | open MLton.Exn 11 | in 12 | val addMessager = addExnMessager 13 | val history = history 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlton/extensions.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_ROOT)/basis/mlton.mlb 9 | in 10 | ext.sml 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlton/pervasive.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(SML_LIB)/basis/pervasive.mlb 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlton/reals.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {REAL} modules for MLton == *) 8 | 9 | structure Real32 : REAL = MkRealExt (BasisReal32) 10 | structure Real64 : REAL = MkRealExt (BasisReal64) 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlton/texts.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {TEXT} modules for MLton == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlton/univ.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Univ :> UNIV = UnivExn 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/mlton/workarounds.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (* Empty file; No workarounds needed for MLton. *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/basis.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure BasisFixedInt = Int32 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/extensions.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["../common/ext.sml"] ; 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/ints.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {INTEGER} and {INT_INF} modules for Poly/ML == *) 8 | 9 | structure IntInf : INT_INF = MkIntInfExt (IntInf) 10 | 11 | structure Int32 : INTEGER = MkIntegerExt (Int32) 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/mono-array-slices.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_ARRAY_SLICE} modules for Poly/ML == *) 8 | 9 | structure IntArraySlice : MONO_ARRAY_SLICE = 10 | MkMonoArraySliceExt (structure MonoArraySlice = IntArraySlice) 11 | 12 | structure RealArraySlice : MONO_ARRAY_SLICE = 13 | MkMonoArraySliceExt (structure MonoArraySlice = RealArraySlice) 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/mono-vector-slices.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_VECTOR_SLICE} modules for Poly/ML == *) 8 | 9 | structure IntVectorSlice : MONO_VECTOR_SLICE = 10 | MkMonoVectorSliceExt (structure MonoVectorSlice = IntVectorSlice) 11 | 12 | structure RealVectorSlice : MONO_VECTOR_SLICE = 13 | MkMonoVectorSliceExt (structure MonoVectorSlice = RealVectorSlice) 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/mono-vectors.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_VECTOR} modules for Poly/ML == *) 8 | 9 | structure BoolVector : MONO_VECTOR = MkMonoVectorExt (BoolVector) 10 | structure IntVector : MONO_VECTOR = MkMonoVectorExt (IntVector) 11 | structure RealVector : MONO_VECTOR = MkMonoVectorExt (RealVector) 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/reals.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {REAL} modules for Poly/ML == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/texts.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {TEXT} modules for Poly/ML == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/univ.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Univ :> UNIV = UnivExn 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/words.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {WORD} modules for Poly/ML == *) 8 | 9 | structure SysWord : WORD = MkWordExt (SysWord) 10 | structure Word32 : WORD = MkWordExt (Word32) 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/polyml/workarounds.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib [] ; 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/basis-minus-extensions.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | library(workarounds/basis.cm) - library(../../../extensions.cm) 9 | is 10 | workarounds/basis.cm 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/basis-rebound.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(-) 9 | is 10 | ../../../detail/ml/common/basis.sml 11 | ../../../detail/ml/smlnj/basis.sml 12 | workarounds/basis.cm 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/bootstrap.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group 8 | library(basis-rebound.cm) 9 | source(-) 10 | is 11 | ../../../detail/bootstrap.sml 12 | basis-rebound.cm 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/ext.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Ext = struct 8 | structure Exn = struct 9 | fun addMessager _ = () 10 | val history = SMLofNJ.exnHistory 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/extensions.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["ext.sml"] ; 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/ints.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {INTEGER} and {INT_INF} modules for SML/NJ == *) 8 | 9 | structure Int31 = MkIntegerExt (BasisInt31) 10 | structure Int32 = MkIntegerExt (BasisInt32) 11 | 12 | structure Int64 = MkIntegerExt (BasisInt64) 13 | 14 | structure IntInf = MkIntInfExt (BasisIntInf) 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/mono-array-slices.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_ARRAY_SLICE} modules for SML/NJ == *) 8 | 9 | structure RealArraySlice = 10 | MkMonoArraySliceExt (structure MonoArraySlice = BasisRealArraySlice) 11 | structure Real64ArraySlice = 12 | MkMonoArraySliceExt (structure MonoArraySlice = BasisReal64ArraySlice) 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/mono-arrays.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_ARRAY} modules for SML/NJ == *) 8 | 9 | structure RealArray = 10 | MkMonoArrayExt (structure MonoArray = BasisRealArray 11 | structure MonoVector = BasisRealVector) 12 | structure Real64Array = 13 | MkMonoArrayExt (structure MonoArray = BasisReal64Array 14 | structure MonoVector = BasisReal64Vector) 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/mono-vector-slices.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_VECTOR_SLICE} modules for SML/NJ == *) 8 | 9 | structure RealVectorSlice = 10 | MkMonoVectorSliceExt (structure MonoVectorSlice = BasisRealVectorSlice) 11 | structure Real64VectorSlice = 12 | MkMonoVectorSliceExt (structure MonoVectorSlice = BasisReal64VectorSlice) 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/mono-vectors.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {MONO_VECTOR} modules for SML/NJ == *) 8 | 9 | structure RealVector = MkMonoVectorExt (BasisRealVector) 10 | structure Real64Vector = MkMonoVectorExt (BasisReal64Vector) 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/reals.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {REAL} modules for SML/NJ == *) 8 | 9 | structure Real64 = MkRealExt (BasisReal64) 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/texts.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {TEXT} modules for SML/NJ == *) 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/univ.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Univ :> UNIV = UnivExn 8 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/words.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Extended {WORD} modules for SML/NJ == *) 8 | 9 | structure SysWord = MkWordExt (BasisSysWord) 10 | 11 | structure Word31 = MkWordExt (BasisWord31) 12 | structure Word32 = MkWordExt (BasisWord32) 13 | 14 | structure Word64 = MkWordExt (BasisWord64) 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/workarounds.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["workarounds/mk-real-sane.fun", 8 | "workarounds/char.sig", 9 | "workarounds/real.sig", 10 | "workarounds/reals.sml", 11 | "workarounds/string.sig", 12 | "workarounds/text.sig", 13 | "workarounds/text.sml"] ; 14 | 15 | (* XXX Is there a way to "forget" top-level bindings in SML/NJ? *) 16 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/workarounds/basis-minus-sane.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group 8 | library($/basis.cm) - library(sane.cm) 9 | is 10 | $/basis.cm 11 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/workarounds/basis.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | group(basis-minus-sane.cm) 9 | library(sane.cm) 10 | is 11 | basis-minus-sane.cm 12 | sane.cm 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/workarounds/funs.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group is 8 | mk-real-sane.fun 9 | $/basis.cm 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/workarounds/mk-real-sane.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor MkRealSane (R : REAL) = struct 8 | open R 9 | val fromDecimal' = fromDecimal 10 | fun fromDecimal d = SOME (fromDecimal' d) handle _ => NONE 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/workarounds/reals.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Real = MkRealSane (Real) 8 | 9 | structure LargeReal = MkRealSane (LargeReal) 10 | 11 | structure Real64 = MkRealSane (Real64) 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/workarounds/sane.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(-) 9 | is 10 | $/basis.cm 11 | char.sig 12 | funs.cm 13 | real.sig 14 | reals.sml 15 | string.sig 16 | text.sig 17 | text.sml 18 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/ml/smlnj/workarounds/text.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Text = struct 8 | open Text 9 | structure String = struct 10 | val scan = fn _ => raise Fail "SML/NJ does not implement String.scan" 11 | open String 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/numeric/mk-int-inf-ext.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor MkIntInfExt (IntInf : BASIS_INT_INF) : INT_INF = struct 8 | structure Integer = MkIntegerExt (IntInf) 9 | open Integer 10 | open IntInf 11 | type bitwise = t 12 | type shiftable = t 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/sequence/array-slice.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure ArraySlice : ARRAY_SLICE = struct 8 | open ArraySlice 9 | end 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/sequence/buffer.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Buffer :> BUFFER = struct 8 | structure Buffer = 9 | MkBufferCommon (type 'a elem = 'a 10 | val inj = Fn.id val prj = Fn.id val any = Fn.id) 11 | open Buffer 12 | 13 | fun reserve b newCap = 14 | if newCap <= capacity b orelse isEmpty b then () 15 | else realloc (asub (array b) 0) b newCap 16 | end 17 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/sequence/mk-mono-array-slice-ext.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor MkMonoArraySliceExt (structure MonoArraySlice : 8 | BASIS_MONO_ARRAY_SLICE) : MONO_ARRAY_SLICE = 9 | struct 10 | open MonoArraySlice 11 | type t = slice 12 | end 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/sequence/mk-mono-vector-slice-ext.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor MkMonoVectorSliceExt (structure MonoVectorSlice : 8 | BASIS_MONO_VECTOR_SLICE) = 9 | struct 10 | open MonoVectorSlice 11 | type t = slice 12 | end 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/sequence/vector-slice.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure VectorSlice : VECTOR_SLICE = struct 8 | open VectorSlice 9 | end 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/sequence/vector.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Vector : VECTOR = struct 8 | structure Common = MkSeqCommonExt (Vector) 9 | open Common Vector 10 | fun iso ? = Pair.map (map, map) ? 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/detail/time/time.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Time = struct 8 | open Time 9 | local 10 | fun mk f = 11 | (fn v => fromSeconds (v * f), fn t => LargeInt.quot (toSeconds t, f)) 12 | in 13 | val (fromMinutes, toMinutes) = mk (60 * 60) 14 | val (fromHours, toHours) = mk 60 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/example/iter/countdown.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | ../../basis.mlb 8 | 9 | local 10 | ann 11 | "warnUnused true" 12 | "sequenceNonUnit warn" 13 | in 14 | countdown.sml 15 | end 16 | in 17 | end 18 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/example/iter/eratosthenes.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | ../../basis.mlb 8 | 9 | eratosthenes.sml 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/example/iter/mean.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | ../../basis.mlb 8 | 9 | local 10 | ann 11 | "warnUnused true" 12 | "sequenceNonUnit warn" 13 | in 14 | mean.sml 15 | end 16 | in 17 | end 18 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/example/iter/number.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | ../../basis.mlb 8 | 9 | number.sml 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/example/iter/pancakes.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | ../../basis.mlb 8 | 9 | local 10 | ann 11 | "warnUnused true" 12 | "sequenceNonUnit warn" 13 | in 14 | pancakes.sml 15 | end 16 | in 17 | end 18 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/example/iter/pythagoras.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | ../../basis.mlb 8 | 9 | pythagoras.sml 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/extensions.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(-) 9 | is 10 | detail/ml/smlnj/unsealed.cm 11 | public/export/common.sml 12 | public/export/smlnj.sml 13 | public/export/top-level.sml 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/concept/cased.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Cased == *) 8 | 9 | signature CASED = sig 10 | type cased 11 | val toLower : cased UnOp.t 12 | val toUpper : cased UnOp.t 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/concept/empty.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** The empty signature with no specifications. *) 8 | signature EMPTY = sig end 9 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/data/id.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Signature for the {Id} module for the identity type constructor. *) 8 | signature ID = T'1 where type 'a t = 'a 9 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/data/pair.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature PAIR = sig 8 | type ('a, 'b) pair = 'a * 'b 9 | 10 | include PRODUCT_TYPE 11 | where type ('a, 'b) t = ('a, 'b) pair 12 | end 13 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/data/sq.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** 8 | * Utilities for dealing with "squares", that is, pairs whose both 9 | * elements are of the same type. 10 | *) 11 | signature SQ = sig 12 | type 'a t = 'a * 'a 13 | (** The type of "squares". *) 14 | 15 | val mk : 'a -> 'a t 16 | (** {mk x = (x, x)}. *) 17 | 18 | val map : ('a -> 'b) -> 'a t -> 'b t 19 | (** {map f (x, y) = (f x, f y)}. *) 20 | end 21 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/data/unit.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Signature for the unit type home module. *) 8 | signature UNIT = sig 9 | type t = unit 10 | (** The unit type. *) 11 | 12 | val compare : t Cmp.t 13 | (** The trivial compare function. *) 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/export/mlkit.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == MLKit specific extensions == *) 8 | 9 | structure Int31 : INTEGER = Int31 10 | structure Int32 : INTEGER = Int32 11 | structure IntInf : INT_INF = IntInf 12 | structure Real64 : REAL = Real64 13 | structure SysWord : WORD = SysWord 14 | structure Word31 : WORD = Word31 15 | structure Word32 : WORD = Word32 16 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/export/open-top-level.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Top-Level Bindings == *) 8 | 9 | open TopLevel 10 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/fn/bin-fn.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Utilities for dealing with binary functions. *) 8 | signature BIN_FN = sig 9 | type ('a, 'b) t = 'a Sq.t -> 'b 10 | (** Type of binary functions. *) 11 | 12 | val map : ('c -> 'a) * ('b -> 'd) -> ('a, 'b) t -> ('c, 'd) t 13 | (** Change the domain and range of a binary function. *) 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/fn/bin-op.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Utilities for dealing with binary operators. *) 8 | signature BIN_OP = sig 9 | type 'a t = ('a, 'a) BinFn.t 10 | (** Type of binary operators (e.g. {+, -, @, ...}). *) 11 | 12 | val map : ('b, 'a) Iso.t -> 'a t -> 'b t 13 | (** Change the sort of a binary operator. *) 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/fn/bin-pr.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Utilities for dealing with binary predicates. *) 8 | signature BIN_PR = sig 9 | type 'a t = 'a Sq.t UnPr.t 10 | (** Type of binary predicates or relations (e.g. {<, <=, >=, >, ...}). *) 11 | 12 | val map : ('a -> 'b) -> 'b t -> 'a t 13 | (** Change the domain of a binary predicate. *) 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/fn/shift-op.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Utilities for dealing with bit-wise shift operators. *) 8 | signature SHIFT_OP = sig 9 | type 'a t = 'a * Word.t -> 'a 10 | (** Type of bit-wise shift operators {<<, >>, ~>>}. *) 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/fn/un-op.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Utilities for dealing with unary operators. *) 8 | signature UN_OP = sig 9 | type 'a t = 'a -> 'a 10 | (** Type of unary operators (e.g. {~, rev, ...}). *) 11 | 12 | val map : ('a, 'b) Iso.t -> 'b t -> 'a t 13 | (** Change the sort of a unary operator. *) 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/generic/fix.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Utilities for dealing with fixpoints. *) 8 | signature FIX = sig 9 | type 'a t = 'a UnOp.t -> 'a 10 | (** The type of fixpoint combinators. *) 11 | 12 | exception Fix 13 | (** Exception for reporting errors in computing fixpoints. *) 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/numeric/int-inf.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006-2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Extended {INT_INF} signature. *) 8 | signature INT_INF = sig 9 | include INTEGER 10 | 11 | val divMod : t Sq.t UnOp.t 12 | val quotRem : t Sq.t UnOp.t 13 | 14 | val pow : t * Int.t -> t 15 | val log2 : t -> Int.t 16 | 17 | include BITWISE SHIFTABLE 18 | 19 | sharing type t = bitwise = shiftable 20 | end 21 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/sequence/array-slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Extended {ARRAY_SLICE} signature. *) 8 | signature ARRAY_SLICE = sig 9 | include BASIS_ARRAY_SLICE 10 | 11 | type 'a t = 'a slice 12 | (** Convenience alias. *) 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/sequence/mono-array-slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Extended {MONO_ARRAY_SLICE} signature. *) 8 | signature MONO_ARRAY_SLICE = sig 9 | include BASIS_MONO_ARRAY_SLICE 10 | 11 | type t sharing type t = slice 12 | (** Convenience alias. *) 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/sequence/mono-vector-slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Extended {MONO_VECTOR_SLICE} signature. *) 8 | signature MONO_VECTOR_SLICE = sig 9 | include BASIS_MONO_VECTOR_SLICE 10 | 11 | type t sharing type t = slice 12 | (** Convenience alias. *) 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/sequence/vector-slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Extended {VECTOR_SLICE} signature. *) 8 | signature VECTOR_SLICE = sig 9 | include BASIS_VECTOR_SLICE 10 | 11 | type 'a t = 'a slice 12 | (** Convenience alias. *) 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/extended-basis/unstable/public/time/time.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** 8 | * Extended {TIME} signature. 9 | *) 10 | signature TIME = sig 11 | include BASIS_TIME 12 | type t = time 13 | val fromHours : LargeInt.t -> t 14 | val fromMinutes : LargeInt.t -> t 15 | val toHours : t -> LargeInt.t 16 | val toMinutes : t -> LargeInt.t 17 | end 18 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/Check.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "Generics Check" 8 | :shell "./Check.sh") 9 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/Test-polyml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (C) 2007-2008 Vesa Karvonen 4 | # 5 | # This code is released under the MLton license, a BSD-style license. 6 | # See the LICENSE file or http://mlton.org/License for details. 7 | 8 | set -e 9 | set -x 10 | 11 | if ! which poly ; then 12 | echo 'Skipping test with Poly/ML as it does not seem to be installed.' 13 | exit 0 14 | fi 15 | 16 | export APPLICATION="$(pwd)/test/app" 17 | 18 | time \ 19 | echo 'use "../../../../org/mlton/vesak/use-lib/unstable/polyml.use" ; 20 | use "test.use" ;' | poly 21 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/Test.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "Generics Test" 8 | :shell "export COLUMNS=80 && 9 | nice -n5 ./Test-polyml.sh && 10 | nice -n5 ./Test-mlton.sh && 11 | nice -n5 ./Test-smlnj.sh") 12 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/common/cast-real.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature CAST_REAL = sig 8 | type t 9 | structure Bits : WORD 10 | val isoBits : (t, Bits.t) Iso.t Option.t 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/mlkit/cast-real.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure CastReal : CAST_REAL where type t = Real.t = struct 8 | open Real 9 | structure Bits = Word 10 | val isoBits = NONE 11 | end 12 | 13 | structure CastLargeReal : CAST_REAL where type t = LargeReal.t = CastReal 14 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/mlkit/extensions.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | in 10 | ../common/cast-real.sig 11 | cast-real.sml 12 | pack-real.sml 13 | end 14 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/mlkit/pack-real.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure PackLargeRealLittle : PACK_REAL where type real = LargeReal.t = 8 | PackRealLittle 9 | structure PackLargeRealBig : PACK_REAL where type real = LargeReal.t = 10 | PackRealBig 11 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/mlton/cast-real.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure CastReal : CAST_REAL where type t = Real.t = struct 8 | open Real64 MLton.Real64 9 | structure Bits = Word64 10 | val isoBits = SOME (castToWord, castFromWord) 11 | end 12 | 13 | structure CastLargeReal : CAST_REAL where type t = LargeReal.t = CastReal 14 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/mlton/extensions.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | $(MLTON_ROOT)/basis/mlton.mlb 10 | in 11 | ../common/cast-real.sig 12 | cast-real.sml 13 | pack-real.sml 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/mlton/pack-real.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure PackLargeRealLittle : PACK_REAL where type real = LargeReal.t = 8 | PackRealLittle 9 | structure PackLargeRealBig : PACK_REAL where type real = LargeReal.t = 10 | PackRealBig 11 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/smlnj/extensions.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group is 8 | $c/c.cm 9 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 10 | ../common/cast-real.sig 11 | cast-real.sml 12 | pack-real.sml 13 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/ml/smlnj/extensions.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | if CM.make "$c/c.cm" then () else fail "Couldn't make ML-NLFFI" ; 8 | 9 | lib ["cast-real.sml", "pack-real.sml"] ; 10 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/util/generics-util.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure GenericsUtil :> GENERICS_UTIL = struct 8 | (* <-- SML/NJ workaround *) 9 | open TopLevel 10 | (* SML/NJ workaround --> *) 11 | 12 | val ` = Exn.name 13 | fun failExn e = fails ["unregistered exn ", `e] 14 | fun failExnSq (l, r) = fails ["unregistered exns ", `l, " and ", `r] 15 | end 16 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/detail/util/opt-int.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure OptInt = struct 8 | type t = Int.t Option.t 9 | local 10 | fun mk bop = 11 | fn (SOME l, SOME r) => SOME (bop (l, r)) 12 | | _ => NONE 13 | in 14 | val op + = mk op + 15 | val op - = mk op - 16 | val op div = mk op div 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/example/memoize.ok: -------------------------------------------------------------------------------- 1 | concatV #["a", "bcd"] = "abcd" 2 | (memo) concatV #["a", "bcd"] = "abcd" 3 | concatV #["Ab", "C", "d"] = "AbCd" 4 | (memo) concatV #["Ab", "C", "d"] = "AbCd" 5 | (memo) concatV #["a", "bcd"] = "abcd" 6 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/lib.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(-) 9 | is 10 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 11 | detail/ml/smlnj/unsealed.cm 12 | public/export.sml 13 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/public/framework/cases.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** 8 | * A base signature for the "cases" of generics. 9 | *) 10 | signature CASES = sig 11 | structure Open : OPEN_CASES 12 | end 13 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/public/framework/closed-rep.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** 8 | * Signature for the closed representation types of generics. 9 | *) 10 | signature CLOSED_REP = sig 11 | type 'a t (** Type of complete representations. *) 12 | type 'a s (** Type of incomplete sum representations. *) 13 | type ('a, 'k) p (** Type of incomplete product representations. *) 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/public/framework/layer-cases-fun.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** 8 | * Signature for the domain of the {LayerCases} functor. 9 | *) 10 | signature LAYER_CASES_DOM = sig 11 | include CASES LAYERED_REP CLOSED_CASES 12 | sharing Open.Rep = Outer 13 | sharing Rep = This 14 | val hole : 'a Rep.t Thunk.t 15 | end 16 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/public/framework/rep.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** 8 | * A signature for the "rep" of generics. 9 | *) 10 | signature REP = sig 11 | structure Open : sig 12 | structure Rep : OPEN_REP 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/public/util/generics-util.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** 8 | * Signature for utilities for defining generics. 9 | *) 10 | signature GENERICS_UTIL = sig 11 | (** == For Defining Closed Generic Functions == *) 12 | 13 | val failExn : Exn.t -> 'a 14 | val failExnSq : Exn.t Sq.t -> 'a 15 | end 16 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/test/app/generic.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(-) 9 | is 10 | $MLTON_LIB/com/ssh/random/unstable/lib.cm 11 | ../../lib.cm 12 | generic.sml 13 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/close-pretty-with-extra.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Generic = struct 8 | structure Rep = ClosePrettyWithExtra (Generic) 9 | open Generic Rep 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/close.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Generic = struct 8 | structure Rep = CloseCases (Generic) 9 | open Generic Rep 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/data-rec-info.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic DATA_REC_INFO 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure DataRecInfoRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithDataRecInfo (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/dynamic.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic DYNAMIC 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure DynamicRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithDynamic (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/enum.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic ENUM 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure EnumRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithEnum (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/eq.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic EQ 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure EqRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithEq (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/extra.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Generic = struct 8 | structure Rep = WithExtra (Generic) 9 | open Generic Rep 10 | end 11 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/fmap.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic FMAP 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure FmapRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithFmap (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/generic.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = CASES 8 | 9 | functor MkGeneric (Arg : Generic) : Generic = Arg 10 | 11 | structure Generic = RootGeneric 12 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/hash.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic HASH 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure HashRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithHash (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/infix-product.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Generic = struct 8 | open Generic 9 | local 10 | open TopLevel 11 | val et = C "&" 12 | in 13 | fun op &` ab = 14 | iso (data (Pretty.infixL 0 et ab 15 | (C1 et (tuple2 ab)))) 16 | (fn op & ? => ?, op &) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/ord.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic ORD 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure OrdRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithOrd (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/pickle.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic PICKLE 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure PickleRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithPickle (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/pretty.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic PRETTY 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure PrettyRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithPretty (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/read.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (* WARNING: This file is generated! *) 8 | 9 | signature Generic = sig 10 | include Generic READ 11 | end 12 | 13 | functor MkGeneric (Arg : Generic) = struct 14 | structure Open = MkGeneric (Arg) 15 | open Arg Open 16 | structure ReadRep = Open.Rep 17 | end 18 | 19 | structure Generic = 20 | MkGeneric (structure Open = WithRead (Generic) 21 | open Generic Open) 22 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/reduce.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic REDUCE 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure ReduceRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithReduce (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/reg-basis-exns.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local structure ? = RegBasisExns (Generic) open ? in end 8 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/seq.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic SEQ 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure SeqRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithSeq (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/shrink.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic SHRINK 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure ShrinkRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithShrink (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/size.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic SIZE 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure SizeRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithSize (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/some.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic SOME 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure SomeRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithSome (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/transform.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic TRANSFORM 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure TransformRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithTransform (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/type-exp.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic TYPE_EXP 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure TypeExpRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithTypeExp (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/type-hash.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic TYPE_HASH 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure TypeHashRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithTypeHash (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/type-info.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic TYPE_INFO 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure TypeInfoRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithTypeInfo (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/types-mlton.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | open Generic 9 | in 10 | structure Real32 = struct 11 | open Real32 12 | val t = iso largeReal (Real32.isoLarge IEEEReal.TO_NEAREST) 13 | end 14 | 15 | structure Real64 = struct open Real64 val t = real end 16 | structure Int64 = struct open Int64 val t = fixedInt end 17 | structure IntInf = struct open IntInf val t = largeInt end 18 | end 19 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/types-polyml.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | open Generic 9 | in 10 | structure IntInf = struct open IntInf val t = largeInt end 11 | end 12 | -------------------------------------------------------------------------------- /com/ssh/generic/unstable/with/uniplate.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature Generic = sig 8 | include Generic UNIPLATE 9 | end 10 | 11 | functor MkGeneric (Arg : Generic) = struct 12 | structure Open = MkGeneric (Arg) 13 | open Arg Open 14 | structure UniplateRep = Open.Rep 15 | end 16 | 17 | structure Generic = 18 | MkGeneric (structure Open = WithUniplate (Generic) 19 | open Generic Open) 20 | -------------------------------------------------------------------------------- /com/ssh/ipc/unstable/detail/internal.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | $(SML_LIB)/basis/mlton.mlb 10 | in 11 | ann 12 | "forceUsed" 13 | "sequenceNonUnit warn" 14 | "warnUnused true" 15 | in 16 | raw-mem.sml 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /com/ssh/ipc/unstable/detail/ipc.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure IPC : IPC = struct 8 | structure Type = RawMem.Type (* XXX hash type-indices for dynamic checking *) 9 | end 10 | -------------------------------------------------------------------------------- /com/ssh/ipc/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature IPC = IPC 8 | 9 | structure IPC : IPC = IPC 10 | -------------------------------------------------------------------------------- /com/ssh/ipc/unstable/test.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/misc-util/unstable/unit-test.mlb 9 | 10 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 11 | $(MLTON_LIB)/com/ssh/misc-util/unstable/lib.mlb 12 | 13 | lib.mlb 14 | 15 | detail/internal.mlb 16 | 17 | ann "allowFFI true" in 18 | test/raw-mem.sml 19 | end 20 | in 21 | end 22 | -------------------------------------------------------------------------------- /com/ssh/misc-util/unstable/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; -*- emacs-lisp -*- 2 | ;; 3 | ;; Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 4 | ;; 5 | ;; This code is released under the MLton license, a BSD-style license. 6 | ;; See the LICENSE file or http://mlton.org/License for details. 7 | 8 | (bg-build 9 | :name "Misc Util" 10 | :shell "nice -n5 make all check") 11 | -------------------------------------------------------------------------------- /com/ssh/misc-util/unstable/README: -------------------------------------------------------------------------------- 1 | This library contains some miscellaneous utilities. The goal is to 2 | reorganize these into a more useful collection of libraries. 3 | -------------------------------------------------------------------------------- /com/ssh/misc-util/unstable/ptr-int-obj.h: -------------------------------------------------------------------------------- 1 | #ifndef PTR_INT_OBJ_H_20070218 2 | #define PTR_INT_OBJ_H_20070218 3 | 4 | /* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 5 | * 6 | * This code is released under the MLton license, a BSD-style license. 7 | * See the LICENSE file or http://mlton.org/License for details. 8 | */ 9 | 10 | union PtrIntObj { 11 | union PtrIntObj *next; 12 | int value; 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /com/ssh/misc-util/unstable/queue.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Signature for imperative polymorphic queues. *) 8 | signature QUEUE = sig 9 | type 'a t 10 | 11 | val new : 'a t Thunk.t 12 | 13 | val isEmpty : 'a t UnPr.t 14 | 15 | val length : 'a t -> Int.t 16 | 17 | val deque : 'a t -> 'a Option.t 18 | val enque : 'a t -> 'a Effect.t 19 | 20 | val appClear : 'a Effect.t -> 'a t Effect.t 21 | end 22 | -------------------------------------------------------------------------------- /com/ssh/misc-util/unstable/random-dev-mlton.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (* 8 | * Implementation of the {RANDOM_DEV} signature for MLton. 9 | *) 10 | 11 | structure RandomDev : RANDOM_DEV = MLton.Random 12 | -------------------------------------------------------------------------------- /com/ssh/misc-util/unstable/ref-cache.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | structure RefIntObj : INT_OBJ = struct 9 | type t = Int.t Ref.t 10 | val new = ref 11 | val discard = ignore 12 | val get = ! 13 | fun set r = r <\ op := 14 | end 15 | in 16 | (** A cache whose keys are {int ref} cells. *) 17 | structure RefCache = MkIntObjCache (RefIntObj) 18 | end 19 | -------------------------------------------------------------------------------- /com/ssh/misc-util/unstable/unit-test.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (* 8 | * MLB file for the unit test framework. 9 | *) 10 | 11 | local 12 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 13 | lib.mlb 14 | in 15 | ann 16 | "forceUsed" 17 | "sequenceNonUnit warn" 18 | "warnUnused true" 19 | in 20 | unit-test.sml 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /com/ssh/prettier/unstable/detail/ml/smlnj/unsealed.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group is 8 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 9 | ../../../public/prettier.sig 10 | ../../prettier.sml 11 | -------------------------------------------------------------------------------- /com/ssh/prettier/unstable/lib-no-infixes.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | in 10 | ann 11 | "forceUsed" 12 | "sequenceNonUnit warn" 13 | "warnUnused true" 14 | in 15 | local 16 | public/prettier.sig 17 | detail/prettier.sml 18 | in 19 | public/export.sml 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /com/ssh/prettier/unstable/lib.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(public/export.sml) 9 | is 10 | public/export.sml 11 | detail/ml/smlnj/unsealed.cm 12 | -------------------------------------------------------------------------------- /com/ssh/prettier/unstable/lib.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib-no-infixes.mlb 8 | public/infixes.sml 9 | -------------------------------------------------------------------------------- /com/ssh/prettier/unstable/lib.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "public/prettier.sig", 9 | "detail/prettier.sml", 10 | "public/export.sml", 11 | "public/infixes.sml"] ; 12 | -------------------------------------------------------------------------------- /com/ssh/prettier/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported Signatures == *) 8 | 9 | signature PRETTIER = PRETTIER 10 | 11 | (** == Exported Structures == *) 12 | 13 | structure Prettier : PRETTIER = Prettier 14 | -------------------------------------------------------------------------------- /com/ssh/random/unstable/detail/ml/mlkit/random-dev.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | in 10 | ann 11 | "forceUsed" 12 | "sequenceNonUnit warn" 13 | "warnUnused true" 14 | in 15 | ../../../public/random-dev.sig 16 | ../common/random-dev.sml (* XXX implement better seed/useed for MLKit *) 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /com/ssh/random/unstable/detail/ml/mlton/random-dev.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | $(MLTON_ROOT)/basis/mlton.mlb 10 | in 11 | ann 12 | "forceUsed" 13 | "sequenceNonUnit warn" 14 | "warnUnused true" 15 | in 16 | ../../../public/random-dev.sig 17 | random-dev.sml 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /com/ssh/random/unstable/detail/ml/mlton/random-dev.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure RandomDev : RANDOM_DEV = MLton.Random 8 | -------------------------------------------------------------------------------- /com/ssh/random/unstable/detail/ml/polyml/random-dev.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (* XXX implement better seed/useed for Poly/ML *) 8 | lib ["../common/random-dev.sml"] ; 9 | -------------------------------------------------------------------------------- /com/ssh/random/unstable/detail/ml/smlnj/random-dev.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (* XXX implement better seed/useed for SML/NJ *) 8 | lib ["../common/random-dev.sml"] ; 9 | -------------------------------------------------------------------------------- /com/ssh/random/unstable/lib.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(public/export.sml) 9 | is 10 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 11 | detail/ml/smlnj/unsealed.cm 12 | public/export.sml 13 | -------------------------------------------------------------------------------- /com/ssh/unit-test/unstable/detail/ml/smlnj/unsealed.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007-2008 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group is 8 | $APPLICATION/generic.cm 9 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 10 | $MLTON_LIB/com/ssh/generic/unstable/lib.cm 11 | $MLTON_LIB/com/ssh/prettier/unstable/lib.cm 12 | $MLTON_LIB/com/ssh/random/unstable/lib.cm 13 | ../../../public/unit-test.sig 14 | ../../maybe.sml 15 | ../../sorted-list.cm 16 | ../../unit-test.sml 17 | -------------------------------------------------------------------------------- /com/ssh/unit-test/unstable/detail/sorted-list.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(-) 9 | is 10 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 11 | sorted-list.sml 12 | -------------------------------------------------------------------------------- /com/ssh/unit-test/unstable/detail/sorted-list.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | in 10 | ann 11 | "forceUsed" 12 | "sequenceNonUnit warn" 13 | "warnUnused true" 14 | in 15 | sorted-list.sml 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /com/ssh/unit-test/unstable/detail/sorted-list.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "sorted-list.sml"] ; 9 | -------------------------------------------------------------------------------- /com/ssh/unit-test/unstable/example.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007-2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["lib.use", 8 | "${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 9 | "${MLTON_LIB}/com/ssh/generic/unstable/lib.use", 10 | "${APPLICATION}/generic.use", 11 | "detail/sorted-list.use", 12 | "example/assoc-test.sml", 13 | "example/qc-test.sml", 14 | "example/rev-test.sml", 15 | "example/sms-test.sml"] ; 16 | -------------------------------------------------------------------------------- /com/ssh/unit-test/unstable/example/app/generic.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(-) 9 | is 10 | $MLTON_LIB/com/ssh/generic/unstable/lib.cm 11 | $MLTON_LIB/com/ssh/random/unstable/lib.cm 12 | generic.sml 13 | -------------------------------------------------------------------------------- /com/ssh/unit-test/unstable/lib.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(-) 9 | is 10 | detail/ml/smlnj/unsealed.cm 11 | public/export.sml 12 | -------------------------------------------------------------------------------- /com/ssh/unit-test/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007-2008 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported Signatures == *) 8 | 9 | signature UNIT_TEST = UNIT_TEST 10 | 11 | (** == Exported Structures == *) 12 | 13 | structure UnitTest : UNIT_TEST = UnitTest 14 | -------------------------------------------------------------------------------- /com/ssh/windows/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported signatures == *) 8 | 9 | signature WINDOWS = WINDOWS 10 | signature WINDOWS_EX = WINDOWS_EX 11 | 12 | (** == Exported structures == *) 13 | 14 | structure Windows : WINDOWS_EX = Windows 15 | -------------------------------------------------------------------------------- /com/sweeks/async/unstable/lib.mlb: -------------------------------------------------------------------------------- 1 | ../../basic/unstable/lib.mlb 2 | async.sig 3 | async.sml 4 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2006 Stephen Weeks. 2 | # 3 | # This code is released under the MLton license, a BSD-style license. 4 | # See the LICENSE file or http://mlton.org/License for details. 5 | 6 | EXPORT: $(shell mlton -stop f lib.mlb) 7 | mlton -show-basis EXPORT -stop tc lib.mlb 8 | 9 | TAGS: *.fun *.sig *.sml 10 | etags *.{fun,sig,sml} 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/array-slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature ARRAY_SLICE = sig 7 | 8 | include SLICE 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/array.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature ARRAY = sig 7 | 8 | type 'a t 9 | 10 | include GENERIC_ARRAY where type 'a t0 = 'a t 11 | 12 | end 13 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/bit-flags.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | functor BitFlags (S: BASIS_BIT_FLAGS): BIT_FLAGS = struct 7 | 8 | open S 9 | 10 | type t = flags 11 | 12 | fun difference (f1, f2) = clear (f2, f1) 13 | val doIntersect = anySet 14 | val isSubset = allSet 15 | val union = flags 16 | 17 | end 18 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/bit-flags.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature BIT_FLAGS = sig 7 | 8 | type t 9 | (** 10 | * A set of flags. 11 | *) 12 | 13 | val all: t 14 | val difference: t * t -> t 15 | val doIntersect: t * t -> Bool.t 16 | val fromWord: SysWord.t -> t 17 | val intersect: t List.t -> t 18 | val isSubset: t * t -> Bool.t 19 | val toWord: t -> SysWord.t 20 | val union: t List.t -> t 21 | 22 | end 23 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/bool.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature BOOL = sig 7 | 8 | datatype t = datatype Bool.t 9 | 10 | val not: t -> t 11 | (** 12 | * not true = false. not false = true. 13 | *) 14 | 15 | end 16 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/bool.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Bool: BOOL = struct 7 | 8 | datatype t = datatype Bool.t 9 | 10 | val not = not 11 | 12 | end 13 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/dir.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature DIR = sig 7 | 8 | structure Stream: sig 9 | type t 10 | 11 | val close: t -> Unit.t 12 | val read: t -> String.t Option.t 13 | val rewind: t -> Unit.t 14 | end 15 | 16 | type t = String.t 17 | 18 | val changeTo: t -> Unit.t 19 | val create: t -> Unit.t 20 | val current: Unit.t -> t 21 | val openStream: t -> Stream.t 22 | val remove: t -> Unit.t 23 | 24 | end 25 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/endian.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature ENDIAN = sig 7 | 8 | datatype t = Big | Little 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/endian.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Endian: ENDIAN = struct 7 | 8 | datatype t = Big | Little 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/enumerate-get.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | functor EnumerateGet (S: GET): ENUMERATE = struct 7 | 8 | open S 9 | type 'a const = Unit.t 10 | type 'a state = 'a t 11 | fun start s = ((), s) 12 | fun next ((), s) = get s 13 | 14 | end 15 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/enumerate.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature ENUMERATE = sig 7 | type 'a const 8 | type 'a elem 9 | type 'a state 10 | type 'a t 11 | val start: 'a t -> 'a const * 'a state 12 | val next: 'a const * 'a state -> ('a elem * 'a state) Option.t 13 | end 14 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/generic-vector.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature GENERIC_VECTOR = sig 7 | 8 | include SEQUENCE 9 | 10 | val make: Int.t -> {done: Unit.t -> 'a t0, 11 | sub: Int.t -> 'a elem, 12 | update: Int.t * 'a elem -> Unit.t} 13 | 14 | structure Unsafe: 15 | sig 16 | val sub: 'a t0 * Int.t -> 'a elem 17 | end 18 | 19 | end 20 | 21 | 22 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/get.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature GET = sig 7 | type 'a elem 8 | type 'a t 9 | val get: 'a t -> ('a elem * 'a t) Option.t 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/int-inf.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature INT_INF = sig 7 | include INT 8 | end 9 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/int-inf.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure IntInf: INT_INF = struct 7 | 8 | open IntInf 9 | 10 | local 11 | structure S = Int (IntInf) 12 | in 13 | open S 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/int.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | local 7 | open Basis 8 | in 9 | structure Int = Int (Int) 10 | structure Int8 = Int (Int8) 11 | structure Int16 = Int (Int16) 12 | structure Int32 = Int (Int32) 13 | structure Int64 = Int (Int64) 14 | structure LargeInt = Int (LargeInt) 15 | structure Position = Int (Position) 16 | end 17 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/io-desc.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature IO_DESC = sig 7 | 8 | structure Kind: sig 9 | type t 10 | 11 | val == : t * t -> Bool.t 12 | val device: t 13 | val dir: t 14 | val file: t 15 | val pipe: t 16 | val socket: t 17 | val symlink: t 18 | val tty: t 19 | end 20 | 21 | type t 22 | 23 | val hash: t -> Word.t 24 | val compare: t * t -> Order.t 25 | 26 | end 27 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/io-desc.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure IoDesc: IO_DESC = struct 7 | 8 | open OS.IO 9 | 10 | structure Kind = struct 11 | open OS.IO.Kind 12 | 13 | type t = iodesc_kind 14 | 15 | val == = op = 16 | end 17 | 18 | type t = iodesc 19 | 20 | val compare = Order.ofBasis o compare 21 | 22 | end 23 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/lazy.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature LAZY = sig 7 | 8 | val memo: 'a thunk -> 'a thunk 9 | (** 10 | * memo f returns a function g that, the first time it is called, calls f, 11 | * caches the value, and upon subsequent calls returns the cached value. 12 | *) 13 | 14 | end 15 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/lazy.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Lazy: LAZY = struct 7 | 8 | fun memo th = let 9 | val r = ref None 10 | in 11 | fn () => 12 | case !r of 13 | None => let 14 | val a = th () 15 | val () = r := Some a 16 | in 17 | a 18 | end 19 | | Some a => a 20 | end 21 | 22 | end 23 | 24 | val lazy = Lazy.memo 25 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/list.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature LIST = sig 7 | 8 | datatype t = datatype List.t 9 | (** 10 | * SML's built-in list type. 11 | *) 12 | 13 | include SEQUENCE where type 'a t0 = 'a t 14 | 15 | 16 | end 17 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/mono-array.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature MONO_ARRAY = sig 7 | 8 | type t 9 | 10 | include GENERIC_ARRAY where type 'a t0 = t 11 | 12 | end 13 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/mono-slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature MONO_SLICE = sig 7 | 8 | type t 9 | 10 | include GENERIC_SLICE where type 'a t0 = t 11 | 12 | end 13 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/mono-vector-slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature MONO_VECTOR_SLICE = sig 7 | 8 | include MONO_SLICE 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/mono-vector.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature MONO_VECTOR = sig 7 | 8 | type t 9 | 10 | include GENERIC_VECTOR where type 'a t0 = t 11 | 12 | end 13 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/option.1.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Option = struct 7 | 8 | open Option 9 | 10 | val toSeq = 11 | fn None => Seq.empty () 12 | | Some x => Seq.single x 13 | 14 | end 15 | 16 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/order.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature ORDER = sig 7 | 8 | datatype t = Equal | Greater | Less 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/packable-real.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature PACKABLE_REAL = sig 7 | 8 | include REAL 9 | 10 | val ofBytes: Word8.t Vector.t * Endian.t -> t 11 | val subArr: Word8.t Array.t * Int.t * Endian.t -> t 12 | val subVec: Word8.t Vector.t * Int.t * Endian.t -> t 13 | val toBytes: t * Endian.t -> Word8.t vector 14 | val update: Word8.t Array.t * Int.t * t * Endian.t -> Unit.t 15 | 16 | end 17 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/packable-word.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature PACKABLE_WORD = sig 7 | 8 | include WORD 9 | 10 | val subArr: Word8.t Array.t * Int.t * Endian.t -> t 11 | val subVec: Word8.t Vector.t * Int.t * Endian.t -> t 12 | val update: Word8.t Array.t * Int.t * t * Endian.t -> Unit.t 13 | 14 | end 15 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/primitive.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Primitive = struct 7 | 8 | structure Array = struct 9 | val array = _prim "Array_array": int -> 'a array; 10 | (* Don't mutate the array after you apply fromArray, because vectors 11 | * are supposed to be immutable and the optimizer depends on this. 12 | *) 13 | val toVector = _prim "Array_toVector": 'a array -> 'a vector; 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/process.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Process: PROCESS = struct 7 | 8 | structure Status = struct 9 | open OS.Process 10 | 11 | type t = status 12 | end 13 | 14 | open OS.Process 15 | 16 | val getEnv = Option.ofBasis o getEnv 17 | 18 | end 19 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/radix.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature RADIX = sig 7 | 8 | type t 9 | (** 10 | * A radix used for integer<->string conversions. 11 | *) 12 | 13 | val bin: t 14 | val dec: t 15 | val hex: t 16 | val oct: t 17 | 18 | val toString: t -> String.t 19 | (** 20 | * toString r returns a human-readable string for r. 21 | *) 22 | 23 | end 24 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/ref.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature REF = sig 7 | 8 | datatype t = datatype Ref.t 9 | (** 10 | * SML's reference type. 11 | *) 12 | 13 | val ! : 'a t -> 'a 14 | (** 15 | * !r returns the value stored in r. 16 | *) 17 | val := : 'a t * 'a -> Unit.t 18 | (** 19 | * r := v changes the value in r to v. 20 | *) 21 | 22 | end 23 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/ref.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Ref: REF = struct 7 | 8 | datatype t = datatype Ref.t 9 | 10 | val ! = ! 11 | val op := = op := 12 | 13 | end 14 | 15 | local 16 | open Ref 17 | in 18 | val ! = ! 19 | val op := = op := 20 | end 21 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/scanner.0.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Scanner = struct 7 | 8 | datatype 'a t = T of Char.t Seq.t -> ('a * Char.t Seq.t) Option.t 9 | 10 | val make = T 11 | 12 | fun scan (T s, cs) = s cs 13 | 14 | end 15 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/seq.0.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Seq = struct 7 | 8 | local 9 | datatype 'a t = T of Unit.t -> ('a * 'a t) Option.t 10 | in 11 | type 'a t = 'a t 12 | 13 | fun get (T f) = f () 14 | 15 | fun delay f = T (get o f) 16 | 17 | fun empty () = T (fn () => None) 18 | 19 | fun cons (x, s) = T (fn () => Some (x, s)) 20 | end 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature SLICE = sig 7 | 8 | type 'a t 9 | 10 | include GENERIC_SLICE where type 'a t0 = 'a t 11 | 12 | end 13 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/static-sum.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature STATIC_SUM = sig 7 | 8 | type ('a1, 'a2, 'b1, 'b2, 'c) u 9 | type ('a1, 'a2, 'b1, 'b2, 'c) t = Unit.t -> ('a1, 'a2, 'b1, 'b2, 'c) u 10 | 11 | val left: 'a1 -> ('a1, 'a2, 'b1, 'b2, 'a2) t 12 | val right: 'b1 -> ('a1, 'a2, 'b1, 'b2, 'b2) t 13 | val switch: ('a1, 'a2, 'b1, 'b2, 'c) t * ('a1 -> 'a2) * ('b1 -> 'b2) -> 'c 14 | 15 | end 16 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/static-sum.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure StaticSum:> STATIC_SUM = struct 7 | 8 | type ('a1, 'a2, 'b1, 'b2, 'c) u = ('a1 -> 'a2) * ('b1 -> 'b2) -> 'c 9 | type ('a1, 'a2, 'b1, 'b2, 'c) t = Unit.t -> ('a1, 'a2, 'b1, 'b2, 'c) u 10 | 11 | fun left a1 = fn () => fn (f, _) => f a1 12 | fun right b1 = fn () => fn (_, f) => f b1 13 | fun switch (f, l, r) = f () (l, r) 14 | 15 | end 16 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/string.0.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure String = struct 7 | 8 | open String 9 | 10 | fun toSeq s = 11 | Seq.unfold (0, fn i => 12 | if i = size s then 13 | None 14 | else 15 | Some (String.sub (s, i), i + 1)) 16 | 17 | end 18 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/string.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature STRING = sig 7 | 8 | include MONO_VECTOR where type 'a elem = Char.t 9 | 10 | val hasPrefix: t * t -> Bool.t 11 | val ofWord8Vector: Word8.t Vector.t -> t 12 | val toLower: t -> t 13 | val toUpper: t -> t 14 | val toWord8Vector: t -> Word8.t Vector.t 15 | 16 | end 17 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/substring.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature SUBSTRING = sig 7 | 8 | include MONO_VECTOR_SLICE where type 'a elem = Char.t 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/substring.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Substring: SUBSTRING = struct 7 | 8 | open VectorSlice 9 | 10 | type 'a elem = Char.t 11 | type t = Char.t t 12 | type 'a t0 = t 13 | type 'a base = String.t 14 | 15 | end 16 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/thunk.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature THUNK = sig 7 | 8 | type 'a t = Unit.t -> 'a 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/thunk.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Thunk: THUNK = struct 7 | 8 | type 'a t = Unit.t -> 'a 9 | 10 | end 11 | 12 | type 'a thunk = 'a Thunk.t 13 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/unit.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature UNIT = sig 7 | 8 | type t 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/unit.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Unit: UNIT = struct 7 | 8 | type t = Unit.t 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/util.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | structure Util: UTIL = struct 7 | 8 | fun const c _ = c 9 | 10 | fun die s = raise Fail s 11 | 12 | fun id x = x 13 | 14 | fun (f o g) x = f (g x) 15 | 16 | fun pass x f = f x 17 | 18 | fun recur (x, f) = let fun loop x = f (x, loop) in loop x end 19 | 20 | fun fst (a, _) = a 21 | 22 | fun snd (_, b) = b 23 | 24 | end 25 | 26 | open Util 27 | 28 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/vector-slice.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature VECTOR_SLICE = sig 7 | 8 | include SLICE 9 | 10 | end 11 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/vector.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature VECTOR = sig 7 | 8 | type 'a t 9 | 10 | include GENERIC_VECTOR where type 'a t0 = 'a t 11 | 12 | end 13 | -------------------------------------------------------------------------------- /com/sweeks/basic/unstable/word8.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Stephen Weeks. 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | signature WORD8 = sig 7 | include WORD 8 | 9 | val toChar: t -> Char.t 10 | end 11 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/.gitignore: -------------------------------------------------------------------------------- 1 | .ignore -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/.ignore: -------------------------------------------------------------------------------- 1 | GLUT_h.h 2 | GLU_h.h 3 | GL_h.h 4 | atom 5 | bits 6 | blender 7 | hello 8 | menus 9 | molehill 10 | points 11 | shortest 12 | solar 13 | spin_cube 14 | triangle 15 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/GL.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | 3 | GL.sig 4 | GL.sml 5 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/GLU.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | GL.cm 3 | GLU.sig 4 | GLU.sml 5 | 6 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/GLUT.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | GL.cm 3 | GLUT.sig 4 | GLUT.sml 5 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/GLU_c.c: -------------------------------------------------------------------------------- 1 | /* GLU-export.c */ 2 | #include "platform.h" 3 | #include "GLU_h.h" 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/GL_c.c: -------------------------------------------------------------------------------- 1 | /* Gl-export.c */ 2 | #include "platform.h" 3 | #include "GL_h.h" 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/atom.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | atom.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/bits.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | bits.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/blender.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | blender.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/hello.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | hello.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/menus.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | menus.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/molehill.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | molehill.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/opengl.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | GL.cm 3 | GLU.cm 4 | GLUT.cm 5 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/platform.h: -------------------------------------------------------------------------------- 1 | #if defined(__APPLE__) && defined(__MACH__) 2 | #include 3 | #include 4 | #include 5 | #else 6 | #include 7 | #include 8 | #include 9 | #endif 10 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/points.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | points.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/shortest.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | shortest.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/shortest.sml: -------------------------------------------------------------------------------- 1 | open GL; 2 | open GLUT; 3 | 4 | fun display () = ( 5 | glClearColor 0.0 0.0 1.0 1.0; 6 | glClear GL_COLOR_BUFFER_BIT; 7 | glFlush() 8 | ) 9 | 10 | fun main () = 11 | ( 12 | glutInit(); 13 | glutCreateWindow "Short Test"; 14 | glutDisplayFunc display; 15 | print("Click the close icon to close the window."); 16 | glutMainLoop() 17 | ) 18 | 19 | val _ = main(); 20 | 21 | -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/solar.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | solar.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/spin_cube.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | spin_cube.sml -------------------------------------------------------------------------------- /org/mlton/mike/opengl/unstable/triangle.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | opengl.cm 3 | triangle.sml -------------------------------------------------------------------------------- /org/mlton/vesak/ds/unstable/detail/ml/smlnj/unsealed.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group is 8 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 9 | ../../../public/hash-map.sig 10 | ../../../public/linked-queue.sig 11 | ../../../public/node.sig 12 | ../../../public/queue.sig 13 | ../../../public/unlinkable-list.sig 14 | ../../hash-map.sml 15 | ../../linked-queue.sml 16 | ../../node.sml 17 | ../../unlinkable-list.sml 18 | -------------------------------------------------------------------------------- /org/mlton/vesak/ds/unstable/lib.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(public/export.sml) 9 | is 10 | detail/ml/smlnj/unsealed.cm 11 | public/export.sml 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/ds/unstable/lib.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "public/node.sig", 9 | "detail/node.sml", 10 | "public/queue.sig", 11 | "public/linked-queue.sig", 12 | "detail/linked-queue.sml", 13 | "public/unlinkable-list.sig", 14 | "detail/unlinkable-list.sml", 15 | "public/hash-map.sig", 16 | "detail/hash-map.sml", 17 | "public/export.sml"] ; 18 | -------------------------------------------------------------------------------- /org/mlton/vesak/ds/unstable/public/hash-map.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature HASH_MAP = sig 8 | type ('a, 'b) t 9 | val new : {eq : 'a BinPr.t, hash : 'a -> Word.t} -> ('a, 'b) t 10 | val size : ('a, 'b) t -> Int.t 11 | val insert : ('a, 'b) t -> ('a * 'b) Effect.t 12 | val find : ('a, 'b) t -> 'a -> 'b Option.t 13 | end 14 | -------------------------------------------------------------------------------- /org/mlton/vesak/ds/unstable/public/linked-queue.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature LINKED_QUEUE = sig 8 | include QUEUE 9 | val filter : 'a UnPr.t -> 'a t Effect.t 10 | val filterOut : 'a UnPr.t -> 'a t Effect.t 11 | end 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/ds/unstable/public/queue.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** Signature for imperative polymorphic queues. *) 8 | signature QUEUE = sig 9 | type 'a t 10 | 11 | val new : 'a t Thunk.t 12 | 13 | val isEmpty : 'a t UnPr.t 14 | 15 | val length : 'a t -> Int.t 16 | 17 | val deque : 'a t -> 'a Option.t 18 | val enque : 'a t -> 'a Effect.t 19 | 20 | val appClear : 'a Effect.t -> 'a t Effect.t 21 | end 22 | -------------------------------------------------------------------------------- /org/mlton/vesak/ds/unstable/public/unlinkable-list.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature UNLINKABLE_LIST = sig 8 | type 'a t 9 | 10 | val new : 'a t Thunk.t 11 | 12 | val pushFront : 'a t -> 'a -> Unit.t Effect.t 13 | val pushBack : 'a t -> 'a -> Unit.t Effect.t 14 | 15 | val popFront : 'a t -> 'a Option.t 16 | val popBack : 'a t -> 'a Option.t 17 | end 18 | -------------------------------------------------------------------------------- /org/mlton/vesak/libc/unstable/libc.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2006 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | generated/$(TARGET_ARCH)-$(TARGET_OS)/config/lib.mlb 8 | generated/$(TARGET_ARCH)-$(TARGET_OS)/std/lib.mlb 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/libc/unstable/public/errno.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2006 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | */ 6 | 7 | CONSTANT(EDOM , int) 8 | CONSTANT(EILSEQ , int) 9 | CONSTANT(ERANGE , int) 10 | 11 | PSEUDO_VARIABLE(errno , int) 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/math3d/unstable/detail/ml/polyml.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | -------------------------------------------------------------------------------- /org/mlton/vesak/math3d/unstable/lib.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib-no-infixes.mlb 8 | public/export/infixes.sml 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/math3d/unstable/public/export/mlton.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported Structures for MLton == *) 8 | 9 | structure Vec2F : VEC = Vec2F 10 | structure Vec3F : VEC3 = Vec3F 11 | structure Vec4F : VEC = Vec4F 12 | 13 | structure QuatF : QUAT = QuatF 14 | structure RotF : ROT = RotF 15 | structure RBTF : RBT = RBTF 16 | 17 | structure PlaneF : PLANE = PlaneF 18 | -------------------------------------------------------------------------------- /org/mlton/vesak/math3d/unstable/public/export/polyml.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported Structures for Poly ML == *) 8 | -------------------------------------------------------------------------------- /org/mlton/vesak/math3d/unstable/public/scalar.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature SCALAR = sig 8 | include REAL 9 | val t : t Rep.t 10 | end 11 | -------------------------------------------------------------------------------- /org/mlton/vesak/parsec/unstable/detail/ml/smlnj/unsealed.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | group is 8 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 9 | ../../../public/parsec.sig 10 | ../../../public/sequence.sig 11 | ../../mk-parsec.fun 12 | ../../string-sequence.sml 13 | -------------------------------------------------------------------------------- /org/mlton/vesak/parsec/unstable/lib.cm: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | library 8 | source(public/export.sml) 9 | is 10 | $MLTON_LIB/com/ssh/extended-basis/unstable/basis.cm 11 | detail/ml/smlnj/unsealed.cm 12 | public/export.sml 13 | -------------------------------------------------------------------------------- /org/mlton/vesak/parsec/unstable/lib.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "public/sequence.sig", 9 | "detail/string-sequence.sml", 10 | "public/parsec.sig", 11 | "detail/mk-parsec.fun", 12 | "public/export.sml"] ; 13 | -------------------------------------------------------------------------------- /org/mlton/vesak/parsec/unstable/test.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 8 | $(MLTON_LIB)/com/ssh/unit-test/unstable/lib.mlb 9 | lib.mlb 10 | 11 | $(APPLICATION)/generic.mlb 12 | 13 | ann 14 | "nonexhaustiveExnMatch ignore" 15 | "sequenceNonUnit warn" 16 | "warnUnused true" 17 | in 18 | test/parsec.sml 19 | end 20 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/detail/common.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "${MLTON_LIB}/com/ssh/generic/unstable/lib.use", 9 | "${MLTON_LIB}/com/ssh/async/unstable/lib.use", 10 | "${MLTON_LIB}/com/ssh/async/unstable/example/poll-loop/lib.use", 11 | "${APPLICATION}/generic.use", 12 | "socket-events.sml", 13 | "protocol.sml"] ; 14 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/example/assoc/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2008 Vesa Karvonen 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "RPC-lib example" 8 | :shell "nice -n5 ./Build.sh") 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/example/assoc/client.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 8 | $(MLTON_LIB)/org/mlton/vesak/rpc-lib/unstable/lib-client.mlb 9 | 10 | $(APPLICATION)/generic.mlb 11 | 12 | ann 13 | "forceUsed" 14 | "sequenceNonUnit warn" 15 | "warnUnused true" 16 | in 17 | local 18 | common.sml 19 | client.sml 20 | in 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/example/assoc/client.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "${MLTON_LIB}/org/mlton/vesak/rpc-lib/unstable/lib-client.use", 9 | "${APPLICATION}/generic.use", 10 | "common.sml", 11 | "client.sml"] ; 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/example/assoc/server.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 8 | $(MLTON_LIB)/org/mlton/vesak/rpc-lib/unstable/lib-server.mlb 9 | 10 | $(APPLICATION)/generic.mlb 11 | 12 | ann 13 | "forceUsed" 14 | "sequenceNonUnit warn" 15 | "warnUnused true" 16 | in 17 | local 18 | common.sml 19 | server.sml 20 | in 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/example/assoc/server.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/com/ssh/extended-basis/unstable/basis.use", 8 | "${MLTON_LIB}/org/mlton/vesak/rpc-lib/unstable/lib-server.use", 9 | "${APPLICATION}/generic.use", 10 | "common.sml", 11 | "server.sml"] ; 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/lib-client.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | detail/common.mlb 9 | in 10 | ann 11 | "forceUsed" 12 | "sequenceNonUnit warn" 13 | "warnUnused true" 14 | in 15 | local 16 | public/protocol.sig 17 | 18 | public/client/client.sig 19 | detail/client.sml 20 | in 21 | public/client/export.sml 22 | end 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/lib-client.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["detail/common.use", 8 | "public/protocol.sig", 9 | "public/client/client.sig", 10 | "detail/client.sml", 11 | "public/client/export.sml"] ; 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/lib-server.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["${MLTON_LIB}/org/mlton/vesak/ds/unstable/lib.use", 8 | "detail/common.use", 9 | "public/protocol.sig", 10 | "public/server/server.sig", 11 | "detail/server.sml", 12 | "public/server/export.sml"] ; 13 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/public/client/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature CLIENT = CLIENT 8 | structure Client : CLIENT = Client 9 | 10 | signature PROTOCOL = PROTOCOL 11 | structure Protocol : PROTOCOL = Protocol 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/rpc-lib/unstable/public/server/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature SERVER = SERVER 8 | structure Server : SERVER = Server 9 | 10 | signature PROTOCOL = PROTOCOL 11 | structure Protocol : PROTOCOL = Protocol 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/sdl/unstable/example/bounce/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2007 Vesa Karvonen 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "Bounce SDL example" 8 | :shell "nice -n 10 ./Build.sh") 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/sdl/unstable/example/bounce/bounce.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | $(MLTON_LIB)/com/ssh/random/unstable/lib.mlb 10 | ../../lib.mlb 11 | 12 | ann 13 | "sequenceNonUnit warn" 14 | "warnUnused true" 15 | in 16 | bounce.sml 17 | end 18 | in 19 | end 20 | -------------------------------------------------------------------------------- /org/mlton/vesak/sdl/unstable/example/bounce/chest.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MLton/mltonlib/c79683d8cb8a5ce76a79d165fae76cb4ac767f2c/org/mlton/vesak/sdl/unstable/example/bounce/chest.bmp -------------------------------------------------------------------------------- /org/mlton/vesak/sdl/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported Signatures == *) 8 | 9 | signature SDL = SDL 10 | signature SDL_KEY_SYM = SDL_KEY_SYM 11 | 12 | (** == Exported Structures == *) 13 | 14 | structure SDL : SDL = SDL 15 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/cermlang/example/echo.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | ../lib/lib.mlb 10 | 11 | ann "nonexhaustiveExnMatch ignore" in 12 | echo.sml 13 | end 14 | in 15 | end 16 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/cermlang/lib/infixes.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | infix <- 8 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/cermlang/lib/lib.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | $(SML_LIB)/cml/cml.mlb 10 | in 11 | ann 12 | "forceUsed" 13 | "warnUnused true" 14 | "sequenceNonUnit warn" 15 | in 16 | infixes.sml 17 | cermlang.sig 18 | cermlang.sml 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/framework/any.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature ANY = sig 8 | type 'a t 9 | val partOf : 'a t -> Unit.t t 10 | val getSub : 'a t -> 'a 11 | val mapSub : ('a -> 'b) -> 'a t -> 'b t 12 | end 13 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/framework/any.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Any : ANY = struct 8 | type 'a t = 'a 9 | fun partOf _ = () 10 | val getSub = id 11 | val mapSub = id 12 | end 13 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/framework/lib.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(SML_LIB)/basis/basis.mlb 8 | prelude.sml 9 | any.sig 10 | any.sml 11 | sub.fun 12 | var.sml 13 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/framework/lib.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["prelude.sml", 8 | "any.sig", 9 | "any.sml", 10 | "sub.fun", 11 | "var.sml"] ; 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/framework/sub.fun: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | functor Sub (include ANY type x) : sig 8 | include ANY 9 | val its : (x -> 'r) -> 'a t -> 'r 10 | end = struct 11 | type 'a t = ('a, x) Product.t t 12 | fun partOf d = mapSub (Product.mapFst ignore) d 13 | fun its f d = f (Product.snd (getSub d)) 14 | val getSub = fn d => Product.fst (getSub d) 15 | val mapSub = fn f => mapSub (Product.mapFst f) 16 | end 17 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/framework/var.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | structure Var = struct 8 | type 'a t = {get : 'a Thunk.t, set : 'a Effect.t} 9 | fun new v = let 10 | val r = ref v 11 | in 12 | {get = fn () => !r, 13 | set = fn v => r := v} 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/imperative-shapes/circle.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature CIRCLE = sig 8 | include SHAPE 9 | val getR : 'a t -> Int.t 10 | val setR : 'a t -> Int.t Effect.t 11 | end 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/imperative-shapes/main.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | ../framework/lib.mlb 9 | 10 | shape.sig 11 | shape.sml 12 | circle.sig 13 | circle.sml 14 | rectangle.sig 15 | rectangle.sml 16 | main.sml 17 | in 18 | end 19 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/imperative-shapes/main.use: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | lib ["../framework/lib.use", 8 | "shape.sig", 9 | "shape.sml", 10 | "circle.sig", 11 | "circle.sml", 12 | "rectangle.sig", 13 | "rectangle.sml", 14 | "main.sml"] ; 15 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/imperative-shapes/rectangle.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature RECTANGLE = sig 8 | include SHAPE 9 | val getH : 'a t -> Int.t 10 | val getW : 'a t -> Int.t 11 | val setH : 'a t -> Int.t Effect.t 12 | val setW : 'a t -> Int.t Effect.t 13 | end 14 | -------------------------------------------------------------------------------- /org/mlton/vesak/tech/oo/imperative-shapes/shape.sig: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | signature SHAPE = sig 8 | include ANY 9 | val getX : 'a t -> Int.t 10 | val getY : 'a t -> Int.t 11 | val setX : 'a t -> Int.t Effect.t 12 | val setY : 'a t -> Int.t Effect.t 13 | val draw : 'a t Effect.t 14 | val moveTo : 'a t -> Int.t Sq.t Effect.t 15 | val rMoveTo : 'a t -> Int.t Sq.t Effect.t 16 | end 17 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/ant/serial/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2008 Vesa Karvonen 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "Ant" 8 | :shell "nice -n5 make run") 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/ant/serial/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2008 Vesa Karvonen 2 | # 3 | # This code is released under the MLton license, a BSD-style license. 4 | # See the LICENSE file or http://mlton.org/License for details. 5 | 6 | name := ant 7 | args := 1 5 200 200 8 | 9 | root := ../../../../../.. 10 | 11 | mlton-opts := -align 8 -loop-passes 4 12 | 13 | include ../../common.mk 14 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/ant/serial/ant.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 8 | $(MLTON_LIB)/com/ssh/random/unstable/lib.mlb 9 | 10 | local 11 | ann 12 | "warnUnused true" 13 | "sequenceNonUnit warn" 14 | in 15 | ant.sml 16 | end 17 | in 18 | end 19 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/chameneos/async/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2007 Vesa Karvonen 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "Chameneos" 8 | :shell "nice -n5 make run") 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/chameneos/async/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007-2008 Vesa Karvonen 2 | # 3 | # This code is released under the MLton license, a BSD-style license. 4 | # See the LICENSE file or http://mlton.org/License for details. 5 | 6 | name := chameneos 7 | args := @MLton fixed-heap 1.5m -- 5000000 8 | 9 | root := ../../../../../.. 10 | 11 | mlton-opts := -loop-passes 2 12 | 13 | include ../../common.mk 14 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/chameneos/async/chameneos.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007-2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 8 | $(MLTON_LIB)/com/ssh/async/unstable/lib.mlb 9 | 10 | local 11 | ann 12 | "sequenceNonUnit error" 13 | "warnUnused true" 14 | in 15 | chameneos.sml 16 | end 17 | in 18 | end 19 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/cheap-concurrency/async/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2007 Vesa Karvonen 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "Cheap Concurrency" 8 | :shell "nice -n5 make run") 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/cheap-concurrency/async/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 Vesa Karvonen 2 | # 3 | # This code is released under the MLton license, a BSD-style license. 4 | # See the LICENSE file or http://mlton.org/License for details. 5 | 6 | name := cheap-concurrency 7 | args := 15000 8 | 9 | root := ../../../../../.. 10 | 11 | include ../../common.mk 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/cheap-concurrency/async/cheap-concurrency.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007-2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 8 | $(MLTON_LIB)/com/ssh/async/unstable/lib.mlb 9 | 10 | local 11 | ann 12 | "sequenceNonUnit error" 13 | "warnUnused true" 14 | in 15 | cheap-concurrency.sml 16 | end 17 | in 18 | end 19 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/n-body/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2007 Vesa Karvonen 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "N-Body Simultation" 8 | :shell "nice -n5 make run") 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/n-body/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 Vesa Karvonen 2 | # 3 | # This code is released under the MLton license, a BSD-style license. 4 | # See the LICENSE file or http://mlton.org/License for details. 5 | 6 | name := n-body 7 | args := 20000000 8 | 9 | root := ../../../../.. 10 | 11 | mlton-opts := -align 8 -loop-passes 2 12 | 13 | include ../common.mk 14 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/n-body/n-body.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007-2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 8 | $(MLTON_LIB)/org/mlton/vesak/math3d/unstable/lib.mlb 9 | 10 | local 11 | ann 12 | "warnUnused true" 13 | "sequenceNonUnit warn" 14 | in 15 | n-body.sml 16 | end 17 | in 18 | end 19 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/simplify/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2007 Vesa Karvonen 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "Simplify" 8 | :shell "nice -n5 make run") 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/simplify/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2007 Vesa Karvonen 2 | # 3 | # This code is released under the MLton license, a BSD-style license. 4 | # See the LICENSE file or http://mlton.org/License for details. 5 | 6 | name := simplify 7 | args := 10000000 8 | 9 | root := ../../../../.. 10 | 11 | include ../common.mk 12 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/simplify/simplify.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | local 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | 10 | ann 11 | "sequenceNonUnit error" 12 | "warnUnused true" 13 | in 14 | rational.sml 15 | simplify.sml 16 | bench.sml 17 | end 18 | in 19 | end 20 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/spectral-norm/Build.bgb: -------------------------------------------------------------------------------- 1 | ;; Copyright (C) 2008 Vesa Karvonen 2 | ;; 3 | ;; This code is released under the MLton license, a BSD-style license. 4 | ;; See the LICENSE file or http://mlton.org/License for details. 5 | 6 | (bg-build 7 | :name "Spectral Norm" 8 | :shell "nice -n5 make run") 9 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/spectral-norm/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2008 Vesa Karvonen 2 | # 3 | # This code is released under the MLton license, a BSD-style license. 4 | # See the LICENSE file or http://mlton.org/License for details. 5 | 6 | name := spectral-norm 7 | args := 5500 8 | 9 | root := ../../../../.. 10 | 11 | mlton-opts := -align 8 -loop-passes 2 12 | 13 | include ../common.mk 14 | -------------------------------------------------------------------------------- /org/mlton/vesak/toys/spectral-norm/spectral-norm.mlb: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | $(SML_LIB)/basis/unsafe.mlb 8 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 9 | 10 | local 11 | ann 12 | "warnUnused true" 13 | "sequenceNonUnit warn" 14 | in 15 | spectral-norm.sml 16 | end 17 | in 18 | end 19 | -------------------------------------------------------------------------------- /org/mlton/vesak/use-lib/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2007 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported Signatures == *) 8 | 9 | signature USE_LIB = USE_LIB 10 | 11 | (** == Exported Structures == *) 12 | 13 | structure UseLib : USE_LIB = UseLib 14 | 15 | (** == Exported Top-Level Values == *) 16 | 17 | val lib = UseLib.lib 18 | val use = UseLib.use 19 | -------------------------------------------------------------------------------- /org/mlton/vesak/var-ed/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | (* Copyright (C) 2008 Vesa Karvonen 2 | * 3 | * This code is released under the MLton license, a BSD-style license. 4 | * See the LICENSE file or http://mlton.org/License for details. 5 | *) 6 | 7 | (** == Exported Signatures == *) 8 | 9 | signature VAR_ED = VAR_ED 10 | 11 | (** == Exported Structures == *) 12 | 13 | structure VarEd : VAR_ED = VarEd 14 | -------------------------------------------------------------------------------- /org/mlton/ville/mersenne-twister/unstable/lib.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | 4 | public/rng.sig 5 | detail/mt-19937.sml 6 | in 7 | public/export.sml 8 | end 9 | -------------------------------------------------------------------------------- /org/mlton/ville/mersenne-twister/unstable/public/export.sml: -------------------------------------------------------------------------------- 1 | signature RNG = RNG 2 | structure MersenneTwister :> RNG = MersenneTwister 3 | -------------------------------------------------------------------------------- /org/mlton/ville/mersenne-twister/unstable/public/rng.sig: -------------------------------------------------------------------------------- 1 | (* 2 | * A minimal signature for an imperative random number generator 3 | * objects. 4 | *) 5 | signature RNG = sig 6 | type t 7 | 8 | val new: word -> t 9 | (** 10 | * Creates a new random number generator and seeds it with the 11 | * given seed. 12 | *) 13 | 14 | val rand: t -> word 15 | (** Returns the next 32 bit random number. *) 16 | 17 | end 18 | -------------------------------------------------------------------------------- /org/mlton/ville/mersenne-twister/unstable/test/first-5000.sml: -------------------------------------------------------------------------------- 1 | val () = let 2 | open MersenneTwister 3 | val mt = new 0w1234567890 4 | fun loop 5000 = () 5 | | loop i = 6 | (print (Word32.toString (rand mt)) 7 | ; if (i + 1) mod 8 = 0 then 8 | print "\n" 9 | else 10 | print " "; 11 | loop (i + 1)) 12 | val _ = loop 0 13 | in () end 14 | -------------------------------------------------------------------------------- /org/mlton/ville/mersenne-twister/unstable/tests.mlb: -------------------------------------------------------------------------------- 1 | local 2 | $(SML_LIB)/basis/basis.mlb 3 | 4 | lib.mlb 5 | test/first-5000.sml 6 | in 7 | end 8 | -------------------------------------------------------------------------------- /org/mlton/ville/misc/unstable/GNUmakefile: -------------------------------------------------------------------------------- 1 | $(info $(patsubst %.mlb,%,$(wildcard tests/*.mlb))) 2 | all : $(patsubst %.mlb,%,$(wildcard tests/*.mlb)) 3 | 4 | mlb-path-map = mlb-path-map 5 | mlb-path-map : GNUmakefile 6 | echo 'APPLICATION $(PWD)' > $@ 7 | echo 'MLTON_LIB $(MLTON_LIB)' >> $@ 8 | echo 'SML_COMPILER mlton' >> $@ 9 | 10 | mlton-opts = -const 'Exn.keepHistory true' 11 | 12 | include common.mk 13 | -include tests/*.dep 14 | -------------------------------------------------------------------------------- /org/mlton/ville/misc/unstable/common.mk: -------------------------------------------------------------------------------- 1 | mlton ?= mlton 2 | mltonlib-common-mk = $(lastword $(MAKEFILE_LIST)) 3 | 4 | % : %.mlb $(mltonlib-common-mk) $(mlb-deps) | $(mlb-path-map) 5 | $(mlton) -stop f -mlb-path-map $(mlb-path-map) $< \ 6 | | sed $$'s#\r##g' \ 7 | | awk 'BEGIN { srcs = "" ; printf "$@ :" } \ 8 | { srcs = srcs $$1 ":\n" ; printf " " $$1 } \ 9 | END { printf "\n" srcs }' \ 10 | > $@.dep 11 | $(mlton) @MLton $(mlton-args) -- -mlb-path-map $(mlb-path-map) \ 12 | $(mlton-opts) $< 13 | 14 | -include $(wildcard *.dep) 15 | -------------------------------------------------------------------------------- /org/mlton/ville/misc/unstable/detail/time-limit.sml: -------------------------------------------------------------------------------- 1 | structure TimeLimit :> TIME_LIMIT = struct 2 | 3 | fun atMost (time, f) = let 4 | val timer = Timer.startRealTimer () 5 | fun timedOut () = Time.>= (Timer.checkRealTimer timer, time) 6 | fun loop () = 7 | if f () then 8 | true 9 | else if timedOut () then 10 | false 11 | else 12 | loop () 13 | in 14 | loop () 15 | end 16 | 17 | fun spend (time, f) = ignore (atMost (time, fn () => (f () ; false))) 18 | 19 | end 20 | -------------------------------------------------------------------------------- /org/mlton/ville/misc/unstable/mlb-path-map: -------------------------------------------------------------------------------- 1 | APPLICATION /Users/ville/Projects/mltonlib/org/mlton/ville/misc/unstable 2 | MLTON_LIB /Users/ville/Projects/mltonlib 3 | SML_COMPILER mlton 4 | -------------------------------------------------------------------------------- /org/mlton/ville/misc/unstable/public/time-limit.sig: -------------------------------------------------------------------------------- 1 | signature TIME_LIMIT = sig 2 | val spend : Time.t * (unit -> unit) -> unit 3 | (** {spend (time, f)} calls {f} repeatedly until {time} has passed. *) 4 | 5 | val atMost : Time.t * (unit -> bool) -> bool 6 | (** 7 | * {atMost (time, f)} calls {f} repeatedly until it either returns 8 | * {true} or {time} has passed. Returns either {true} or {false}, 9 | * respectively. 10 | *) 11 | end 12 | -------------------------------------------------------------------------------- /org/mlton/ville/misc/unstable/tests/histogram-test.mlb: -------------------------------------------------------------------------------- 1 | $(MLTON_LIB)/com/ssh/extended-basis/unstable/basis.mlb 2 | $(MLTON_LIB)/com/ssh/unit-test/unstable/lib.mlb 3 | $(APPLICATION)/generic.mlb 4 | ../lib.mlb 5 | histogram-test.sml 6 | --------------------------------------------------------------------------------