Re: [Haskell-cafe] Monads as control structures?

2005-10-27 Thread Bryn Keller
Creighton Hogg wrote: Hi, so I'm a newbie getting used to Haskell. I'm writing some simple things like genetic algorithms in it for practice, and I keep coming across something that really bugs me: are there any standard libraries that allow you to do imperative style for or while loops

Re: [Haskell-cafe] Quickcheck examples and Data.Word32

2005-10-27 Thread Bryn Keller
How about this? class ArbitraryDefault a where {} instance (Integral a, Bounded a, ArbitraryDefault a) = Arbitrary a where arbitrary = arbitraryBound coarbitrary a = error Not implemented instance ArbitraryDefault Word16 instance ArbitraryDefault Word32 instance ArbitraryDefault

Re: [Haskell-cafe] Quickcheck examples and Data.Word32

2005-10-27 Thread Bryn Keller
in the foot :-). Any explanation of undecidable instances, the good and the bad? Joel On Oct 27, 2005, at 6:49 PM, Bryn Keller wrote: How about this? class ArbitraryDefault a where {} instance (Integral a, Bounded a, ArbitraryDefault a) = Arbitrary a where arbitrary

Re: [Haskell-cafe] Best way to build strings?

2005-07-20 Thread Bryn Keller
How about this? instance Show Process where show Stop = Stop show (Prefix l p) = concat [(, l, -, show p, )] show (External p q) = concat [(, show p, [] , show q, )] Hope that helps, Bryn Andy Gimblett wrote: A small stylistic question: what's the best way to build strings

Re: Did you come to Haskell from Python? was Re: [Haskell-cafe] Are handles garbage-collected?

2004-10-26 Thread Bryn Keller
Shae Matijs Erisson wrote: Remi Turk [EMAIL PROTECTED] writes: At least one. (Me) And, judging from the amount of references to Python in these mailing-lists, I really doubt I'm the only one. At least two. I also came to Haskell from Python. Me three. I actually met Haskell mostly by

FTP, XMLRPC libraries?

2003-08-01 Thread Bryn Keller
Hi folks, I'm looking for FTP (client) and XMLRPC (client) libraries for Haskell. Does anyone know of any, or do I need to roll my own? Thanks, Bryn ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: Parsing CSV files

2003-07-29 Thread Bryn Keller
Shawn P. Garbett wrote: I did a small search for parsing a comma seperated file in Haskell and didn't find anything-- I threw one together a while ago: http://www.xoltar.org/languages/haskell/CSV.hs which isn't much different than your example, though it does handle nested quotation marks.

Database library?

2002-10-16 Thread Bryn Keller
Does anyone have a GHC-friendly library for accessing databases, specifically Oracle and MSSQL? I noticed Hasql on the Haskell libraries page, but it seems rather in the beginning stages, and I was hoping for native DB connections rather than ODBC ones. How are others handling database

Re: GHCI parse bug?

2002-10-16 Thread Bryn Keller
y z - x (map (+y) z) if you wish. -- Hal Daume III Computer science is no more about computers| [EMAIL PROTECTED] than astronomy is about telescopes. -Dijkstra | www.isi.edu/~hdaume On Wed, 16 Oct 2002, Bryn Keller wrote: Prelude let f = \x-\y-\z-x (map (+ y) z) interactive