> 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
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to