3 ms·
Modules could have signatures and be parametrized. https://wiki.haskell.org/Module_signature https://wiki.haskell.org/Module_signature https://ocaml.org/learn
by neolog 5y ago
Modules could have signatures and be parametrized.
https://wiki.haskell.org/Module_signature https://wiki.haskell.org/Module_signature
https://ocaml.org/learn/tutorials/modules.html https://ocaml.org/learn/tutorials/modules.html
- adgjlsfhk1 5y agoI'm kind of unclear what module signatures would be since Julia lets code define modules at runtime, so I don't think this could be meaningfully defined for Julia.
- neolog 5y agoMaybe a better link is Clojure Spec and Racket module contracts. https://clojure.org/about/spec https://clojure.org/about/spec https://docs.racket-lang.org/reference/contracts.html https://docs.racket-lang.org/reference/contracts.html https://docs.racket-lang.org/style/Units_of_Code.html https://docs.racket-lang.org/style/Units_of_Code.html
- oxinabox 5y agoFor most intents and purposes one can use a (potentially Singleton) type passed as a argument to functions instead of a module containing functions. And doing that gets you all the tooling and power you could want. (But probably in a different way to you want it). Since multiple dispatch takes care of that. You can compare and contrast MLDatasets.jl (uses submodule per dataset) vs CorpusLoaders.jl (uses a extra type argument per dataset)