You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A module could be passed as a named parameter to ADT constructor pattern. Such a construct would define a new local module containing all named parameters. The motivating example is to use encode kind of generative functors known from OCaml or SML, using just named parameters.
data Map Key = Map
{ T
, empty : {Val} ->[] T Val
, method add : {Val} -> T Val -> Key -> Val ->[] T Val
, method find : {Val} -> T Val -> Key ->[] Option Val
}
(* Functor-like function *)
let makeMap {Key} (compare : Key -> Key ->[] Ord) =
Map { ... }
(* Functor-like application: creating a new module StrMap that implements maps *)
let (Map { module StrMap }) = make String.compare
The text was updated successfully, but these errors were encountered:
A module could be passed as a named parameter to ADT constructor pattern. Such a construct would define a new local module containing all named parameters. The motivating example is to use encode kind of generative functors known from OCaml or SML, using just named parameters.
The text was updated successfully, but these errors were encountered: