[Haskell-cafe] some ideas for Haskell', from Python

Immanuel Litzroth 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
in Haskell.
I runs the initialization code for the module & makes the names in that
module
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.
Immanuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090115/69755593/attachment.htm


More information about the Haskell-Cafe mailing list