<div dir="ltr">Hi Cafe,<div><br></div><div>Let's say we have a module like</div><div><br></div><div>module Foo where</div><div><br></div><div>foo, bar :: String -> Something</div><div>...</div><div><br></div><div>and use it elsewhere as</div><div><br></div><div>import qualified Foo as F</div><div>...</div><div>F.foo ...</div><div><br></div><div>This is almost just if we had a data type defined as</div><div><br></div><div>data FooModule = FooModule { foo :: String -> Something, bar :: String -> Something }</div><div><br></div><div>together with a singleton `f : :FooModule` and referenced it as f.foo, f.bar etc.</div><div><br></div><div>Has some language explored this idea of making modules explicit as language-level objects? It seems that there could be some interesting possibilities, such as:</div><div><br></div><div>- Abstract modules (just a definition of the data type). Then</div><div>- Being able to replace a module with a different one (like a fake one for testing).</div><div>- Polymorphic modules that could be instantiated for specific types.</div><div><br></div><div>Thanks,</div><div>Petr</div></div>