Re: [Haskell] is $ a no-op?

2004-10-13 Thread Cale Gibbard
On Wed, 13 Oct 2004 18:06:01 +0100, Malcolm Wallace <[EMAIL PROTECTED]> wrote: > "Jacques Carette" <[EMAIL PROTECTED]> writes: > > > > -- |Apply list of functions to some value, returning list of results. > > > -- It's kind of like an converse map. > > > flist :: [a->b] -> a -> [b] > > > flist fs

Re: [Haskell] is $ a no-op?

2004-10-13 Thread Marcin 'Qrczak' Kowalczyk
Johannes Waldmann <[EMAIL PROTECTED]> writes: > I liked to think of it as just a syntactical convention (for years ...) > but is it really at no cost? It does introduce extra function calls, > that is, extra closures etc.? Can these be removed by ghc's optimizer? It is inlined by GHC when optimiz

RE: [Haskell] is $ a no-op?

2004-10-13 Thread Kevin Millikin
On Wednesday, October 13, 2004 11:25 AM, Jacques Carette [SMTP:[EMAIL PROTECTED] wrote: > > > -- It's kind of like an converse map. > > > > I have attempted, unsuccessfully, to write flist above in a point-free > > manner. Is it possible? > > > Of course it is, but why? > > flist = flip (map .

RE: [Haskell] is $ a no-op?

2004-10-13 Thread Jacques Carette
> > -- It's kind of like an converse map. > > I have attempted, unsuccessfully, to write flist above in a point-free > manner. Is it possible? > Of course it is, but why? > flist = flip (map . flip ($)) Some functions are simpler point-free, others are simpler with points. I was curious abou

Re: [Haskell] is $ a no-op?

2004-10-13 Thread Remi Turk
On Wed, Oct 13, 2004 at 01:00:05PM -0400, Jacques Carette wrote: > > -- |Apply list of functions to some value, returning list of results. > > -- It's kind of like an converse map. > > flist :: [a->b] -> a -> [b] > > flist fs a = map ($ a) fs > > I have attempted, unsuccessfully, to write flist a

Re: [Haskell] is $ a no-op?

2004-10-13 Thread Malcolm Wallace
"Jacques Carette" <[EMAIL PROTECTED]> writes: > > -- |Apply list of functions to some value, returning list of results. > > -- It's kind of like an converse map. > > flist :: [a->b] -> a -> [b] > > flist fs a = map ($ a) fs > > I have attempted, unsuccessfully, to write flist above in a point-fr

RE: [Haskell] is $ a no-op?

2004-10-13 Thread Jacques Carette
> -- |Apply list of functions to some value, returning list of results. > -- It's kind of like an converse map. > flist :: [a->b] -> a -> [b] > flist fs a = map ($ a) fs I have attempted, unsuccessfully, to write flist above in a point-free manner. Is it possible? Jacques _

Re: [Haskell] is $ a no-op?

2004-10-13 Thread Graham Klyne
At 15:55 13/10/04 +0200, Johannes Waldmann wrote: In a *lot* of places in my programs, I am using notation f $ g $ h x in favour of f (g (h x)) (that's the '$' as defined in the Prelude: right-associating infix application operator) as it avoids parentheses, and makes the code more manageabl

[Haskell] is $ a no-op?

2004-10-13 Thread Johannes Waldmann
In a *lot* of places in my programs, I am using notation f $ g $ h x in favour of f (g (h x)) (that's the '$' as defined in the Prelude: right-associating infix application operator) as it avoids parentheses, and makes the code more manageable (you can write "(upward) pipes" with one "$ f" p