Send Beginners mailing list submissions to beginners@haskell.org To subscribe or unsubscribe via the World Wide Web, visit http://www.haskell.org/mailman/listinfo/beginners or, via email, send a message with subject or body 'help' to beginners-requ...@haskell.org
You can reach the person managing the list at beginners-ow...@haskell.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Beginners digest..." Today's Topics: 1. Re: Problem to compile an example of Data Parallel Haskell (Brent Yorgey) 2. Re: using quickcheck for blackbox testing for 3rd party apps. (Brent Yorgey) 3. Re: using quickcheck for blackbox testing for 3rd party apps. (Daniel Fischer) 4. new locale? (Robert Wills) 5. "sleep" in Haskell (Michael Mossey) 6. Re: "sleep" in Haskell (Joe Fredette) 7. Re: "sleep" in Haskell (Michael Mossey) 8. Re: "sleep" in Haskell (Michael Mossey) 9. Re: "sleep" in Haskell (Joe Fredette) 10. Re: "sleep" in Haskell (Joe Fredette) ---------------------------------------------------------------------- Message: 1 Date: Tue, 13 Oct 2009 11:51:39 -0400 From: Brent Yorgey <byor...@seas.upenn.edu> Subject: Re: [Haskell-beginners] Problem to compile an example of Data Parallel Haskell To: beginners@haskell.org Message-ID: <20091013155139.ga2...@seas.upenn.edu> Content-Type: text/plain; charset=us-ascii On Mon, Oct 12, 2009 at 02:26:28PM +0200, Edgar GOMES DE ARAUJO wrote: > Hi, > > I have tried to compile an example of DPH (Data prallel Haskell) but I am > not getting any success. > The target is the concmop.hs > (http://darcs.haskell.org/ghc-6.10/packages/dph/examples/concomp/) for > calculate connected components in a graph. I am using GHC 6.10.4 compiled > with extras libs (which also includes DPH 0.3.0). > I've got this error. Seems that GHC can't find these functions/types. > > --------------------------------------------------------------------------------------------------------------------- > ed...@edgar-ubuntu:~/Desktop/dph$ ghc --make -fdph-par -XTypeOperators > ./concomp.hs > [1 of 4] Compiling Graph ( Graph.hs, Graph.o ) > > Graph.hs:11:45: Not in scope: type constructor or class `:*:' > > Graph.hs:23:6: Not in scope: `hPutU' > > Graph.hs:33:15: Not in scope: `hGetU' > --------------------------------------------------------------------------------------------------------------------- Perhaps that file is just missing an import? IIRC these things are from Data.Array.Vector, from the uvector package. -Brent ------------------------------ Message: 2 Date: Tue, 13 Oct 2009 12:04:52 -0400 From: Brent Yorgey <byor...@seas.upenn.edu> Subject: Re: [Haskell-beginners] using quickcheck for blackbox testing for 3rd party apps. To: beginners@haskell.org Message-ID: <20091013160452.gb2...@seas.upenn.edu> Content-Type: text/plain; charset=us-ascii On Mon, Oct 12, 2009 at 11:51:49AM +0530, Srikanth K wrote: > > However, being a newbie, I am not able to understand how I can extract the > "Response" part from the IO Response. > > I want something as follows > prop_App state_x command_y = (abstract_App state_x command_y ) == (real_App > state_x command_y) > > > The issue here is that since the reall_App would return a "IO Response" and > not "Response" I cannot really compare the abstract_App with the real_App. > > Any thought on how I can extract the value from the "IO Response" so that I > can compare the the two implementations for equvivalence. Hi Srikanth, The short answer is: you can't extract a Response from an IO Response. Once something is infected with IO, there's no cure!* However, you can compare the responses if you make the result of prop_App an IO action itself: prop_App :: State -> Command -> IO Bool prop_App state_x command_y = do realResponse <- real_App state_x command_y return $ abstract_App state_x command_y == realResponse Off the top of my head I'm not sure of the proper way to run such monadic tests with QuickCheck, but it can definitely be done. -Brent * Some smart-alecks might pipe up with something about unsafePerformIO here. But that's not a cure, it's more like performing an emergency tracheotomy with a ballpoint pen. ------------------------------ Message: 3 Date: Tue, 13 Oct 2009 19:34:36 +0200 From: Daniel Fischer <daniel.is.fisc...@web.de> Subject: Re: [Haskell-beginners] using quickcheck for blackbox testing for 3rd party apps. To: beginners@haskell.org, haskell-c...@haskell.org Message-ID: <200910131934.36808.daniel.is.fisc...@web.de> Content-Type: text/plain; charset="iso-8859-1" Am Dienstag 13 Oktober 2009 18:04:52 schrieb Brent Yorgey: > Brent > > * Some smart-alecks might pipe up with something about unsafePerformIO > here. But that's not a cure, it's more like performing an emergency > tracheotomy with a ballpoint pen. Quote of the month! ------------------------------ Message: 4 Date: Wed, 14 Oct 2009 05:44:34 +0100 From: Robert Wills <wrwi...@gmail.com> Subject: [Haskell-beginners] new locale? To: beginners@haskell.org Message-ID: <4ad55732.6010...@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Hello, http://hackage.haskell.org/package/old-locale-1.0.0.1 says "This package provides the old locale library. For new code, the new locale library is recommended." Does anyone know where I would find the new library? Thanks, Rob ------------------------------ Message: 5 Date: Wed, 14 Oct 2009 13:50:11 -0700 From: Michael Mossey <m...@alumni.caltech.edu> Subject: [Haskell-beginners] "sleep" in Haskell To: beginners <beginners@haskell.org> Message-ID: <4ad63983.8000...@alumni.caltech.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed I can't find a "sleep" function in Haskell. This relates to my wish to use PortMidi and control the timing of actions. Maybe there is another way to do this sort of thing in Haskell. Can anyone help, either with PortMidi or just a general explanation of how IO operations could be placed at certain points in time? Thanks, Mike ------------------------------ Message: 6 Date: Wed, 14 Oct 2009 16:51:50 -0400 From: Joe Fredette <jfred...@gmail.com> Subject: Re: [Haskell-beginners] "sleep" in Haskell To: Michael Mossey <m...@alumni.caltech.edu> Cc: beginners <beginners@haskell.org> Message-ID: <2815f39f-aeb3-49d6-9337-b44690da0...@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes As I recall, System.Thread (or something similar) provides "threadSleep". A quick hoogle ought to find it. hoogle -> haskell.org/hoogle On Oct 14, 2009, at 4:50 PM, Michael Mossey wrote: > I can't find a "sleep" function in Haskell. This relates to my wish > to use PortMidi and control the timing of actions. Maybe there is > another way to do this sort of thing in Haskell. Can anyone help, > either with PortMidi or just a general explanation of how IO > operations could be placed at certain points in time? > > Thanks, > Mike > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners ------------------------------ Message: 7 Date: Wed, 14 Oct 2009 13:54:43 -0700 From: Michael Mossey <m...@alumni.caltech.edu> Subject: Re: [Haskell-beginners] "sleep" in Haskell To: beginners <beginners@haskell.org> Message-ID: <4ad63a93.2040...@alumni.caltech.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi Joe, My program does not need to be threaded, so initially I ignored System.Thread, but perhaps either (1) This particular function can be used in a single-thread process or (2) I need to learn how to use threads if I want to place IO operations in time. ? Joe Fredette wrote: > As I recall, System.Thread (or something similar) provides > "threadSleep". A quick hoogle ought to find it. > > hoogle -> haskell.org/hoogle > > On Oct 14, 2009, at 4:50 PM, Michael Mossey wrote: > >> I can't find a "sleep" function in Haskell. This relates to my wish to >> use PortMidi and control the timing of actions. Maybe there is another >> way to do this sort of thing in Haskell. Can anyone help, either with >> PortMidi or just a general explanation of how IO operations could be >> placed at certain points in time? >> >> Thanks, >> Mike >> _______________________________________________ >> Beginners mailing list >> Beginners@haskell.org >> http://www.haskell.org/mailman/listinfo/beginners > ------------------------------ Message: 8 Date: Wed, 14 Oct 2009 13:58:00 -0700 From: Michael Mossey <m...@alumni.caltech.edu> Subject: Re: [Haskell-beginners] "sleep" in Haskell To: beginners <beginners@haskell.org> Message-ID: <4ad63b58.5060...@alumni.caltech.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hi Philippa, I think you have the right idea, and I want to try that too, but right now I'm using a kind of scattershot approach to try and learn everything I can, both about MIDI and Haskell in general. Since nothing is currently working, getting anything to work would be a learning experience. Thanks, Mike Philippa Cowderoy wrote: > Michael Mossey wrote: >> I can't find a "sleep" function in Haskell. This relates to my wish to >> use PortMidi and control the timing of actions. Maybe there is another >> way to do this sort of thing in Haskell. Can anyone help, either with >> PortMidi or just a general explanation of how IO operations could be >> placed at certain points in time? >> > > Y'know, I can't think of a single language where I'd consider using the > sleep function to time MIDI output. It's normally done with buffered > I/O. I don't know PortMidi, though. > ------------------------------ Message: 9 Date: Wed, 14 Oct 2009 16:58:55 -0400 From: Joe Fredette <jfred...@gmail.com> Subject: Re: [Haskell-beginners] "sleep" in Haskell To: Michael Mossey <m...@alumni.caltech.edu> Cc: beginners <beginners@haskell.org> Message-ID: <c944d186-01bc-4e15-a5e9-fa6392a91...@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Your program may not be multithreaded, but it is threaded. :) so threadSleep <ms> will still work, it'll just pause the thread it's executed in, namely the main thread, which is the one you want. So I guess the answer to your first question is yes, it can be used. And 2, no you don't need to learn to use threads, beyond the very basic calling of threadSleep. On Oct 14, 2009, at 4:54 PM, Michael Mossey wrote: > > Hi Joe, > > My program does not need to be threaded, so initially I ignored > System.Thread, but perhaps either > > (1) This particular function can be used in a single-thread process > > or > > (2) I need to learn how to use threads if I want to place IO > operations in time. > > ? > > Joe Fredette wrote: >> As I recall, System.Thread (or something similar) provides >> "threadSleep". A quick hoogle ought to find it. >> hoogle -> haskell.org/hoogle >> On Oct 14, 2009, at 4:50 PM, Michael Mossey wrote: >>> I can't find a "sleep" function in Haskell. This relates to my >>> wish to use PortMidi and control the timing of actions. Maybe >>> there is another way to do this sort of thing in Haskell. Can >>> anyone help, either with PortMidi or just a general explanation of >>> how IO operations could be placed at certain points in time? >>> >>> Thanks, >>> Mike >>> _______________________________________________ >>> Beginners mailing list >>> Beginners@haskell.org >>> http://www.haskell.org/mailman/listinfo/beginners > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners ------------------------------ Message: 10 Date: Wed, 14 Oct 2009 17:00:07 -0400 From: Joe Fredette <jfred...@gmail.com> Subject: Re: [Haskell-beginners] "sleep" in Haskell To: Michael Mossey <m...@alumni.caltech.edu> Cc: beginners <beginners@haskell.org> Message-ID: <650292fe-20bc-40c1-b6c1-0c54a7295...@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes >> Second reply to the same email, completely off topic. MIDI + Haskell = Computer Music, I'm already excited to see results, make sure you put stuff on hackage! /Joe On Oct 14, 2009, at 4:58 PM, Michael Mossey wrote: > Hi Philippa, > > I think you have the right idea, and I want to try that too, but > right now I'm using a kind of scattershot approach to try and learn > everything I can, both about MIDI and Haskell in general. Since > nothing is currently working, getting anything to work would be a > learning experience. > > Thanks, > Mike > > Philippa Cowderoy wrote: >> Michael Mossey wrote: >>> I can't find a "sleep" function in Haskell. This relates to my >>> wish to use PortMidi and control the timing of actions. Maybe >>> there is another way to do this sort of thing in Haskell. Can >>> anyone help, either with PortMidi or just a general explanation of >>> how IO operations could be placed at certain points in time? >>> >> Y'know, I can't think of a single language where I'd consider using >> the sleep function to time MIDI output. It's normally done with >> buffered I/O. I don't know PortMidi, though. > _______________________________________________ > Beginners mailing list > Beginners@haskell.org > http://www.haskell.org/mailman/listinfo/beginners ------------------------------ _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners End of Beginners Digest, Vol 16, Issue 7 ****************************************