Re: [Haskell-cafe] Thread scheduling

2010-06-11 Thread David Powell
On Fri, Jun 11, 2010 at 3:34 PM, Luke Palmer lrpal...@gmail.com wrote: Say, using System.Time.getClockTime. Luke On Thu, Jun 10, 2010 at 11:31 PM, Luke Palmer lrpal...@gmail.com wrote: On Thu, Jun 10, 2010 at 11:50 AM, Andrew Coppin andrewcop...@btinternet.com wrote: Control.Concurrent

[Haskell-cafe] CGI differences FastCGI

2010-06-11 Thread Jonas Fager
Hi. This is probably I must be blind department I have a very basic strip down echo cgi that runs with apache2. When I try to modfi it to be a FastCGI instead and run it with spawn-fcgi with nginx It don't behave as expected. I suppose that the line that don't get any data is mn - getInputFPS

[Haskell-cafe] Re: Help with Bird problem 3.3.3

2010-06-11 Thread Heinrich Apfelmus
Günther Schmidt wrote: I'm just re-reading the book again, this time doing the exercises though :) Is there a site with solutions for the exercises? Unless you count the haskell-cafe and beginners mailing lists as sites, I don't know any sites which have the solutions. ;) Problem 3.3.3:

Re: [Haskell-cafe] Re: How to Show an Operation?

2010-06-11 Thread Daniel Fischer
On Friday 11 June 2010 07:47:03, Martin Drautzburg wrote: On Friday, 11. June 2010 00:12:03 Daniel Fischer wrote: Thanks Daniel. Upgrade. We're at 6.12 now! Did that. Everything is available now. I am still having trouble with the test function. First it seems I need braces, so I can

Re: [Haskell-cafe] Re: How to Show an Operation?

