[Haskell-cafe] Blocking problem reading a handle

2011-03-24 Thread Daniel Díaz
Hi, cafe, all I want is to read the unread portion of a handle, without blocking waiting for an EOF or a newline. My first attempt was to try with hGetBufNonBlocking from System.IO, and other functions that use it in its definition (directly or indirectly). But, unfortunately:

Re: [Haskell-cafe] threading question for ghc 7.0.2

2011-03-24 Thread oliver mueller
after reading in GHC's implementation of concurrency and even more important in the documentation of hWaitForInput it seems clear that my receiver thread blocks and the sender cannot be executed: NOTE for GHC users: unless you use the -threaded flag, hWaitForInput t where t = 0 will block all

Re: [Haskell-cafe] Blocking problem reading a handle

2011-03-24 Thread Jason Dagit
On Thu, Mar 24, 2011 at 1:49 AM, Daniel Díaz danield...@asofilak.es wrote: Hi, cafe, all I want is to read the unread portion of a handle, without blocking waiting for an EOF or a newline. My first attempt was to try with hGetBufNonBlocking from System.IO, and other functions that use it in

Re: [Haskell-cafe] threading question for ghc 7.0.2

2011-03-24 Thread Gregory Collins
On Thu, Mar 24, 2011 at 9:53 AM, oliver mueller oliver.muel...@gmail.com wrote: if anybody knows of a better way please let me know! I'd recommending trying to fix your obscure FFI problems re: the threaded RTS and go back to using that. Switching concurrency off altogether is a curious response

[Haskell-cafe] GHC 7/Cabal request for help

2011-03-24 Thread John Goerzen
Hi folks, I don't have a GHC 7 environment running yet (it's on my list...) but I received a bug report pointing me at this build failure: http://hackage.haskell.org/packages/archive/testpack/2.0.1/logs/failure/ghc-7.0 Among other things, this noted: Dependency QuickCheck =2.1.0.3: using

Re: [Haskell-cafe] Class constraints for associated type synonyms

2011-03-24 Thread Simon Peyton-Jones
| class Monoid (GeneratorOf a) = Generable a where | type GeneratorOf a :: * - * | construct :: GeneratorOf a - a | | Now, it seems I need FlexibleInstances to do this when I'm using an | associated type synonym, but I don't need the flexibility when using a | multiparameter type class.

Re: [Haskell-cafe] GHC 7/Cabal request for help

2011-03-24 Thread Erik Hesselink
I've just tested this, and with GHC 7, cabal chooses QuickCheck 2.4, whereas with GHC 6.12, it chooses 2.1. If I specify that 6.12 should choose 2.4 as well, I get the same issue there. This is to be expected, because I don't see the CPP checks you mentioned in Test/QuickCheck/Instances.hs in

Re: [Haskell-cafe] GHC 7/Cabal request for help

2011-03-24 Thread Rogan Creswick
On Thu, Mar 24, 2011 at 9:30 AM, Erik Hesselink hessel...@gmail.com wrote: I've just tested this, and with GHC 7, cabal chooses QuickCheck 2.4, whereas with GHC 6.12, it chooses 2.1. I believe that the behavior you're seeing is because the package selection is biased by the state of your local

[Haskell-cafe] Tying the recursive knot

2011-03-24 Thread Joshua Ball
{- - Hi all, - - I'm having trouble tying the recursive knot in one of my programs. - - Suppose I have the following data structures and functions: -} module Recursion where import Control.Monad.Fix import Data.Map ((!)) import qualified Data.Map as M import Debug.Trace newtype Key = Key {

Re: [Haskell-cafe] GHC 7/Cabal request for help

2011-03-24 Thread John Goerzen
On 03/24/2011 11:30 AM, Erik Hesselink wrote: I've just tested this, and with GHC 7, cabal chooses QuickCheck 2.4, whereas with GHC 6.12, it chooses 2.1. If I specify that 6.12 should choose 2.4 as well, I get the same issue there. This is to be expected, because I don't see the CPP checks you

Re: [Haskell-cafe] Tying the recursive knot

2011-03-24 Thread Joshua Ball
Never mind. I figured it out on my own. Here's my solution for posterity. There's probably a fix hiding in there somewhere - notice the new type of reduce. module Recursion where import Data.Map ((!)) import qualified Data.Map as M import Debug.Trace newtype Key = Key { unKey :: String }

Re: [Haskell-cafe] Tying the recursive knot

2011-03-24 Thread Luke Palmer
On Thu, Mar 24, 2011 at 4:02 PM, Joshua Ball joshbb...@gmail.com wrote: Never mind. I figured it out on my own. Here's my solution for posterity. There's probably a fix hiding in there somewhere - notice the new type of reduce. Yep, there is: force :: M.Map Key Chain - M.Map Key [Int] force

[Haskell-cafe] Haskell programming 3 month internship in Tokyo

2011-03-24 Thread employment
Tsuru Capital has an opening for an intern for three months starting next month in Tokyo. We are looking for people with moderate experience with Haskell or another functional programming language. Evidence of work written in Haskell is a big plus. More details can be found here. There is a

Re: [Haskell-cafe] STM, newArray, and a stack overflow?

2011-03-24 Thread Albert Y. C. Lai
On 11-03-23 05:31 PM, Ketil Malde wrote: Any idea why it works in GHCI? Documentedly, stack limit is 8M, and can be changed by +RTS -K42M (for example). Undocumentedly, certain magic numbers given to -K seem to waive the limit (or set it so high I haven't fathomed). GHC 6.10.4: 4 to 59