Aditya Siram wrote:
I am trying to write a function 'applyArguments' which takes a function
and a list and recursively uses element each in the list as an argument
to the function. I want to do this for any function taking any number of
arguments.
applyArgument f (arg) = f arg
Jeremy Shaw wrote:
I am guessing that 'off-line generated parsers' means things like
lex/yacc -- but I am not positive.
Yes, happy is the parser generator for haskell. (and alex the
corresponding lexer)
Christian
___
Haskell-Cafe mailing list
Dear members,
I am experiencing a space leak, which I suspect to be
an instance of the problem addressed by Wadler before.
I'd appreciate if someone here would take a look.
Given the following datatype:
data XMLEvent = StartEvent String
| EndEvent String
|
On Fri, 19 May 2006, Shin-Cheng Mu wrote:
idX :: [XMLEvent] - ([XMLEvent], [XMLEvent])
idX [] = ([], [])
idX (StartEvent a : strm) =
let (ts, strm') = idX strm
(us, strm'') = idX strm'
in (StartEvent a [] : ts ++ EndEvent a : us, strm'')
idX (EndEvent _:
Chris, the subject states clearly that Aditya is a Newbie, and is most
likely just trying to define the function map. So I think pointing to
a bunch of advanced type magic tricks is not really helpful.
Aditya, you say you want the function applyArgument to take a function
and a list and apply
Dear Henning,
On May 19, 2006, at 6:16 PM, Henning Thielemann wrote:
On Fri, 19 May 2006, Shin-Cheng Mu wrote:
idX :: [XMLEvent] - ([XMLEvent], [XMLEvent])
idX (StartEvent a : strm) =
let (ts, strm') = idX strm
(us, strm'') = idX strm'
in (StartEvent a [] : ts ++
My apologies to Chris, I think I misinterpreted Aditya's description.
Thanks to David House for telling me. I thought he was describing a
function such as map instead of polyvaric functions, which would have
been more likely for a newbie :-)
So to answer Aditya's question, whether you can do
Henning Thielemann [EMAIL PROTECTED] wrote:
let ~(ts, strm') = idX strm
~(us, strm'') = idX strm'
Let-bindings are already lazy, so the ~ here is redundant.
Regards,
Malcolm
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
On May 19, 2006, at 6:16 PM, Henning Thielemann wrote:
let ~(ts, strm') = idX strm
~(us, strm'') = idX strm'
I seem to have found a partial solution to the problem.
It's rather ugly, however, and I think there should be
a better way.
The original definition for one of the clauses was
Shin-Cheng Mu wrote:
Dear members,
I am experiencing a space leak, which I suspect to be
an instance of the problem addressed by Wadler before.
I'd appreciate if someone here would take a look.
Given the following datatype:
data XMLEvent = StartEvent String
| EndEvent
Shin-Cheng Mu [EMAIL PROTECTED] wrote:
I was wondering where the space leak came from and suspected
that it's the leak described in one of Philip Wadler's
early paper Fixing Some Space Leaks With a Garbage Collector (1987).
But since Wadler has addressed this problem a long time ago,
I
Hello,
You can do it -- but it may not be very useful in its current
form. The primary problem is, What is the type of 'f'?
applyArgument f [arg] = f arg -- NOTE: I changed (arg) to [arg]
applyArgument f (arg:args) = applyArgument (f arg) args
Looking at the second line, it seems that f is a
On May 19, 2006, at 2:49 PM, Jeremy Shaw wrote:
Hello,
You can do it -- but it may not be very useful in its current
form. The primary problem is, What is the type of 'f'?
applyArgument f [arg] = f arg -- NOTE: I changed (arg) to [arg]
applyArgument f (arg:args) = applyArgument (f arg) args
On Tue, 16 May 2006, Donald Bruce Stewart wrote:
lemming:
I have a wrapper for basic GNUPlot control:
http://www.math.uni-bremen.de/~thielema/Research/GNUPlot.hs
More secret modules! Could you stick a link to this on the haskell.org
wiki please, under libraries and tools somewhere?
I've
Aditya Siram wrote:
] I am trying to write a function 'applyArguments' which takes a function and
] a list and recursively uses element each in the list as an argument to the
] function. I want to do this for any function taking any number of arguments.
]
] applyArgument f (arg) = f arg
]
Thanks Jared, but already tried those. I was able to download the Streams library, but I have know idea how to install it.On 5/19/06, Jared Updike
[EMAIL PROTECTED] wrote:I found this in an old post (gotta love GMail search):
You can find further information about the library at the page
Greg Buchholz wrote:
instance Apply a b c = Apply (a-b) b (a,c) where
Whoops, instead of that, I think I meant...
instance Apply (b-c) c d = Apply (a-b-c) (b-c) (a,d) where
...where we strip off one layer of types, because of the recursion. Of
course, that still doesn't work though.
Greg
For a toy project I want to parse the output of a program. The
program runs on someone else's machine and mails me the results, so I
only have access to the output it generates,
Unfortunately, the output is intended to be human-readable, and this
makes parsing it a bit of a pain. Here are some
18 matches
Mail list logo