Re: [Haskell-cafe] (no subject)

2006-03-15 Thread Bulat Ziganshin
Hello José, Wednesday, March 15, 2006, 5:54:49 PM, you wrote: JMV> #ifdef __WIN32__ i use the following: #if defined(mingw32_HOST_OS) || defined(__MINGW32__) || defined(_MSC_VER) -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re: [Haskell-cafe] Learning from scratch

2006-03-15 Thread Jared Updike
For GHC try adding the line import Data.Char or import Char at the top of your Haskell program. Or in ghci, try Char.chr instead of chr, etc. Or try ghci filename.hs where filename.hs is a text file with the line "import Char" at the top. Now 'chr' should appear in scope. The hierarchical li

[Haskell-cafe] Learning from scratch

2006-03-15 Thread Xavier Elizalde
I'm just starting to learn Haskell from scratch and I've just hit a snag. The book "Haskell: The Craft of Functional Programming, Second Edition" uses some examples that call functions from Prelude.hs. But for some reason, two installations of Haskell that I have on my computer don't have t

Re: [Haskell-cafe] Re: different code in different platforms

2006-03-15 Thread John Meacham
On Wed, Mar 15, 2006 at 04:13:19PM +, Simon Marlow wrote: > There's a lot to be said for using runtime tests instead of conditional > compilation, I agree. However, it can't be used exclusively: you can't > choose between two foreign calls this way, for example, because one of > the calls w

Re: [Haskell-cafe] Re: request for code review

2006-03-15 Thread Shannon -jj Behrens
Ok, with all the various opinions, I think I'll: o Stick with the State monad. o Switch from |> to $ and teach readers how to read it, "Think of 'f $ g $ x' as 'f of g of x' or 'f(g(x))'. From that point of view, it may be helpful to read 'f $ g $ x' from right to left." Unless there are any obj

[Haskell-cafe] Re: Deepest functor [was: fmap for lists of lists of lists of ...]

2006-03-15 Thread Greg Buchholz
[EMAIL PROTECTED] wrote: > The code below is more general that required. It also generic: it > works for any Functor and any combination of Functors. It performs > fmap over arbitrarily deep `collections': lists of maybes of maps of > IOs, etc. -- arbitrarily nested fmappable things. Excellen

[Haskell-cafe] Re: Deepest functor [was: fmap for lists of lists of lists of ...]

2006-03-15 Thread Greg Buchholz
[EMAIL PROTECTED] wrote: > The code below is more general that required. It also generic: it > works for any Functor and any combination of Functors. It performs > fmap over arbitrarily deep `collections': lists of maybes of maps of > IOs, etc. -- arbitrarily nested fmappable things. Excellen

[Haskell-cafe] Re: different code in different platforms

2006-03-15 Thread Simon Marlow
Neil Mitchell wrote: Does it really have to change statically? I use code like: #ifdef __WIN32__ (Windows code) #else (Linux code) #endif In Yhc, we use a runtime test to check between Windows and Linux. It has various advantages - we only have one code base, everything is type check

Re: [Haskell-cafe] different code in different platforms

2006-03-15 Thread Neil Mitchell
Hi, Does it really have to change statically? > I use code like: > #ifdef __WIN32__ > (Windows code) > #else > (Linux code) > #endif In Yhc, we use a runtime test to check between Windows and Linux. It has various advantages - we only have one code base, everything is type checked when w

[Haskell-cafe] different code in different platforms

2006-03-15 Thread José Miguel Vilaça
Sorry. In the previous email I forgot the subject.   Hi   I’m having a small problem with the portability of my Haskell code. My code uses wxHaskell and the library for which this one is the Haskell interface (that is called wxWidgets) doesn’t work in the same away in Windows and Linux.

[Haskell-cafe] (no subject)

2006-03-15 Thread José Miguel Vilaça
Hi   I’m having a small problem with the portability of my Haskell code. My code uses wxHaskell and the library for which this one is the Haskell interface (that is called wxWidgets) doesn’t work in the same away in Windows and Linux.   Now I now which code run in Linux and in Windows b

Re: [Haskell-cafe] Re: request for code review

2006-03-15 Thread Udo Stenzel
Shannon -jj Behrens wrote: > o How important is it that I switch from using the State monad to using > arrows? Your problem seems to be naturally soved by the State monad, therefore you should use that. > o How important is it that I switch from using |> or $ to using > arrows? Unimportant. Ho

Re: [Haskell-cafe] Re: request for code review

2006-03-15 Thread Benjamin Franksen
On Tuesday 14 March 2006 20:58, you wrote: > On 3/14/06, Benjamin Franksen <[EMAIL PROTECTED]> wrote: > > On Tuesday 14 March 2006 14:46, Pete Chown wrote: > > > Shannon -jj Behrens wrote: > > > > Arrows looks like a replacement for monads. Are you saying > > > > I should drop my use of the State

Re: [Haskell-cafe] Re: request for code review

2006-03-15 Thread Benjamin Franksen
On Tuesday 14 March 2006 20:58, you wrote: > On 3/14/06, Benjamin Franksen <[EMAIL PROTECTED]> wrote: > > On Tuesday 14 March 2006 14:46, Pete Chown wrote: > > > Shannon -jj Behrens wrote: > > > > Arrows looks like a replacement for monads. Are you saying > > > > I should drop my use of the State

Re: [Haskell-cafe] More STUArray questions

2006-03-15 Thread Martin Percossi
On Mon, Mar 13, 2006 at 10:47:58PM +0100, Roberto Zunino wrote: > Martin Percossi wrote: > >matrix.hs:138:27: > > > > Couldn't match the rigid variable `.' against `ST' > > `.' is bound by the type signature for `runSTMatrix' > > Expected type: ST s > > Inferred type: . (forall s1) >