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

Lennart Augustsson lennart at augustsson.net
Wed Jan 14 11:41:24 EST 2009

When Haskell was designed there was a bried discussion (if my memory
serves me) to have import be a decl, so it could occur anywhere a
normal declaration can occur.
I kinda like the idea, but some people didn't and it never happened.

  -- Lennart

On Wed, Jan 14, 2009 at 3:12 PM, Neil Mitchell <ndmitchell at gmail.com> wrote:
> Hi
>> 1) In a Python string it is available the \U{name} escape, where name is
>>   a character name in the Unicode database.
>>   As an example:
>>       foo = u"abc\N{VULGAR FRACTION ONE HALF}"
> Hmm, looks nice, and sensible. But as soon as you've got \N{....} syntax I want:
> "foo\E{show i}bar"
> i.e. embed expressions in strings. I think this would be fantastic.
>> 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)
> Looks a bit ugly, but kind of useful. I'd make the syntax:
> joinPath' root name = joinPath [root,name]
>  where import System.FilePath(joinPath)
> It does mean you need to read an entire file to see what functions it
> imports, but perhaps that is the way it should be. I could also
> imagine a syntax:
> joinPath' root name = import.System.FilePath.joinPath [root,name]
> i.e. doing an import and use at the same time.
> Nice ideas, but they probably want implemented in a Haskell compiler
> and using in real life before they are ready for Haskell' like
> thoughts.
> Thanks
> Neil
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

More information about the Haskell-Cafe mailing list