[Haskell-cafe] Re: Haskell example archive?

2005-04-25 Thread Peter Eriksen
Echo Nolan <[EMAIL PROTECTED]> writes: > Hello all, > I recently read the post about a problem using the list monad, > and I was wondering if there was an archive of monad usecases. If there > is one, I'd like to see it, and if not it'd be a helpful part of the > haskell community. Something

Re: [Haskell-cafe] Why doesn't this work?

2005-04-25 Thread Daniel Fischer
Am Montag, 25. April 2005 08:16 schrieb Michael Vanier: > I've been trying to generate an infinite list of random coin flips in GHC > 6.4, and I've come across some strange behavior: > > -- > import System.Random > > data Coin = H

Re: [Haskell-cafe] Why doesn't this work?

2005-04-25 Thread Duncan Coutts
On Sun, 2005-04-24 at 23:16 -0700, Michael Vanier wrote: > I've been trying to generate an infinite list of random coin flips in GHC > 6.4, and I've come across some strange behavior: > > -- > import System.Random > > data Coin =

Re: [Haskell-cafe] Why doesn't this work?

2005-04-25 Thread Sebastian Sylvan
On 4/25/05, Michael Vanier <[EMAIL PROTECTED]> wrote: > > I've been trying to generate an infinite list of random coin flips in GHC > 6.4, and I've come across some strange behavior: > > -- > import System.Random > > data Coin =

Re: [Haskell-cafe] Why doesn't this work?

2005-04-25 Thread Scott Turner
On 2005 April 25 Monday 02:16, Michael Vanier wrote: > -- Generate an infinite list of coin flips. > coinFlips :: IO [Coin] > coinFlips = sequence cfs > where cfs = (coinFlip : cfs) > -- > > [...] My understanding is th

[Haskell-cafe] String search algorithms

2005-04-25 Thread Bayley, Alistair
I'm a bit puzzled to find no sub-string search in the Haskell libraries (unless there's some neat composition of the existing Data.List functions that I've missed). Google doesn't help much either. I've found a KMP implementation: http://haskell.org/hawiki/RunTimeCompilation I'm after something

Re: [Haskell-cafe] String search algorithms

2005-04-25 Thread Henning Thielemann
On Mon, 25 Apr 2005, Bayley, Alistair wrote: I'm a bit puzzled to find no sub-string search in the Haskell libraries (unless there's some neat composition of the existing Data.List functions that I've missed). Google doesn't help much either. I've found a KMP implementation: http://haskell.org/haw

RE: [Haskell-cafe] String search algorithms

2005-04-25 Thread Bayley, Alistair
> From: Henning Thielemann [mailto:[EMAIL PROTECTED] > > > (unless there's some neat composition of the existing > Data.List functions > > List.findIndex (List.isPrefixOf "bla") (List.tails "dfvbdbblaesre") Oh, so there is. Thanks. - ***

Re: [Haskell-cafe] String search algorithms

2005-04-25 Thread Henning Thielemann
On Mon, 25 Apr 2005, Henning Thielemann wrote: On Mon, 25 Apr 2005, Bayley, Alistair wrote: I'm a bit puzzled to find no sub-string search in the Haskell libraries (unless there's some neat composition of the existing Data.List functions that I've missed). Google doesn't help much either. I've foun

RE: [Haskell-cafe] String search algorithms

2005-04-25 Thread Bayley, Alistair
> From: Henning Thielemann [mailto:[EMAIL PROTECTED] > > But I'm curious if you really need the index. Working with indexes on > lists is quite inefficient. E.g. if you want to replace > substrings you > may want to use this implementation: I'm not mutating the list, but I am extracting subl

RE: [Haskell-cafe] FFI and pointers to pointers

2005-04-25 Thread Simon Marlow
On 22 April 2005 16:18, Dimitry Golubovsky wrote: > I am trying to generalize my knowledge about FFI declarations when > dealing with pointers to pointers (import from C to Haskell). Maybe > these are silly questions, but It seems to me, I am missing some > understanding. > > Per the FFI Addendum

RE: [Haskell-cafe] FFI and pointers to pointers

2005-04-25 Thread Simon Marlow
On 25 April 2005 12:51, Simon Marlow wrote: > On 22 April 2005 16:18, Dimitry Golubovsky wrote: > >> I am trying to generalize my knowledge about FFI declarations when >> dealing with pointers to pointers (import from C to Haskell). Maybe >> these are silly questions, but It seems to me, I am mis

Re: [Haskell-cafe] FFI and pointers to pointers

2005-04-25 Thread John Meacham
On Mon, Apr 25, 2005 at 12:51:04PM +0100, Simon Marlow wrote: > The syntax you want is > > foreign import ccall "&bar" :: Ptr CInt > > But note that GHC 6.4 has a bug whereby this doesn't work as expected > when compiling via C. Either use the native code generator (-fasm) or > wait for 6.4.1.

[Haskell-cafe] How to debug GHC

2005-04-25 Thread Monique Louise de Barros Monteiro
Hi, all, I'm developing a back end for GHC and I have the following problem: my program is throwing an "empty list exception" due to head [] and I need to compile GHC with -prof -auto-all in order to see the stack trace when running it with +RTS -xc -RTS. I changed the makefile but the option +RT