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
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
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 .
> > -- 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
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
"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
> -- |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
_
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
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