[Haskell-cafe] some ideas for Haskell', from Python
immanuel203 at gmail.com
Thu Jan 15 06:52:05 EST 2009
> 2) In Python it is possible to import modules inside a function.
> In Haskell something like:
> joinPath' root name =
> joinPath [root, name]
> importing System.FilePath (joinPath)
In Python importing a module has totally different semantics from importing
I runs the initialization code for the module & makes the names in that
available to you code. In Haskell modules are just namespace control, and
you can always
refer to names imported through import X through the syntax X.name.
This means that the local import in Python solves two problems
1) making a name available locally.
2) running initialization code only when a specific function is called.
Neither of those makes any sense for Haskell as far as I can tell.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe