Re: [Haskell-cafe] MonadPlus instance for IO

2005-02-02 Thread Daniel Fischer
Am Mittwoch, 2. Februar 2005 14:48 schrieb David Roundy: > On Wed, Feb 02, 2005 at 02:41:42PM +0100, Daniel Fischer wrote: > > Probably you haven't imported 'Control.Monad.Error', where the instance > > is defined. I did and all went well. > > Thanks, that did it. It's confusing that the instance

[Haskell-cafe] Re: File path programme

2005-02-02 Thread Peter Simons
Glynn Clements writes: >> Well, there is a sort-of canonic version for every path; >> on most Unix systems the function realpath(3) will find >> it. My interpretation is that two paths are equivalent >> iff they point to the same target. > I think that any definition which includes an "iff"

Re: [Haskell-cafe] MonadPlus instance for IO

2005-02-02 Thread David Roundy
On Wed, Feb 02, 2005 at 02:41:42PM +0100, Daniel Fischer wrote: > Probably you haven't imported 'Control.Monad.Error', where the instance is > defined. I did and all went well. Thanks, that did it. It's confusing that the instance is documented in Control.Monad. -- David Roundy http://www.darcs

RE: [Haskell-cafe] MonadPlus instance for IO

2005-02-02 Thread Simon Peyton-Jones
that instance seems to be only in Control.Monad.Error in the 'mtl' package. It's not in the standard base package. You may need to import an mtl module to tell GHC to look there. Simon | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of | David Roundy |

Re: [Haskell-cafe] MonadPlus instance for IO

2005-02-02 Thread Daniel Fischer
Am Mittwoch, 2. Februar 2005 14:17 schrieb David Roundy: > I'm sure I'm doing something stupid, but somehow ghc isn't recognizing the > existance of a MonadPlus instance for IO: > > DarcsIO.lhs:48: > No instance for (MonadPlus IO) > arising from use of `mplus' at DarcsIO.lhs:48 > In t

Re: [Haskell-cafe] Re: File path programme

2005-02-02 Thread Glynn Clements
Peter Simons wrote: > > Hmmm, I'm not really sure what "equivalence" for file > > paths should mean in the presence of hard/symbolic links, > > (NFS-)mounted file systems, etc. > > Well, there is a sort-of canonic version for every path; on > most Unix systems the function realpath(3) will fi

Re: [Haskell-cafe] The Nature of Char and String

2005-02-02 Thread Marcin 'Qrczak' Kowalczyk
Ketil Malde <[EMAIL PROTECTED]> writes: >> The Haskell functions accept or return Strings but interface to OS >> functions which (at least on Unix) deal with arrays of bytes (char*), >> and the encoding issues are essentially ignored. If you pass strings >> containing anything other than ISO-8859-

[Haskell-cafe] MonadPlus instance for IO

2005-02-02 Thread David Roundy
I'm sure I'm doing something stupid, but somehow ghc isn't recognizing the existance of a MonadPlus instance for IO: DarcsIO.lhs:48: No instance for (MonadPlus IO) arising from use of `mplus' at DarcsIO.lhs:48 In the definition of `foo': foo = (fail "aaack") `mplus` (fail "fo

Re: [Haskell-cafe] The Nature of Char and String

2005-02-02 Thread Ketil Malde
Glynn Clements <[EMAIL PROTECTED]> writes: > The Haskell functions accept or return Strings but interface to OS > functions which (at least on Unix) deal with arrays of bytes (char*), > and the encoding issues are essentially ignored. If you pass strings > containing anything other than ISO-8859-1

Re: [Haskell-cafe] The Nature of Char and String

2005-02-02 Thread Glynn Clements
Ben Rudiak-Gould wrote: > >Char in Haskell represents a Unicode character. I don't know exactly > >what its size is, but it must be at least 16 bits and maybe more. > >String would then share those properties. > > > >However, usually I'm accustomed to dealing with data in 8-bit words. > >S

Re: [Haskell-cafe] The Nature of Char and String

2005-02-02 Thread Glynn Clements
John Goerzen wrote: > > > * If I use hPutStr on a string, is it guaranteed that the number of > > > 8-bit bytes written equals (length stringWritten)? > > > > Yes, if the handle is opened in binary mode. No if not. > > Thank you for the informative response. > > If a file is opened in text m

Re: [Haskell-cafe] Re: ocr'ed version of "The implementation offunctional languages"

2005-02-02 Thread Harri Haataja
On Wed, Feb 02, 2005 at 01:27:30PM +0600, Ivan Boldyrev wrote: > On 9007 day of my life Harri Haataja wrote: > >> > text, but I haven't learned proper spell yet :) I use free > >> > tools, so it may be difficult or impossible. > > > > Do see http://any2djvu.djvuzone.org/ > > Unfortunately, creati