[Haskell-cafe] Increase GHC stack size?

2012-02-05 Thread Michael Rice
Stack space overflow: current size 8388608 bytes. Use `+RTS -Ksize -RTS' to increase it. == Couldn't find much on the man or info pages. Example please, say double it (1600) for starters. Michael ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Increase GHC stack size?

2012-02-05 Thread Michael Rice
.nlwrote: ./myProgram +RTS -K1600 If that gives an error, you're program was probably compiled without support for setting RTS options from the command line. Recompile with -rtsopts. Then the above should work On Sun, Feb 5, 2012 at 8:16 PM, Michael Rice limitc...@gmail.com wrote: Stack

Re: [Haskell-cafe] Increase GHC stack size?

2012-02-05 Thread Michael Rice
://www.haskell.org/haskellwiki/Stack_overflow Best regards, Krzysztof Skrzętnicki On Sun, Feb 5, 2012 at 20:50, Michael Rice limitc...@gmail.com wrote: I'm using ghc --make... -rtsopts seems to be a link directive. The GHC docs seem to be project oriented. What's the two step process

[Haskell-cafe] Modules and a main function

2011-08-27 Thread michael rice
W/r/t the code below, would somebody please explain the sense of having a main function in a module that is not named Main.hs? Michael From: http://www.haskell.org/haskellwiki/State_Monad module StateGame where   import Control.Monad.State   -- Example use of State monad --

Re: [Haskell-cafe] Modules and a main function

2011-08-27 Thread michael rice
I'm not sure how to do that. Please demonstrate. Michael From: Brandon Allbery allber...@gmail.com To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org haskell-cafe@haskell.org Sent: Saturday, August 27, 2011 3:53 PM Subject: Re: [Haskell-cafe

Re: [Haskell-cafe] Modules and a main function

2011-08-27 Thread michael rice
Thanks all. I was trying to use --main-is. I even man-ed ghc and thought I saw a double dash there. As they say, believing is seeing. Michael From: Daniel Fischer daniel.is.fisc...@googlemail.com To: haskell-cafe@haskell.org; michael rice nowg...@yahoo.com

[Haskell-cafe] Simple Parsec example

2011-08-07 Thread michael rice
What other imports must I add to get this to run. I can't seem to get it right. Michael = import Text.ParserCombinators.Parsec.Prim main = case (parse numbers 11, 2, 43) of         Left err  - print err         Right xs  - print (sum xs) numbers = commaSep integer ==

Re: [Haskell-cafe] Simple Parsec example

2011-08-07 Thread michael rice
: [Haskell-cafe] Simple Parsec example To: haskell-cafe@haskell.org Date: Sunday, August 7, 2011, 8:00 PM On 11-08-07 02:44 PM, michael rice wrote: What other imports must I add to get this to run. I can't seem to get it right. [...] import Text.ParserCombinators.Parsec.Prim main = case (parse

[Haskell-cafe] Prelude read 1234 :: String - *** Exception: Prelude.read: no parse

2011-08-06 Thread michael rice
Prelude read 1234 :: Int1234Prelude read 1234 :: String*** Exception: Prelude.read: no parse Why? Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Fwd: Re: Period of a sequence

2011-06-27 Thread michael rice
, Steffen Schuldenzucker wrote: Forwarding to -cafe Original Message Subject: Re: [Haskell-cafe] Period of a sequence Date: Mon, 27 Jun 2011 04:46:10 -0700 (PDT) From: michael rice nowg...@yahoo.com To: Steffen Schuldenzucker sschuldenzuc...@uni-bonn.de Hi Steffen

[Haskell-cafe] Period of a sequence

2011-06-26 Thread michael rice
MathWorks has the function seqperiod(x) to return the period of sequence x. Is there an equivalent function in Haskell? Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints

2011-06-16 Thread michael rice
...@gmail.com Subject: Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Monday, June 13, 2011, 9:38 PM On Mon, Jun 13, 2011 at 8:56 PM, michael rice nowg...@yahoo.com wrote: Is there an (existing

Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints

2011-06-14 Thread michael rice
dups) from a range of Ints To: michael rice nowg...@yahoo.com Cc: Felipe Almeida Lessa felipe.le...@gmail.com, haskell-cafe@haskell.org Date: Tuesday, June 14, 2011, 5:17 AM Shuffle [1..20], then take 5? Yes, so simple, I'm embarrassed I didn't think of it. That works well for small numbers

Re: [Haskell-cafe] Best platform for development with GHC?

2011-06-14 Thread michael rice
I don't know about the other Linux distros, but Fedora seems to have excellent support for Haskell. Michael___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints

2011-06-13 Thread michael rice
Is there an (existing) way to select 5 Ints randomly (no duplicates) from a population, say 1-20 (inclusive)? Michael___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints

2011-06-13 Thread michael rice
: From: Felipe Almeida Lessa felipe.le...@gmail.com Subject: Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Monday, June 13, 2011, 9:38 PM On Mon, Jun 13, 2011 at 8:56 PM, michael

Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints

2011-06-13 Thread michael rice
rice nowg...@yahoo.com wrote: From: michael rice nowg...@yahoo.com Subject: Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints To: Felipe Almeida Lessa felipe.le...@gmail.com Cc: haskell-cafe@haskell.org Date: Monday, June 13, 2011, 10:31 PM Thanks, all

Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints

2011-06-13 Thread michael rice
And then reinstall the monte-carlo? Michael --- On Mon, 6/13/11, Felipe Almeida Lessa felipe.le...@gmail.com wrote: From: Felipe Almeida Lessa felipe.le...@gmail.com Subject: Re: [Haskell-cafe] Acquiring a random set of a specific size (w/o dups) from a range of Ints To: michael rice nowg

Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-30 Thread michael rice
and then cabal install soegtk? Michael --- On Mon, 5/30/11, John Lato jwl...@gmail.com wrote: From: John Lato jwl...@gmail.com Subject: Re: [Haskell-cafe] Haskell School of Expression (graphics) To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org, Andrew Coppin andrewcop

Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings

2011-05-30 Thread michael rice
Nice tool. I'll be using it a lot from now on, I'm sure. Thanks, Neil. Michael --- On Mon, 5/30/11, Neil Mitchell ndmitch...@gmail.com wrote: From: Neil Mitchell ndmitch...@gmail.com Subject: Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings To: michael rice nowg...@yahoo.com Cc

Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread michael rice
...@btinternet.com Subject: Re: [Haskell-cafe] Haskell School of Expression (graphics) To: haskell-cafe@haskell.org Date: Sunday, May 29, 2011, 9:45 AM On 28/05/2011 08:06 PM, michael rice wrote: /tmp/glib-0.11.22906/glib-0.11.2/Gtk2HsSetup.hs:190:70: Couldn't match expected type `[PackageDB

Re: [Haskell-cafe] Haskell School of Expression (graphics)

2011-05-29 Thread michael rice
Of which I was speaking, just saw it there this morning. Is there an adequate basic tutorial available? Michael --- On Sun, 5/29/11, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: From: Daniel Fischer daniel.is.fisc...@googlemail.com Subject: Re: [Haskell-cafe] Haskell School of

[Haskell-cafe] Haskell School of Expression (graphics)

2011-05-28 Thread michael rice
I installed the Haskell Platform (7.0.2) earlier, and I just downloaded package soegtk with cabal, apparently unsuccessfully. Any suggestions? Michael [michael@sabal ~]$ cabal updateConfig file path source is default config file.Config file /home/michael/.cabal/config not found.Writing default

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-27 Thread michael rice
at its parallelizing features. Thanks, Michael  --- On Fri, 5/27/11, Alex Mason axm...@gmail.com wrote: From: Alex Mason axm...@gmail.com Subject: Re: [Haskell-cafe] Parallel compilation and execution? To: michael rice nowg...@yahoo.com Cc: David Virebayre dav.vire+hask...@gmail.com, haskell-cafe

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-27 Thread michael rice
Oops! Guess I'm going to have to refine my searching techniques. Thanks, Simon. Michael --- On Fri, 5/27/11, Simon Marlow marlo...@gmail.com wrote: From: Simon Marlow marlo...@gmail.com Subject: Re: Parallel compilation and execution? To: michael rice nowg...@yahoo.com Cc: David Virebayre

[Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread michael rice
How do I compile and run this parallel program? Michael === import Control.Parallel nfib :: Int - Intnfib n | n = 1 = 1       | otherwise = par n1 (seq n2 (n1 + n2 + 1))                     where n1 = nfib (n-1)                           n2 = nfib (n-2) {-nfib :: Int -

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread michael rice
~]$  --- On Thu, 5/26/11, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: From: Daniel Fischer daniel.is.fisc...@googlemail.com Subject: Re: [Haskell-cafe] Parallel compilation and execution? To: haskell-cafe@haskell.org Cc: michael rice nowg...@yahoo.com Date: Thursday, May 26, 2011, 8:16 AM

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread michael rice
...@gmail.com Subject: Re: [Haskell-cafe] Parallel compilation and execution? To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org, Daniel Fischer daniel.is.fisc...@googlemail.com Date: Thursday, May 26, 2011, 8:56 AM 2011/5/26 michael rice nowg...@yahoo.com Thank, Daniel Multiple threads

Re: [Haskell-cafe] Parallel compilation and execution?

2011-05-26 Thread michael rice
Are the tools of Control.Parallel comparable to OpenMP? Michael --- On Thu, 5/26/11, michael rice nowg...@yahoo.com wrote: From: michael rice nowg...@yahoo.com Subject: Re: [Haskell-cafe] Parallel compilation and execution? To: David Virebayre dav.vire+hask...@gmail.com Cc: Daniel Fischer

Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings

2011-05-25 Thread michael rice
Yes, very nice. Thanks. Michael --- On Wed, 5/25/11, Henning Thielemann schlepp...@henning-thielemann.de wrote: From: Henning Thielemann schlepp...@henning-thielemann.de Subject: Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings To: michael rice nowg...@yahoo.com Cc: Haskell Cafe

Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings

2011-05-24 Thread michael rice
The input file: http://dl.dropbox.com/u/27842656/psalms The Markov chain exercise from The Practice of Programming, Kermighan/Pike. Sample runs at the end. Michael   import System.Environment(getArgs)import System.Randomimport Control.Applicativeimport

Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings

2011-05-24 Thread michael rice
a Haskell program (lines.hs) to turn them into lines. Michael --- On Tue, 5/24/11, Alexander Solla alex.so...@gmail.com wrote: From: Alexander Solla alex.so...@gmail.com Subject: Re: [Haskell-cafe] Code critique - Was [Maybe Int] sans Nothings To: michael rice nowg...@yahoo.com Cc: Haskell Cafe

[Haskell-cafe] [Maybe Int] sans Nothings

2011-05-23 Thread michael rice
What's the best way to end up with a list composed of only the Just values,no Nothings? Michael ==  import Control.Monad.Stateimport Data.Maybe type GeneratorState = State Int tick :: GeneratorState (Maybe Int)tick = do n - get          if ((n `mod` 7) == 0)           

Re: [Haskell-cafe] [Maybe Int] sans Nothings

2011-05-23 Thread michael rice
To: haskell-cafe Cafe haskell-cafe@haskell.org Date: Monday, May 23, 2011, 12:35 PM On 23 May 2011, at 17:20, michael rice wrote: What's the best way to end up with a list composed of only the Just values, no Nothings? Alternatively,     [ x      | Just x - originals ] It also occurs to me

Re: [Haskell-cafe] Can't access map value with key.

2011-05-21 Thread michael rice
with key. To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Friday, May 20, 2011, 11:36 PM On Fri, 2011-05-20 at 19:04 -0700, michael rice wrote: markov4.hs:35:27:     Couldn't match expected type `Map k a' against inferred type `(Map Prefix [String], Prefix, [String])' ghc seems

Re: [Haskell-cafe] Can't access map value with key.

2011-05-21 Thread michael rice
Duh... Thanks, Arlen. Michael --- On Sat, 5/21/11, Arlen Cuss cel...@sairyx.org wrote: From: Arlen Cuss cel...@sairyx.org Subject: Re: [Haskell-cafe] Can't access map value with key. To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Saturday, May 21, 2011, 8:17 AM On Sat

[Haskell-cafe] Can't access map value with key.

2011-05-20 Thread michael rice
What am I doing wrong in the last line of main? If I comment out the last line of main, my program prints the map (mp) that is created. If I leave it in, the program fails. The last line should print the list [I]. Michael import

[Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread michael rice
I'm not sure what's going on BELOW. Was working with mapAccumL earlier and decided to move over to State monad for more control. :m + Data.Map:m + Data.ListPrelude Data.List Data.Map let f key new old = new ++ oldPrelude Data.List Data.Map let moby2 = Moby Dick is a great book. Moby Dick was a

Re: [Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread michael rice
State monad To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Thursday, May 19, 2011, 12:22 PM On Thu, May 19, 2011 at 11:03, michael rice nowg...@yahoo.com wrote: type GeneratorState = (Map Prefix [String],Prefix,[String]) buildMap :: GeneratorState (Map Prefix [String]) You

Re: [Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread michael rice
$ runState buildMap (singleton (\n,\n) [], (\n,\n), [I,am,lost.])fromList *** Exception: Pattern match failure in do expression at markov3.hs:13:14-44 --- On Thu, 5/19/11, michael rice nowg...@yahoo.com wrote: From: michael rice nowg...@yahoo.com Subject: Re: [Haskell-cafe] Trying to return a map from

Re: [Haskell-cafe] Trying to return a map from State monad

2011-05-19 Thread michael rice
to return a map from State monad To: michael rice nowg...@yahoo.com Cc: Thedward Blevins thedw...@barsoom.net, haskell-cafe@haskell.org Date: Thursday, May 19, 2011, 4:57 PM The problem is that the all@(w1:words) pattern-match fails when all is empty. The quick and dirty fix is:     import

[Haskell-cafe] Hash table constructors return table in IO Monad. Why?

2011-05-12 Thread michael rice
Is there some reason why ALL the ways to create a hash table return one in the IO Monad, but all the functions for retrieving a value from a hash table take as an argument a hash table NOT in the IO Monad? Michael  = Prelude Data.HashTable let ht = fromList id

Re: [Haskell-cafe] Hash table constructors return table in IO Monad. Why?

2011-05-12 Thread michael rice
Thanks, Bryan and Stephan. I seem to remember playing around with a data structure that accumulates (in a list) different values associated with an identical key, i.e., insert data-structure abc 5insert data-structure abc 6 retrieve data-structure abc - [5,6] HashTable doesn't do it. Neither does

Re: [Haskell-cafe] Hash table constructors return table in IO Monad. Why?

2011-05-12 Thread michael rice
? To: michael rice nowg...@yahoo.com Cc: Stephen Tetley stephen.tet...@gmail.com, haskell-cafe@haskell.org Date: Thursday, May 12, 2011, 6:04 PM On Thu, May 12, 2011 at 12:59 PM, michael rice nowg...@yahoo.com wrote: HashTable doesn't do it. Neither does Map. Was I dreaming? multiInsert k v m

[Haskell-cafe] Markov chain algorithm (from The Practice of Programming, Kernighan/Pike)

2011-05-11 Thread michael rice
It's hard to improve on a 20 line Awk program for generating text but I thought it would be fun to investigate a Haskell solution. Why can't I cons an element onto an existing list? Michael Prelude Data.List Data.Map insertWith (:) (Moby, Dick) will (fromList [((Joe, Blow),[is]), ((Moby,

[Haskell-cafe] Type problem

2011-02-26 Thread michael rice
Why? Shouldn't this work for any type a? Michael == f :: [a] - [a] f l = do x - l return x == *Main :r [1 of 1] Compiling Main ( test.hs, interpreted ) Ok, modules loaded: Main. *Main f abcde abcde *Main f [1,2,3,4,5] [1,2,3,4,5] *Main abcde = f

Re: [Haskell-cafe] Type problem

2011-02-26 Thread michael rice
Yeah, my bad. Thanks. Michael --- On Sat, 2/26/11, Stephen Tetley stephen.tet...@gmail.com wrote: From: Stephen Tetley stephen.tet...@gmail.com Subject: Re: [Haskell-cafe] Type problem To: Cc: haskell-cafe@haskell.org Date: Saturday, February 26, 2011, 3:24 PM Does this help? listbind ::

[Haskell-cafe] Reader monad wrapping State monad

2011-02-03 Thread michael rice
Given the first program, it seems that the unchanging first element of the tuple could be handled by a Reader monad, leading to the second program, where b becomes the state, but how do I get the constant a from the Reader monad? Michael == import Control.Monad.State type

Re: [Haskell-cafe] Reader monad wrapping State monad

2011-02-03 Thread michael rice
, and in this case no use of lift at all. Michael --- On Thu, 2/3/11, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: From: Daniel Fischer daniel.is.fisc...@googlemail.com Subject: Re: [Haskell-cafe] Reader monad wrapping State monad To: haskell-cafe@haskell.org Cc: michael rice nowg...@yahoo.com Date

Re: [Haskell-cafe] Reader monad wrapping State monad

2011-02-03 Thread michael rice
And swap the arguments. Thanks for going the extra mile. Michael --- On Thu, 2/3/11, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: From: Daniel Fischer daniel.is.fisc...@googlemail.com Subject: Re: [Haskell-cafe] Reader monad wrapping State monad To: michael rice nowg

[Haskell-cafe] Typing problem

2011-01-31 Thread michael rice
I'm mapping a function over a list of data, where the mapping function is determined from the data. g f l = map (g l) l So g serialize prolog  -  [4,5,3,2,3,1] But I'm having typing problems trying to do a similar thing with a function that statistically normalizes data. See:

Re: [Haskell-cafe] Typing problem

2011-01-31 Thread michael rice
...@googlemail.com wrote: From: Daniel Fischer daniel.is.fisc...@googlemail.com Subject: Re: [Haskell-cafe] Typing problem To: haskell-cafe@haskell.org Cc: michael rice nowg...@yahoo.com Date: Monday, January 31, 2011, 1:38 PM On Monday 31 January 2011 18:29:59, michael rice wrote: I'm mapping

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
Allbery KF8NH allber...@gmail.com Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 2:00 AM -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 1/29/11 21:27 , michael rice wrote: I'm using the OpenGL stuff (GLFW

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
for is: http://www.haskell.org/haskellwiki/Gtk2Hs On 1/30/11 10:28 AM, michael rice wrote: OK, what about Hugs? I used Cabal to download the GLFW package to GHC. Must I do the same from Hugs? Or is this also

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
. Loading package OpenGL-2.4.0.1 ... linking ... done. Loading package GLFW-0.4.2 ... linking ... done. Michael --- On Sun, 1/30/11, Paul L nine...@gmail.com wrote: From: Paul L nine...@gmail.com Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: michael rice nowg

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
. To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 1:57 PM Ok, in the GLFW sample program from Haskell Wiki, can you change the GLFW.openWindow line to the following, and try again? GLFW.openWindow (GL.Size 400 400) [GLFW.DisplayStencilBits 8

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
-cafe] Code from Haskell School of Expression hanging. To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 3:53 PM You missed the comma after the first 8. On Sun, Jan 30, 2011 at 12:15 PM, michael rice nowg...@yahoo.com wrote: The expression (the swapped

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
hanging. To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, January 30, 2011, 5:43 PM Can you try simpler SOE programs, for example, ghci SimpleGraphics, and type main0 at the prompt. Does it show anything? Regards, Paul Liu On Sun, Jan 30, 2011 at 12:59 PM, michael

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
   ( SimpleGraphics.lhs, SimpleGraphics.o ) [michael@localhost src]$ --- On Sun, 1/30/11, Paul L nine...@gmail.com wrote: From: Paul L nine...@gmail.com Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, January 30

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
spaceClose w     --- On Sun, 1/30/11, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: From: Daniel Fischer daniel.is.fisc...@googlemail.com Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: haskell-cafe@haskell.org, michael rice nowg...@yahoo.com Date: Sunday, January 30

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-30 Thread michael rice
That worked, though not sure why I had to delete the .o file. On to ghci? Michael --- On Sun, 1/30/11, Paul L nine...@gmail.com wrote: From: Paul L nine...@gmail.com Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: michael rice nowg...@yahoo.com Cc: haskell-cafe

[Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-29 Thread michael rice
I got Hudak's Haskell School of Expression today and just tried a couple of the graphics programs from the software I downloaded at the book site. Both seem to hang on opening a window. Is there a fix for this problem? I'm on a Fedora 14 Linux (32-bit) box running GHC version 6.12.3. Michael

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-29 Thread michael rice
@haskell.org Cc: michael rice nowg...@yahoo.com Date: Saturday, January 29, 2011, 9:11 PM On Sunday 30 January 2011 02:49:27, michael rice wrote: I got Hudak's Haskell School of Expression today and just tried a couple of the graphics programs from the software I downloaded at the book site. Both seem

Re: [Haskell-cafe] Code from Haskell School of Expression hanging.

2011-01-29 Thread michael rice
Fischer daniel.is.fisc...@googlemail.com Subject: Re: [Haskell-cafe] Code from Haskell School of Expression hanging. To: michael rice nowg...@yahoo.com Date: Saturday, January 29, 2011, 9:37 PM On Sunday 30 January 2011 03:27:55, michael rice wrote: I'm using the OpenGL stuff (GLFW). Same set

[Haskell-cafe] Merry monad mixup?

2011-01-28 Thread michael rice
The first and third work, but not the second. Why? Michael == f :: String - IO () f s = do putStrLn s {- g :: [String] - IO () g l = do s - l putStrLn s -} {- h :: [Int] - [Int] h l = do i - l return (i+1) -} == serialize2.hs:29:9:     Couldn't

Re: [Haskell-cafe] Merry monad mixup?

2011-01-28 Thread michael rice
So, my suspicions are confirmed. Thanks, all. Michael --- On Fri, 1/28/11, Daniel Peebles pumpkin...@gmail.com wrote: From: Daniel Peebles pumpkin...@gmail.com Subject: Re: [Haskell-cafe] Merry monad mixup? To: Chris Smith cdsm...@gmail.com Cc: michael rice nowg...@yahoo.com, haskell cafe

Re: [Haskell-cafe] Haskell time line?

2011-01-20 Thread michael rice
@haskell.org, michael rice nowg...@yahoo.com Date: Thursday, January 20, 2011, 5:03 AM On Thu, 20 Jan 2011 03:49:49 +0100, michael rice nowg...@yahoo.com wrote: The Haskell language is some twenty years old. Is there a time line for what features were in the language's initial release and what has

[Haskell-cafe] Haskell time line?

2011-01-19 Thread michael rice
The Haskell language is some twenty years old. Is there a time line for what features were in the language's initial release and what has been added along the way? Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Haskell time line?

2011-01-19 Thread michael rice
at 06:49:49PM -0800, michael rice wrote: The Haskell language is some twenty years old. Is there a time line for what features were in the language's initial release and what has been added along the way? See A History of Haskell: Being Lazy with Class by Hudak, Hughes, and Jones.  It's a few

[Haskell-cafe] Monad transformer: apply StateT to List monad

2011-01-13 Thread michael rice
{- From: http://en.wikibooks.org/wiki/Haskell/Monad_transformers if for instance we apply StateT to the List monad, a function that returns a list (i.e., a computation in the List monad) can be lifted into StateT s [], where it becomes a function that returns a StateT (s - [(a,s)]). That is, the

Re: [Haskell-cafe] Monad transformer: apply StateT to List monad

2011-01-13 Thread michael rice
StateT to List monad To: haskell-cafe@haskell.org Cc: michael rice nowg...@yahoo.com Date: Thursday, January 13, 2011, 3:44 PM On Thursday 13 January 2011 21:17:41, michael rice wrote: {- From: http://en.wikibooks.org/wiki/Haskell/Monad_transformers if for instance we apply StateT to the List monad

Re: [Haskell-cafe] Monad transformer: apply StateT to List monad

2011-01-13 Thread michael rice
] Monad transformer: apply StateT to List monad To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Friday, January 14, 2011, 1:00 AM Lifting 'f' into StateT -- you get a list of (result, state) pairs. Since the state is never modified, the second half of each pair is identical

[Haskell-cafe] Not in scope: type constructor or class `Map'

2010-12-30 Thread michael rice
Not sure what's going on here. Doesn't like line 5, the type statement. And what's with the semicolons in that line and in function main? Michael = From: http://www.haskell.org/ghc/docs/6.10.3/html/libraries/mtl/Control-Monad-Reader.html import Control.Monad.Reader import qualified

Re: [Haskell-cafe] Not in scope: type constructor or class `Map'

2010-12-30 Thread michael rice
@haskell.org Date: Thursday, December 30, 2010, 11:17 AM On Thu, 30 Dec 2010 08:01:01 -0800 (PST) michael rice nowg...@yahoo.com wrote: Not sure what's going on here. Doesn't like line 5, the type statement. And what's with the semicolons in that line and in function main? import

[Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
From: Control.Monad.Reader type Reader r = ReaderT r IdentityThe parameterizable reader monad. Computations are functions of a shared environment. The return function ignores the environment, while = passes the inherited environment to both subcomputations Is there an

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
ryani.s...@gmail.com wrote: From: Ryan Ingram ryani.s...@gmail.com Subject: Re: [Haskell-cafe] Reader monad To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Wednesday, December 29, 2010, 11:11 AM On Wed, Dec 29, 2010 at 8:06 AM, michael rice nowg...@yahoo.com wrote

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
] Reader monad To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Wednesday, December 29, 2010, 12:28 PM On Wed, 29 Dec 2010, michael rice wrote: In the case of ReaderT and StateT newtype ReaderT r m a = ReaderT {     -- | The underlying computation, as a function

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
wrote: From: Michael Lazarev lazarev.mich...@gmail.com Subject: Re: [Haskell-cafe] Reader monad To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Wednesday, December 29, 2010, 12:42 PM 2010/12/29 michael rice nowg...@yahoo.com From the docs (and tuts) newtype creates a new type

Re: [Haskell-cafe] Reader monad

2010-12-29 Thread michael rice
daniel.is.fisc...@googlemail.com wrote: From: Daniel Fischer daniel.is.fisc...@googlemail.com Subject: Re: [Haskell-cafe] Reader monad To: haskell-cafe@haskell.org Cc: michael rice nowg...@yahoo.com Date: Wednesday, December 29, 2010, 2:47 PM On Wednesday 29 December 2010 19:30:11, michael rice wrote

[Haskell-cafe] Character encoding?

2010-12-26 Thread michael rice
How are characters encoded? *Main System.Random Control.Monad.State.Lazy random (mkStdGen 0) :: (Char,StdGen) ('\64685',40014 40692) *Main System.Random Control.Monad.State.Lazy random (snd it) :: (Char,StdGen) ('\1052295',1601120196 1655838864) *Main System.Random Control.Monad.State.Lazy

Re: [Haskell-cafe] Character encoding?

2010-12-26 Thread michael rice
, Dec 26, 2010 at 08:04:41AM -0800, michael rice wrote: How are characters encoded? A Char is a type that holds a single Unicode codepoint from one of the 17 planes. As a codepoint is just a number without any defined representation, it doesn't have an 'encoding'. -- Lars Viklund | z...@acc.umu.se

[Haskell-cafe] Intro to monad transformers

2010-12-26 Thread michael rice
I lifted the code below from here: http://en.wikibooks.org/wiki/Haskell/Monad_transformers Since the wiki page doesn't say what needs to be imported, I'm guessing. Not sure what is happening. Maybe someone can tell me. Michael == import Control.Monad import

Re: [Haskell-cafe] Intro to monad transformers

2010-12-26 Thread michael rice
rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, December 26, 2010, 2:30 PM On Sun, Dec 26, 2010 at 2:00 PM, michael rice nowg...@yahoo.com wrote:  instance Monad m = MonadPlus (MaybeT m) where     mzero = MaybeT $ return Nothing     mplus x y = MaybeT $ do maybe_value - runMaybeT

Re: [Haskell-cafe] Intro to monad transformers

2010-12-26 Thread michael rice
@haskell.org Cc: michael rice nowg...@yahoo.com, David Menendez d...@zednenem.com Date: Sunday, December 26, 2010, 4:07 PM On Sunday 26 December 2010 21:21:00, michael rice wrote: Ok, changed the last line and deleted the bad line. Maybe someone could recommend a better example? Michael

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-22 Thread michael rice
Thanks for the tip, Ozgur. It worked for me. Is this what you had in mind, Ryan? Michael == import Control.Monad.State.Lazy import Control.Monad import System.Random type GeneratorState = State StdGen data Craps a = Roll a | Win a | Lose a deriving (Show) genRandomR :: Random a =

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-21 Thread michael rice
/21/10, Ryan Ingram ryani.s...@gmail.com wrote: From: Ryan Ingram ryani.s...@gmail.com Subject: Re: [Haskell-cafe] Why is Haskell flagging this? To: michael rice nowg...@yahoo.com Cc: David Leimbach leim...@gmail.com, Daniel Fischer daniel.is.fisc...@googlemail.com, haskell-cafe@haskell.org Date

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-21 Thread michael rice
Ingram ryani.s...@gmail.com Subject: Re: [Haskell-cafe] Why is Haskell flagging this? To: michael rice nowg...@yahoo.com Cc: David Leimbach leim...@gmail.com, Daniel Fischer daniel.is.fisc...@googlemail.com, haskell-cafe@haskell.org Date: Tuesday, December 21, 2010, 7:00 PM First, let's make some

[Haskell-cafe] Why is Haskell flagging this?

2010-12-17 Thread michael rice
I don't understand this error message. Haskell appears not to understand that 1 is a Num. Prelude :t 1 1 :: (Num t) = t Prelude :t [1,2,3,4,5] [1,2,3,4,5] :: (Num t) = [t] Prelude Michael === f :: [Int] - IO [Int] f lst = do return lst main = do let lst = f [1,2,3,4,5]   

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-17 Thread michael rice
    Cc: michael rice nowg...@yahoo.com     Date: Friday, December 17, 2010, 4:24 PM     On Friday 17 December 2010 18:04:20, michael rice wrote:     I don't understand this error message. Haskell appears not to understand     that 1 is a Num.         Prelude :t 1     1 :: (Num t) = t     Prelude

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-17 Thread michael rice
...@gmail.com wrote: From: David Leimbach leim...@gmail.com Subject: Re: [Haskell-cafe] Why is Haskell flagging this? To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org, Daniel Fischer daniel.is.fisc...@googlemail.com Date: Friday, December 17, 2010, 7:45 PM No problem.  Haskell is a different

[Haskell-cafe] System.Console.Haskeline

2010-11-29 Thread michael rice
How do I load this module? Michael = *Main :m + System.Console.Haskeline no location info:     Could not find module `System.Console.Haskeline':   it is not a module in the current program, or in any known package. *Main

Re: [Haskell-cafe] Flagstone problem

2010-11-06 Thread michael rice
...@seas.upenn.edu Subject: Re: [Haskell-cafe] Flagstone problem To: haskell-cafe@haskell.org Date: Saturday, November 6, 2010, 7:03 AM On Thu, Nov 04, 2010 at 10:50:06AM -0700, michael rice wrote: Hi, I've been looking at a flagstone problem, where no two adjacent n-tuples can be identical. I

Re: [Haskell-cafe] Flagstone problem

2010-11-06 Thread michael rice
Hi, Alexander Your change produces the same sequence of 0s, 1s, and 2s. mod n 2 == fromEnum (even n) Michael --- On Sat, 11/6/10, Alexander Solla a...@2piix.com wrote: From: Alexander Solla a...@2piix.com Subject: Re: [Haskell-cafe] Flagstone problem To: Cc: haskell-cafe Cafe

[Haskell-cafe] Flagstone problem

2010-11-04 Thread michael rice
Hi, I've been looking at a flagstone problem, where no two adjacent n-tuples can be identical. I solved the problem with Icon using an array of stacks and was going to explore how to do it in Haskell when I saw another way to do it explained in the same text. Just count the ones between the zeros

[Haskell-cafe] A question about threading state

2010-09-16 Thread michael rice
I've been playing around with State Monads. Two I looked at earlier used *sequence* and *replicate* but when I came to this one I found myself puzzling over how to structure the problem when there was no predetermined count of how many times to thread the state. == Program 1

Re: [Haskell-cafe] Cost: (:) vs head

2010-09-12 Thread michael rice
-thielemann.de Subject: Re: [Haskell-cafe] Cost: (:) vs head To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Sunday, September 12, 2010, 8:47 AM michael rice schrieb: Which of these would be more costly for a long list? f :: [Int] - [Int] f [x] = [x] f (x:xs) = x + (head

Re: [Haskell-cafe] Cost: (:) vs head

2010-09-11 Thread michael rice
...@gmail.com wrote: From: Dan Doel dan.d...@gmail.com Subject: Re: [Haskell-cafe] Cost: (:) vs head To: haskell-cafe@haskell.org Cc: michael rice nowg...@yahoo.com Date: Friday, September 10, 2010, 11:29 PM On Friday 10 September 2010 11:13:50 pm michael rice wrote: Which of these would be more

Re: [Haskell-cafe] Cost: (:) vs head

2010-09-11 Thread michael rice
-cafe] Cost: (:) vs head To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Saturday, September 11, 2010, 8:46 AM On Sat, Sep 11, 2010 at 5:13 AM, michael rice nowg...@yahoo.com wrote: Which of these would be more costly for a long list? f :: [Int] - [Int] f [x] = [x] f (x:xs

Re: [Haskell-cafe] Cost: (:) vs head

2010-09-11 Thread michael rice
: (:) vs head To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Saturday, September 11, 2010, 2:59 PM On Sat, Sep 11, 2010 at 7:10 AM, michael rice nowg...@yahoo.com wrote: Hi Baz, That's quite an analysis, one I'll keep for future reference. So, my original coding was the fastest

[Haskell-cafe] Cost: (:) vs head

2010-09-10 Thread michael rice
Which of these would be more costly for a long list? f :: [Int] - [Int] f [x] = [x] f (x:xs) = x + (head xs) : f xs f :: [Int] - [Int] f [x] = [x] f (x:y:xs) = x + y : f (y:xs) Michael ___ Haskell-Cafe mailing list

  1   2   3   4   >