Functional programming using SML/NJ

So I started collecting some basic SML ideas that are useful when one encounters a course website or a tool that is coded in SML/NJ. It is a work in progress.

The first aspect to consider is the IDE. Mine is now Doom Emacs. Why ?

group
(* CM allows you to selectively export defined modules (structures,
signatures and functors) by listing them here. It's useful for
libraries. *)

source (-) (* export all defined modules *)

structure Main (* OR, export selectively *)
signature FOO
functor Foo
structure Test(* OR, export selectively *)
signature THEOREM
functor Theorem
is
(* Import the SML standard library, aka Basis. *)
(* See: http://sml-family.org/Basis/ *)
$/basis.cm

(* Import the SML/NJ library *)
(* Provides extra data structures and algorithms. *)
(* See: https://www.smlnj.org/doc/smlnj-lib/Manual/toc.html *)
$/smlnj-lib.cm

(* List each source file you want to be considered for compilation. *)
./main.sml
./foo.sig
./foo.fun
./test.sml
./theorem.sig
./theorem.fun

The main purpose is a straightforward build and test environment. I don’t code SML but port it to Racket or OCaml. I copy pieces of code and test them. So here a _Functor_ is used only for convenience. There is no attempt to abstract anything.

And I will strive to add more details as I learn.