2010-06-11 Thread Luke Palmer
On Thu, Jun 10, 2010 at 2:10 PM, Maciej Piechotka uzytkown...@gmail.com wrote: data Named a = Named String a instance Functor Named where    f `fmap` (Named s v) = Named s (f v) instance Applicative Named where    pure x = Named x    (Named s f) * (Named t v) = Named (s ++ ( ++ t ++ )) (f

[Haskell-cafe] threadDelay correctness

2010-06-11 Thread Roman Cheplyaka
* David Powell da...@drp.id.au [2010-06-11 16:09:55+1000] This is a slightly different issue, but isn't there a potential problem with threadDelay? I noticed that internally threadDelay uses gettimeofday() as the absolute time source (on linux at least). Isn't there potential problem with

Re: [Haskell-cafe] Using the ContT monads for early exits of IO ?

2010-06-11 Thread Roman Cheplyaka
* Günther Schmidt gue.schm...@web.de [2010-06-11 01:22:27+0200] there is nothing wrong with ifs as such except the won't actually exit a long piece of code, the computation will continue, just in a useless way. Can you clarify? -- Roman I. Cheplyaka :: http://ro-che.info/ Don't let school

Re: [Haskell-cafe] Re: How to Show an Operation?

2010-06-11 Thread Daniel Fischer
On Friday 11 June 2010 11:50:55, Luke Palmer wrote: On Thu, Jun 10, 2010 at 2:10 PM, Maciej Piechotka uzytkown...@gmail.com wrote: data Named a = Named String a instance Functor Named where    f `fmap` (Named s v) = Named s (f v) instance Applicative Named where    pure x = Named

[Haskell-cafe] Re: package naming policy

2010-06-11 Thread Henning Thielemann
On Tue, 8 Jun 2010, Don Stewart wrote: Great points: I've added them to this wiki page of for and against points: http://haskell.org/haskellwiki/Libraries/WhenToRewriteOrRename Please add points as you see fit, and maybe we can come up with a mitigation/change plan. Closely related is

Re: [Haskell-cafe] Re: package naming policy

2010-06-11 Thread Ivan Lazar Miljenovic
Henning Thielemann lemm...@henning-thielemann.de writes: Closely related is the question of module names. 'transformers'+'monads-fd' are somehow an successor of 'mtl' and chose distinct package names, but there were module name clashes. They mostly hurted GHCi users, but this led to a lot of

Re: [Haskell-cafe] How to Show an Operation?

2010-06-11 Thread Bas van Dijk
On Mon, Jun 7, 2010 at 9:49 PM, Claus Reinke claus.rei...@talk21.com wrote: As others have pointed out, you can't go from operation to representation, but you can pair operations and expressions with their representations. This idea is also implemented in my little 'repr' package:

Re: [Haskell-cafe] Re: GATD and pattern matching

2010-06-11 Thread Ben Millwood
On Fri, Jun 11, 2010 at 12:46 AM, Felipe Lessa felipe.le...@gmail.com wrote:  eqTypeable :: (Typeable a, Eq a, Typeable b, Eq b) = a - b - Bool  eqTypeable x y = case cast y of                     Just y' - x == y'                     Nothing - False ...or indeed: eqTypeable x y = cast x

Re: [Haskell-cafe] Using the ContT monads for early exits of IO ?

2010-06-11 Thread Christopher Done
On 11 June 2010 10:12, Roman Cheplyaka r...@ro-che.info wrote: * Günther Schmidt gue.schm...@web.de [2010-06-11 01:22:27+0200] there is nothing wrong with ifs as such except the won't actually exit a long piece of code, the computation will continue, just in a useless way. Can you clarify?

Re[2]: [Haskell-cafe] Using the ContT monads for early exits of IO ?

2010-06-11 Thread Bulat Ziganshin
Hello Christopher, Friday, June 11, 2010, 4:06:05 PM, you wrote: do if x then return () else do bar; continueComputation i format it this way: if x then return () else do bar continueComputation -- Best regards, Bulat

Re: Re[2]: [Haskell-cafe] Using the ContT monads for early exits of IO ?

2010-06-11 Thread Christopher Done
On 11 June 2010 14:27, Bulat Ziganshin bulat.zigans...@gmail.com wrote: i format it this way: if x then return () else do bar continueComputation That's a nice way of formatting! God bless optional formatting! I like this problem-specific indentation. Another is: if xthen foo else

Re[4]: [Haskell-cafe] Using the ContT monads for early exits of IO ?

2010-06-11 Thread Bulat Ziganshin
Hello Christopher, Friday, June 11, 2010, 4:35:00 PM, you wrote: if xthen foo else if y then bar else if z then mu else zot case () of _ | x - foo | y - bar | otherwise - zor it's usually considered as haskell way of doing this -- Best regards, Bulat

Re: [Haskell-cafe] Re: GATD and pattern matching

2010-06-11 Thread Ozgur Akgun
I don't know whether its a good name or not (the ===), but I have the following in a generic utilities file I have, and I use it every now and then. (===) :: (Typeable a, Typeable b, Eq b) = a - b - Bool (===) x y = cast x == Just y (Notice you don't need Eq a in the context) On 11 June 2010

[Haskell-cafe] Re: [Haskell] Woes on MacOS 10.6 - linking issues

2010-06-11 Thread Pepe Iborra
(moving to the cafe) There is an incompatibility between the version of iconv in Mac Os and the one included in MacPorts. As the RTS of the build of ghc in the Haskell Platform is linked against Mac Os iconv, you cannot use it with the build of gtk2hs from MacPorts. This is a known issue already

Re: Re[4]: [Haskell-cafe] Using the ContT monads for early exits of IO ?

2010-06-11 Thread Christopher Done
On 11 June 2010 14:40, Bulat Ziganshin bulat.zigans...@gmail.com wrote: if x        then foo else if y then bar else if z then mu else             zot case () of  _ | x - foo   | y - bar   | otherwise - zor it's usually considered as haskell way of doing this The example is merely to

[Haskell-cafe] Encoding the encoding type of a string into its type

2010-06-11 Thread Christopher Done
There are a lot of issues with string encoding type mismatches. Especially automatic conversions. This mailing list gets enough posts about encoding confusions. Would it make sense to make the string depend on its encoding type? E.g. a String UTF16 cannot be used with putStrLn :: String UTF8, it

Re: [Haskell-cafe] Encoding the encoding type of a string into its type

