[Haskell-cafe] Re: what is inverse of mzero and return?

2005-01-21 Thread Ashley Yakeley
In article <[EMAIL PROTECTED]>, "S. Alexander Jacobson" <[EMAIL PROTECTED]> wrote: > I assume there is a standard name for this > class/function: > >instance Foo [] where > foo [] = mzero > foo (x:_) = return x > >instance Foo (Maybe x) where > foo Nothing = mzero >

[Haskell-cafe] what is inverse of mzero and return?

2005-01-21 Thread S. Alexander Jacobson
I assume there is a standard name for this class/function: instance Foo [] where foo [] = mzero foo (x:_) = return x instance Foo (Maybe x) where foo Nothing = mzero foo Just x = return x -Alex- __ S. Alexander Jaco

[Haskell-cafe] can't 'make install-docs'

2005-01-21 Thread Daniel Fischer
Hi, I've just installed ghc-6.2.2, but couldn't get the docs made. I got the following: Text/Regex.raw-hs Text/Regex/Posix.raw-hs Text/Show.raw-hs Text/Show/Functions.raw-hs \ --package=base \ --dump-interface=base.haddock \ --use-index=../doc-index.html --use-contents=../i

Re: [Haskell-cafe] HaXmL and the IO Monad

2005-01-21 Thread David Roundy
On Fri, Jan 21, 2005 at 02:53:04PM +, John Goerzen wrote: > I've been playing with HaXmL lately. I've had a need to convert one XML > document to another, and HaXmL was very nice for that. > > Along the way, I've discovered that I need to do some I/O as part of the > conversion (specifically

[Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-21 Thread John Goerzen
On 2005-01-21, Peter Simons <[EMAIL PROTECTED]> wrote: > > 24 * ((fromIntegral $ tdDay td) + > > 30 * ((fromIntegral $ tdMonth td) + > > 365 * (fromIntegral $ tdYear td) > > I was wondering: Does this calculation account for leap

[Haskell-cafe] Hugs for Zaurus

2005-01-21 Thread John Goerzen
Hello, I have built a fixed Hugs for the Zaurus PDA running the OpenZaurus distribution. Download here: http://quux.org/devel/zaurus/hugs_hugs98-Nov2003-r1_arm.ipk Every module except Posix signals appears to be working. -- John ___ Haskell-Cafe ma

Re: [Haskell-cafe] HaXmL and the IO Monad

2005-01-21 Thread Malcolm Wallace
John Goerzen <[EMAIL PROTECTED]> writes: > type CFilter = Content -> [Content] > > Try as I might, I could not figure out a nice way to integrate I/O into > this system. A simple IO CFilter wouldn't work, since there has to be > input available when it runs. Content -> IO [Content] didn't work

Re: [Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-21 Thread Marcin 'Qrczak' Kowalczyk
Peter Simons <[EMAIL PROTECTED]> writes: > I was wondering: Does this calculation account for leap > years? Does it have to? C itself leaves unspecified the question whether its time calculations take leap seconds into account. All other systems I know of ignore leap seconds: POSIX C, Common Lisp

[Haskell-cafe] Re: Can't do basic time operations with System.Time

2005-01-21 Thread Peter Simons
John Goerzen writes: > timeDiffToSecs :: TimeDiff -> Integer > timeDiffToSecs td = > (fromIntegral $ tdSec td) + > 60 * ((fromIntegral $ tdMin td) + > 60 * ((fromIntegral $ tdHour td) + > 24 * ((fromIntegral $ tdDay td) + > 30 * ((from

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Duncan Coutts
On Fri, 2005-01-21 at 16:26 +, Keean Schupke wrote: > Udo Stenzel wrote: > >Thus the question is, does select() reliably tell if read() would block or > >does it > >check for something else? Is the documentation wrong (on some platforms)? > > > > > Having read around I have found that selec

RE: [Haskell-cafe] Re: Hugsvs GHC (again)was:Re: Somerandomnewbiequestions

2005-01-21 Thread Simon Marlow
On 21 January 2005 16:27, Keean Schupke wrote: > Having read around I have found that select does return readable for > all file IO on a block device... > > I wonder if ghc could use non-blocking mode (files opened with the > O_NONBLOCK) flag? GHC does use the O_NONBLOCK flag. Cheers, S

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Keean Schupke
Udo Stenzel wrote: The Glibc documentation says, "select determines if there is data available (more precisely, if a call to read(2) will not block)." I think, this is reasonably precise. The OS does know, where you are going to read (at the file pointer) and if you seek() or pread() instead, we

Re: [Haskell-cafe] Can't do basic time operations with System.Time

2005-01-21 Thread John Goerzen
On Fri, Jan 21, 2005 at 02:55:31PM -, Simon Marlow wrote: > Have you seen this, BTW: > > http://www.haskell.org/~simonmar/time/NewTime.html Ah. I think I found several discussions in reply to that but never did actually track down that URL. I'll take a look. > > timelocal :: CalendarTime

RE: [Haskell-cafe] Can't do basic time operations with System.Time

2005-01-21 Thread Simon Marlow
On 21 January 2005 14:31, John Goerzen wrote: > I checked the following code into MissingH. I would be pleased if you > could take it for fptools. I should note that I am using an Integer > rather than an Int to represent seconds, since I think that is proper > given the size of values we might

[Haskell-cafe] HaXmL and the IO Monad

2005-01-21 Thread John Goerzen
I've been playing with HaXmL lately. I've had a need to convert one XML document to another, and HaXmL was very nice for that. Along the way, I've discovered that I need to do some I/O as part of the conversion (specifically due to timezone-related calculations). Much of HaXML is based around th

Re: [Haskell-cafe] Can't do basic time operations with System.Time

2005-01-21 Thread John Goerzen
On Fri, Jan 21, 2005 at 01:56:23PM -, Simon Marlow wrote: > I can't tell what's wrong here, if anything (general brokenness in the > System.Time API notwithstanding). Ah *lightbuilb* - I think I see: you > want to take a calendar time without any TZ information, assume it is a > time at the cu

RE: [Haskell-cafe] Can't do basic time operations with System.Time

2005-01-21 Thread Simon Marlow
On 20 January 2005 22:12, John Goerzen wrote: > I have a simple desire. I have a string that I need to parse as a > date/time string in the local timezone, then convert it to standard > seconds-since-epoch format. This is trivial in C, Perl, Python, etc. > but seems impossible to do reliably in

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Ketil Malde
Duncan Coutts <[EMAIL PROTECTED]> writes: > The point is that the Unix documentation does not consider the short > pause as data is read off your hard drive to be blocking. So that's why > select will always report that data is available when you use it with a > file handle. Isn't this also for h

Re: [Haskell-cafe] Math libraries for Haskell

2005-01-21 Thread Henning Thielemann
On Tue, 18 Jan 2005, Dmitri Pissarenko wrote: > Hello! > > Is there a math library for Haskell, using which one can calculate eigenvalues > of matrices? http://haskell.org/libraries/#numerics Indexless linear algebra algorithms They contain Eigensystem functions, but I remember that they were

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread David Roundy
On Fri, Jan 21, 2005 at 12:42:56PM +, Keean Schupke wrote: > Ben Rudiak-Gould wrote: > >If you're reading from a random-access file, there's no way it can > >tell you when the file data is buffered, because it doesn't know which > >part of the file you plan to read. The OS may try to guess fo

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Duncan Coutts
On Fri, 2005-01-21 at 12:33 +, Keean Schupke wrote: > Glynn Clements wrote: > > > The central issue is that the Unix API doesn't distinguish between > > > >cases 1 and 2 when it comes to non-blocking I/O, asynchronous I/O, > >select/poll etc. [OTOH, NT overlapped I/O and certain Unix extension

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Keean Schupke
Ben Rudiak-Gould wrote: If you're reading from a random-access file, there's no way it can tell you when the file data is buffered, because it doesn't know which part of the file you plan to read. The OS may try to guess for readahead purposes, but select()'s behavior can't depend on that guess.

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Keean Schupke
Glynn Clements wrote: The central issue is that the Unix API doesn't distinguish between cases 1 and 2 when it comes to non-blocking I/O, asynchronous I/O, select/poll etc. [OTOH, NT overlapped I/O and certain Unix extensions do distinguish these cases, i.e. data is only "available" when it's in ph

Re: [Haskell-cafe] Reading images

2005-01-21 Thread Duncan Coutts
On Fri, 2005-01-21 at 07:25 +, Adrian Hey wrote: > On Thursday 20 Jan 2005 7:35 pm, Dmitri Pissarenko wrote: > > In my program, I need ONLY to read an image and to transform it into such > > matrix. > > > > Which graphics library can you recommend, if no other image manipulation > > operations

Re: [Haskell-cafe] Re: Hugsvs GHC (again)was: Re: Somerandomnewbiequestions

2005-01-21 Thread Udo Stenzel
Ben Rudiak-Gould <[EMAIL PROTECTED]> schrieb am 21.01.05 02:37:34: > If you're reading from a random-access file, there's no way [select] can tell > you when the file data is buffered, because it doesn't know which part > of the file you plan to read. The OS may try to guess for readahead > pur