fold on Monad?

2002-05-29 Thread Jon Fairbairn
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

Re: GMP from haskell

2002-05-29 Thread Serge D. Mechveliani
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

New lectureship in Nottingham

2002-05-29 Thread Graham Hutton
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

Re: fold on Monad?

2002-05-29 Thread C.Reinke
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

IO and fold (was Re: fold on Monad? )

2002-05-29 Thread Jon Fairbairn
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

Re: readFloat

2002-05-29 Thread Wolfgang Jeltsch
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

reverse function application

2002-05-29 Thread Hal Daume III
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

[ ghc-Bugs-559987 ] accept does reverse DNS lookup

2002-05-29 Thread noreply
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:

[ ghc-Bugs-561809 ] Read for Arrays does not work

2002-05-29 Thread noreply
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:

Re: trouble with Debian package ghc5

2002-05-29 Thread Ken Shan
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

Re: trouble with Debian package ghc5

2002-05-29 Thread Alastair Reid
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

Re: GMP from haskell

2002-05-29 Thread Malcolm Wallace
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

Re: GMP from haskell

2002-05-29 Thread Hal Daume III
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

Re: instance Ord FiniteMap

2002-05-29 Thread Hal Daume III
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

RE: GMP from haskell

2002-05-29 Thread Simon Marlow
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

Re: GHC ebuild done!

2002-05-29 Thread Sven Moritz Hallberg
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

Re: instance Ord FiniteMap

2002-05-29 Thread Johannes Waldmann
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

Re: instance Ord FiniteMap

2002-05-29 Thread Alastair Reid
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

specifying common 'dis's in greencard

2002-05-29 Thread Hal Daume III
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

Re: specifying common 'dis's in greencard

2002-05-29 Thread Sigbjorn Finne
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

Re: specifying common 'dis's in greencard

2002-05-29 Thread 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

Re: specifying common 'dis's in greencard

2002-05-29 Thread Alastair Reid
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

Re: specifying common 'dis's in greencard

2002-05-29 Thread Sigbjorn Finne
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,