2 ms·
Modules serve a useful purpose in Haskell too, since they can hide "dangerous" functions, ie. ones which violate invariants (which can't/aren't enforced by type
by chriswarbo 11y ago
Modules serve a useful purpose in Haskell too, since they can hide "dangerous" functions, ie. ones which violate invariants (which can't/aren't enforced by types, for whatever reason) when called in particular ways. This is similar to private methods of a class.
Personally, I dislike hiding such functions completely, and usually expose them via a ".Inner" module (similar to Python exposing "private" things with _underscores)