Suppose I have a task I want to do to each line of a file,
accumulate a result and output it, I can write
main = do stuff - getContents
print $ foldl process_line initial_value (lines stuff)
ie, it's obviously a fold
I can't see a way of doing the same thing directly on the
Hal Daume III [EMAIL PROTECTED] writes:
The gnu web page
(www.gnu.org/manual/gmp-4.0.1/html_node/gmp_70.html) claims that Haskell
(GHC) has bindings to GMP. Is this true? How can I access these
routines?
Some Haskell systems mention that they use GMP to implement many
functions for
Dear all,
We are currently advertising a new lectureship in Nottingham. There
are no particular research areas specified for this position, but
applications in the area of the Foundations of Programming research
group (http://www.cs.nott.ac.uk/Research/fop/) would be most welcome.
Further
Suppose I have a task I want to do to each line of a file,
accumulate a result and output it,
..
I'd like to write something similar to
main = do res - foldX process_line initial_value getLine
print res
I feel this ought to be straightforward -- the structure is
foldr, foldM, etc. derive a recursive computation from the
recursive structure of an input list, so you have to feed
one in. If you want to bypass the list, you could use
IO-observations (getLine, isEOF) instead of list
observations (head/tail, null):
Yes you can define it, I should have
On Tuesday, 2002-05-28, 18:57, CEST Simon Peyton-Jones wrote:
Folks
I'm back to tidying up the Haskell Report.
In the Numeric library, there is the useful function
readFloat :: RealFloat a = ReadS a
But you can't use it for reading rationals, because Rational
isn't in
i have a function:
(*==) :: B - (C - IO a) - IO a
basically, it takes b, does something to it to make c, performs the action
on c and returns the value.
the Bs are basically Doubles, so we'll consider them as such for now.
suppose I want to string together a bunch of these things...i can
Bugs item #559987, was opened at 2002-05-24 07:40
You can respond by visiting:
http://sourceforge.net/tracker/?func=detailatid=108032aid=559987group_id=8032
Category: hslibs/net
Group: 5.02
Status: Closed
Resolution: Fixed
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to:
Bugs item #561809, was opened at 2002-05-28 22:12
You can respond by visiting:
http://sourceforge.net/tracker/?func=detailatid=108032aid=561809group_id=8032
Category: hslibs/lang
Group: 5.02
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to:
On 2002-05-28T14:50:22-0400, Norman Ramsey wrote:
I _could_ make readline a hard dependency of ghc, but this is somehow
not satisfactory. I'd rather like readline to be out-factored to its
own package (I know, this would break other Haskell programs, but it's
arguably easy-to-fix
This dependency on libreadline4-dev seems to be a special case of a
more general issue, namely how to handle packages in the GHC sense
in the Debian packaging system. The way Perl module code is
packaged for Debian seems to be quite sophisticated: Perl packages
tend to correspond to
Hal Daume III [EMAIL PROTECTED] writes:
The gnu web page
(www.gnu.org/manual/gmp-4.0.1/html_node/gmp_70.html) claims that Haskell
(GHC) has bindings to GMP. Is this true? How can I access these
routines?
The type Integer?
Regards,
Malcolm
I should have been more specific :). I was referring to the more
complicated things, such as Lucas numbers, Binomial coefficients, etc.
--
Hal Daume III
Computer science is no more about computers| [EMAIL PROTECTED]
than astronomy is about telescopes. -Dijkstra | www.isi.edu/~hdaume
On
I agree; the problem is that I fear that making my own instance by using
setToList will be very inefficient (or at least much more so than an
instance which actually looks at the tree structure).
--
Hal Daume III
Computer science is no more about computers| [EMAIL PROTECTED]
than
I should have been more specific :). I was referring to the more
complicated things, such as Lucas numbers, Binomial coefficients, etc.
There isn't a full GMP binding as such. However, we do make use of more
than just the simple arithmetic in GMP - for example, Prelude.gcd on
Integers uses
On Wednesday 29. May 2002 17:07, you wrote:
With the help of the excellent new guide on porting GHC
(Thank you Simon!)
I have just created an ebuild for GHC. I thought I'd let you
know, in case
you're still working on it. I don't bootstrap GHC 5 directly
from HC files,
but GHC
setToList will be very inefficient (or at least much more so than an
instance which actually looks at the tree structure).
this would be much more difficult to design,
since one and the same set may be represented by quite different trees:
they might have been created by inserting elements
Johannes Waldmann [EMAIL PROTECTED] writes:
I find that I use Set and FiniteMap rather for reasons of clarity in
coding. This is what `you guys in industry' call `academic
programming', right :-) If speed is really an important issue, then
one would have to resort to some kind of hash table
Hi,
I have three modules which all use the same (or some of the same) %dis
directives; I'd like to pull these out into their own file (a module
called MyDIS or something), but I can't figure out how to get green-card
to look at those definitions (I've `import`ed it in the modules that need
it
Something like:
foo$ cat Foo.gc
module Foo where
import StdDIS
%dis foo x = char x
foo$ cat Bar.gc
module Bar where
import StdDIS
import Foo
%fun f :: Foo - IO ()
foo$ green-card -i/path/to/green-card/lib/ghc -tffi Bar.gc
foo$
hth
--sigbjorn
- Original Message -
From: Hal Daume III
Ah, my problem was that I was using the extension .ghs on my Foo file
and it expected .gc.
Thanks.
--
Hal Daume III
Computer science is no more about computers| [EMAIL PROTECTED]
than astronomy is about telescopes. -Dijkstra | www.isi.edu/~hdaume
On Wed, 29 May 2002, Sigbjorn Finne
Hi, I have three modules which all use the same (or some of the
same) %dis directives; I'd like to pull these out into their own
file (a module called MyDIS or something), but I can't figure out
how to get green-card to look at those definitions (I've `import`ed
it in the modules that need
ok, the -s option lets you expand the list of file suffixes used,
i.e., -sghc would take care of it your case.
--sigbjorn
- Original Message -
From: Hal Daume III [EMAIL PROTECTED]
To: Sigbjorn Finne [EMAIL PROTECTED]
Cc: GHC Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, May 29,
23 matches
Mail list logo