Surprised to type in (1+n) as a type index!

2009-02-02 Thread Ahn, Ki Yung
I was writing a document in lhs form and typed in something like this. > data Exp n where > Atom :: Exp () > List :: [Exp n] -> Exp (1+n) I wasn't expecting this to actually load up on GHCi, but when I load this up with the magical -fglasgow-exts option, it just worked !!! *Main> :t Atom Ato

Re: ST monad and monad tranformers

2009-02-02 Thread Josef Svenningsson
On Mon, Feb 2, 2009 at 8:50 PM, Reid Barton wrote: > On Mon, Feb 02, 2009 at 06:03:15PM +0100, Josef Svenningsson wrote: >> Hi Tyson, >> >> I also needed something like this a while ago so I knocked up a really >> simple module and put it on hackage: >> http://hackage.haskell.org/cgi-bin/hackage-s

Re: ST monad and monad tranformers

2009-02-02 Thread Tyson Whitehead
On February 2, 2009 11:26:02 Tyson Whitehead wrote: > The STT type above is a version of ST like the ReaderT, StateT, etc. types. > > newtype STT s m a = STT ( State# s -> m (STTBox s a) ) > data STTBox s a = STTBox {-#UNPACK#-} !(State# s) {-#UNPACK#-} !a > > runSTT :: (Monad m) => (forall s. STT

Re: ST monad and monad tranformers

2009-02-02 Thread Reid Barton
On Mon, Feb 02, 2009 at 06:03:15PM +0100, Josef Svenningsson wrote: > Hi Tyson, > > I also needed something like this a while ago so I knocked up a really > simple module and put it on hackage: > http://hackage.haskell.org/cgi-bin/hackage-scripts/package/STMonadTrans Warning! The STMonadTrans pa

Re: ST monad and monad tranformers

2009-02-02 Thread Josef Svenningsson
Hi Tyson, I also needed something like this a while ago so I knocked up a really simple module and put it on hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/STMonadTrans If you have any suggestions for improvement they are most welcome. Patches even more so. Josef 2009/2/2 T

ST monad and monad tranformers

2009-02-02 Thread Tyson Whitehead
I have a situation in which I believe I need a parameterizable version of the strict ST monad. My computation type is "StateT s' (STT s (ErrorT e m)) a" (i.e., fails or succeeds and has an internal state involving a state thread). The STT type above is a version of ST like the ReaderT, StateT,

Re: Segmentation fault trying to build ghc 6.10.1 using macports, Mac OS X 10.5, PPC

2009-02-02 Thread Gregory Wright
Hi David, On Feb 2, 2009, at 4:48 AM, Christian Maeder wrote: David Menendez wrote: I'm trying to upgrade GHC to 6.10.1 using macports on a PowerBook G4 running OS X 10.5.5. From what I can tell, I'm getting a segmentation fault from cabal-bin. On PPC leopard you need to update to XCode 3.1

Re: Core questions

2009-02-02 Thread Sean Leather
Hi Matthijs, This is a shameless plug for EMGM, a library for generic programming that we've been working on at Utrecht. | However, there are two issues bothering me still. The first is that the > | Core types (in particular CoreExpr) are not instances of Show. They are > | instances of Outputabl

Re: Segmentation fault trying to build ghc 6.10.1 using macports, Mac OS X 10.5, PPC

2009-02-02 Thread Christian Maeder
David Menendez wrote: > I'm trying to upgrade GHC to 6.10.1 using macports on a PowerBook G4 > running OS X 10.5.5. From what I can tell, I'm getting a segmentation > fault from cabal-bin. On PPC leopard you need to update to XCode 3.1 http://hackage.haskell.org/trac/ghc/wiki/Building/MacOSX http:

RE: Core questions

2009-02-02 Thread Simon Peyton-Jones
Matthijs | However, there are two issues bothering me still. The first is that the | Core types (in particular CoreExpr) are not instances of Show. They are | instances of Outputable, which allows them to be pretty printed. | However, this pretty printing is good to view the structure of the | exp