2010-06-11 Thread Felipe Lessa
On Fri, Jun 11, 2010 at 04:17:25PM +0200, Christopher Done wrote: There are a lot of issues with string encoding type mismatches. Especially automatic conversions. This mailing list gets enough posts about encoding confusions. Would it make sense to make the string depend on its encoding

[Haskell-cafe] Re: [Haskell] ANNOUNCE: Sifflet visual programming language, release 0.1.7

2010-06-11 Thread Henning Thielemann
On Fri, 11 Jun 2010, Ben Millwood wrote: On Fri, Jun 11, 2010 at 2:52 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: I'm uncertain whether fgl conforms to the package versioning policy, but if it does, then changes in its Cabal file should not bother sifflet. Thus upper bound

[Haskell-cafe] Code review of text-xml-generic

2010-06-11 Thread Oscar Finnsson
Hi, I've been working on a (de)serialization package from/to XML (using SYB) and wondering if anyone feels like giving me a quick code review before I upload it to hackagedb. The source code can be found at http://github.com/finnsson/Text.XML.Generic It is *heavily* inspired by

Re: [Haskell-cafe] Re: Using the ContT monads for early exits of IO ?

2010-06-11 Thread Maciej Piechotka
On Thu, 2010-06-10 at 21:21 +0100, Ben Millwood wrote: On Thu, Jun 10, 2010 at 8:57 PM, Maciej Piechotka uzytkown...@gmail.com wrote: Error monad seems not to be a semantic solution as we exit on success not failure. Which is really why the Either monad should not necessarily have

Re: [Haskell-cafe] Problems with threading?

2010-06-11 Thread Isaac Gouy
--- On Thu, 6/10/10, Louis Wasserman wasserman.lo...@gmail.com wrote: Date: Thursday, June 10, 2010, 1:32 AM Yeah, Control.Parallel would be nice to have.  Heck, ideally I could get the whole Haskell Platform, which would be a reasonable comparison to the huge Java and C++ libraries

Re: [Haskell-cafe] Re: GATD and pattern matching

2010-06-11 Thread Dupont Corentin
Thanks all, it works fine (see below). I lamentably try to make the same for show: showTypeable :: (Typeable a) = a - String showTypeable x = case cast x of Just x' - show x' Nothing - Because it really upsets me to add this show constraints to the

Re: [Haskell-cafe] Re: GATD and pattern matching

2010-06-11 Thread Felipe Lessa
On Sat, Jun 12, 2010 at 12:13:14AM +0200, Dupont Corentin wrote: Thanks all, it works fine (see below). I lamentably try to make the same for show: showTypeable :: (Typeable a) = a - String showTypeable x = case cast x of Just x' - show x'

Re: [Haskell-cafe] GATD and pattern matching

2010-06-11 Thread Antoine Latter
On Friday, June 11, 2010, Felipe Lessa felipe.le...@gmail.com wrote: On Sat, Jun 12, 2010 at 12:13:14AM +0200, Dupont Corentin wrote: Thanks all, it works fine (see below). I lamentably try to make the same for show: showTypeable :: (Typeable a) = a - String showTypeable x = case cast x of

Re: [Haskell-cafe] GATD and pattern matching

2010-06-11 Thread Felipe Lessa
On Fri, Jun 11, 2010 at 08:12:43PM -0500, Antoine Latter wrote:  1) Which extensions are required to make the code compile. OverlappingInstances (of course), and IncoherrentInstances, since neither instance is more specific than the other. Well, I guess it can't be compiled at all :( $

Re: [Haskell-cafe] Problems with threading?

2010-06-11 Thread Isaac Gouy
--- On Wed, 6/9/10, Don Stewart d...@galois.com wrote: -snip- Now how do we get those regex-dna and binary-trees programs to compile? http://shootout.alioth.debian.org/u32/measurements.php?lang=ghc binary-trees:     Could not find module `Control.Parallel.Strategies':        

Re: [Haskell-cafe] Problems with threading?

2010-06-11 Thread Don Stewart
igouy2: parallel, regex-posix, regex-pcre are now installed and the current compile errors are caused by the programs not the absence of required libraries - http://shootout.alioth.debian.org/u64q/program.php?test=binarytreeslang=ghcid=2#log