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 = u"abc\N{VULGAR FRACTION ONE HALF}"
This is possible via QuasiQuotation, you ca
Yes, the Agda modules remind me of Cayenne. :)
On Tue, Jan 20, 2009 at 12:54 PM, Bas van Dijk wrote:
> On Wed, Jan 14, 2009 at 3:59 PM, Manlio Perillo
> wrote:
>> 2) In Python it is possible to import modules inside a function.
>>
>> In Haskell something like:
>>
>> joinPath' root name =
>>
On Wed, Jan 14, 2009 at 3:59 PM, Manlio Perillo
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 out the dependentl
Hello,
2009/1/16 Immanuel Litzroth :
> 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
> http://www.cse.uns
Artyom Shalkhakov ha scritto:
[...]
Prelude> :l foo.hs
[1 of 1] Compiling Main ( foo.hs, interpreted )
Ok, modules loaded: Main.
*Main> isDirectory "/var"
:1:0:
Ambiguous occurrence `isDirectory'
It could refer to either `Main.isDirectory', defined at foo.hs:6:0
Hi Manlio
2009/1/15 Manlio Perillo :
> 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, and made me think
> abo
Hi Immanuel,
2009/1/15 Immanuel Litzroth :
> 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
> yo
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 i
> 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 ru
> 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}"
>
I think you can use quasi quotation of ghc to achieve this ?
Your code would look like this then:
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
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 :
2) In Python it is possible to import modules inside a function.
In Haskell something like:
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 = u"abc\N{VULGAR FRACTION ONE HALF}"
> >>>
> >>> Hmm, looks nice, and sensible. But as soon as you've got \N{}
> >>> syntax I want:
> >>>
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 = u"abc\N{VULGAR FRACTION ONE HALF}"
Hmm, looks nice, and sensible. But a
On 2009 Jan 14, at 10:26, Neil Mitchell wrote:
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.
why not sim
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
wrote:
> On Wed, 2009-01-14 at 12:39 -0600, Tim Wawrzynczak wrote:
>> You're probably right.
>> I've played aro
Hallo,
On Wed, Jan 14, 2009 at 8:47 PM, Dougal Stanton 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 lis
> (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 c
2009/1/14 Tim Wawrzynczak :
> 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 constant folding when the l
On Wed, Jan 14, 2009 at 1:14 PM, Jonathan Cast wrote:
> On Wed, 2009-01-14 at 11:06 -0800, Max Rabkin wrote:
> > On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
> > wrote:
> > > Do you have an example of
> > > a macro that can't be replaced by higher-order functions and laziness?
> >
> > I believ
Hallo,
On Wed, Jan 14, 2009 at 5:16 PM, Max Rabkin wrote:
> On Wed, Jan 14, 2009 at 11:11 AM, Alex Queiroz 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. W
On Wed, Jan 14, 2009 at 11:11 AM, Alex Queiroz 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 of another variab
On Wed, 2009-01-14 at 11:06 -0800, Max Rabkin wrote:
> On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
> 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 wa
Hallo,
On Wed, Jan 14, 2009 at 5:06 PM, Max Rabkin wrote:
> On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
> 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
> Lis
On Wed, Jan 14, 2009 at 10:48 AM, Jonathan Cast
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 variables to the
values
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 I
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 t
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
Haskell-Cafe
On Wed, 2009-01-14 at 12:39 -0600, Tim Wawrzynczak wrote:
> 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 laz
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
Hask
>
> 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 yo
On Wed, Jan 14, 2009 at 12:48 PM, Tim Wawrzynczak
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
> essays or try som
On Wed, Jan 14, 2009 at 10:13 AM, David Leimbach 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 don'
>
>
> 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
http://www.haskell.org/mailman/listinf
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
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
"Neil Mitchell" 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 = u"abc\N{VULGAR FRACTION ONE HALF}"
Why not:
import Unicode.Entities as U
foo = "abc"++U.vulgar_fraction
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 wr
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 = u"abc\N{VULGAR FRACTION ONE HALF}"
Hmm, looks nice, and sensible. But as soon as you've got \N{} syntax I want:
On Wed, Jan 14, 2009 at 3:12 PM, Neil Mitchell 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 kind of
>>> 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.
>
> why not simpy "foo\E{i}bar" ?
Wh
2009/1/14 Neil Mitchell :
> 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{}
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
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 = u"abc\N{VULGAR FRACTION ONE HALF}"
2) In Python it is
44 matches
Mail list logo