On Wed, Jan 14, 2009 at 3:59 PM, Manlio Perillo
manlio_peri...@libero.it wrote:
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)
I just like to point
Yes, the Agda modules remind me of Cayenne. :)
On Tue, Jan 20, 2009 at 12:54 PM, Bas van Dijk v.dijk@gmail.com wrote:
On Wed, Jan 14, 2009 at 3:59 PM, Manlio Perillo
manlio_peri...@libero.it wrote:
2) In Python it is possible to import modules inside a function.
In Haskell something
On Wed, 2009-01-14 at 15:59 +0100, Manlio Perillo wrote:
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 = uabc\N{VULGAR FRACTION ONE HALF}
This is possible via QuasiQuotation, you can
Hello,
2009/1/16 Immanuel Litzroth immanuel...@gmail.com:
I don't understand your comment.
1) If XMonad already uses it the problem is solved, without giving Haskell
import new semantics?
Right, but there are some restrictions.
2) These guys refer to a method to do plugin work in Haskell
Artyom Shalkhakov ha scritto:
[...]
Prelude :l foo.hs
[1 of 1] Compiling Main ( foo.hs, interpreted )
Ok, modules loaded: Main.
*Main isDirectory /var
interactive:1:0:
Ambiguous occurrence `isDirectory'
It could refer to either `Main.isDirectory', defined at foo.hs:6:0
Artyom Shalkhakov ha scritto:
Hi Manlio,
Hi Artyom.
Note that it seems you have sent this message only to me;
I'm sending the reply to both you and the mailing list.
2009/1/14 Manlio Perillo manlio_peri...@libero.it:
2) In Python it is possible to import modules inside a function.
In
Brandon S. Allbery KF8NH ha scritto:
[... about Python import local to functions ...]
Sometime they are necessary, to avoid circular import problems (but
this not a problem with Haskell).
...in theory. In practice GHC needs help with circular imports, and some
cycles might be impossible
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 = uabc\N{VULGAR FRACTION ONE HALF}
I think you can use quasi quotation of ghc to achieve this ?
Your code would look like this then:
let
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
On 2009 Jan 15, at 5:55, Manlio Perillo wrote:
Brandon S. Allbery KF8NH ha scritto:
[... about Python import local to functions ...]
Sometime they are necessary, to avoid circular import problems
(but this not a problem with Haskell).
...in theory. In practice GHC needs help with circular
Hi Immanuel,
2009/1/15 Immanuel Litzroth immanuel...@gmail.com:
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
Hi Manlio
2009/1/15 Manlio Perillo manlio_peri...@libero.it:
Note that it seems you have sent this message only to me;
I'm sending the reply to both you and the mailing list.
Yes, sorry, I always forget forwading to the mailing list. :(
By the way, here is a strange (for me) problem I hit,
Hi.
There are two features found in Python language, that I would like to
see in Haskell.
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 = uabc\N{VULGAR FRACTION ONE HALF}
2) In Python it is
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 = uabc\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.
2009/1/14 Neil Mitchell ndmitch...@gmail.com:
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 = uabc\N{VULGAR FRACTION ONE HALF}
Hmm, looks nice, and sensible. But as soon as you've got
As an example:
foo = uabc\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.
why not simpy foo\E{i}bar ?
What if i is a string? You'd
On Wed, Jan 14, 2009 at 3:12 PM, Neil Mitchell ndmitch...@gmail.com wrote:
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
Neil Mitchell ha scritto:
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 = uabc\N{VULGAR FRACTION ONE HALF}
Hmm, looks nice, and sensible. But as soon as you've got \N{} syntax I want:
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
Neil Mitchell ndmitch...@gmail.com writes:
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 = uabc\N{VULGAR FRACTION ONE HALF}
Why not:
import Unicode.Entities as U
foo =
What I would really like to see is locally scoped imports but with
parameterized modules. (so modules could take types and values as
parameters)
The places where I most want a feature like this is when I have a group of
helper functions that need a value that is outside the modules scope, but
that
Having an import/module feature like this would replace almost all cases
where someone might wish for a macro system for Haskell.
Don't say that until you've tried Lisp macros... read some of Paul Graham's
essays or try some Common Lisp for yourself... macros can be an incredibly
powerful tool,
joinPath' root name = import.System.FilePath.joinPath [root,name]
How is this different from
joinPath' root name = System.FilePath.joinPath [root,name]
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On Wed, Jan 14, 2009 at 10:13 AM, David Leimbach leim...@gmail.com wrote:
joinPath' root name = import.System.FilePath.joinPath [root,name]
How is this different from
joinPath' root name = System.FilePath.joinPath [root,name]
I'm sorry I didn't mean different, I meant better than? I
On Wed, Jan 14, 2009 at 12:48 PM, Tim Wawrzynczak
inforichl...@gmail.com wrote:
Having an import/module feature like this would replace almost all cases
where someone might wish for a macro system for Haskell.
Don't say that until you've tried Lisp macros... read some of Paul Graham's
You're probably right.
I've played around with LISP macros a little, but it seems that most
of the cases where you would use a macro in LISP you don't need one in
haskell due to lazy evaluation. Although I haven't played around with
them enough to say much one way or another.
Do you know
Well, like many good programming tools, Lisp macros are another
abstraction, but instead of dealing with data, they deal with code.
I didn't know Lisp puts such an emphasis on the difference between
code and data.
___
Haskell-Cafe mailing list
Jonathan Cast wrote:
Haskell already has a couple of abstraction tools for dealing with code.
One is called `first-class functions'; another is called `lazy
evaluation'.
And for all the rest there is TH?
M.
___
Haskell-Cafe mailing list
On Wed, Jan 14, 2009 at 12:56 PM, Martijn van Steenbergen
mart...@van.steenbergen.nl wrote:
Jonathan Cast wrote:
Haskell already has a couple of abstraction tools for dealing with code.
One is called `first-class functions'; another is called `lazy
evaluation'.
And for all the rest there
Tim Wawrzynczak wrote:
Woah fellas, I wasn't trying to start a flame war, I was merely
commenting that those who have not used Lisp don't really understand the
power that macros can have in a language (such as Lisp) that supports
them, and where code and data can be used interchangeably. And
On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
Do you have an example of
a macro that can't be replaced by higher-order functions and laziness?
I believe I do: one macro I found useful when writing a web app in
Lisp was something I called hash-bind, which binds
Hallo,
On Wed, Jan 14, 2009 at 5:06 PM, Max Rabkin max.rab...@gmail.com wrote:
On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
Do you have an example of
a macro that can't be replaced by higher-order functions and laziness?
I believe I do: one macro I found
On Wed, 2009-01-14 at 11:06 -0800, Max Rabkin wrote:
On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
Do you have an example of
a macro that can't be replaced by higher-order functions and laziness?
I believe I do: one macro I found useful when writing a
On Wed, Jan 14, 2009 at 11:11 AM, Alex Queiroz asand...@gmail.com wrote:
I have one for binding GET/POST variables to regular variables
transparently and with error checking, just inside the body of the
macro.
N! You reinvented PHP. What happens if a request variable shadows
the name
Hallo,
On Wed, Jan 14, 2009 at 5:16 PM, Max Rabkin max.rab...@gmail.com wrote:
On Wed, Jan 14, 2009 at 11:11 AM, Alex Queiroz asand...@gmail.com wrote:
I have one for binding GET/POST variables to regular variables
transparently and with error checking, just inside the body of the
macro.
On Wed, Jan 14, 2009 at 1:14 PM, Jonathan Cast jonathancc...@fastmail.fmwrote:
On Wed, 2009-01-14 at 11:06 -0800, Max Rabkin wrote:
On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
Do you have an example of
a macro that can't be replaced by higher-order
2009/1/14 Tim Wawrzynczak inforichl...@gmail.com:
The reason the macro is better is that the length of the list is known at
compile time, so you don't need to traverse the list to calculate the length
of the list.
Or you could use a real compiler (perhaps even a glorious one) that
does
(defun avg (rest args)
(/ (apply #'+ args) (length args)))
Or as a macro like this:
(defmacro avg (rest args)
`(/ (+ ,@args) ,(length args)))
The reason the macro is better is that the length of the list is known at
compile time, so you don't need to traverse the list to calculate
Hallo,
On Wed, Jan 14, 2009 at 8:47 PM, Dougal Stanton ith...@gmail.com wrote:
(defun avg (rest args)
(/ (apply #'+ args) (length args)))
Or as a macro like this:
(defmacro avg (rest args)
`(/ (+ ,@args) ,(length args)))
The reason the macro is better is that the length of the list
With macros you can define new variable binding constructs.
That's something I occasionally miss in Haskell.
-- Lennart
On Wed, Jan 14, 2009 at 6:48 PM, Jonathan Cast
jonathancc...@fastmail.fm wrote:
On Wed, 2009-01-14 at 12:39 -0600, Tim Wawrzynczak wrote:
You're probably right.
On 2009 Jan 14, at 10:26, Neil Mitchell wrote:
As an example:
foo = uabc\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.
why not simpy
On 2009 Jan 14, at 10:39, Manlio Perillo wrote:
Neil Mitchell ha scritto:
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 = uabc\N{VULGAR FRACTION ONE HALF}
Hmm, looks nice, and sensible. But as
On Wed, 2009-01-14 at 18:59 -0500, Brandon S. Allbery KF8NH wrote:
On 2009 Jan 14, at 10:26, Neil Mitchell wrote:
As an example:
foo = uabc\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.
43 matches
Mail list logo