Re: [Haskell-cafe] simple parsec question

2013-03-05 Thread Immanuel Normann
Carlo, Thanks a lot! This looks very promising (though I have to test it for my purpose more in depth). As you mention, the key seems to be the optionMaybe combinator. Thanks for pointing to it. Immanuel 2013/3/5 Carlo Hamalainen carlo.hamalai...@gmail.com On Mon, Mar 4, 2013 at 1:44 AM,

[Haskell-cafe] Haskell + RankNTypes + (forall p. p Char - p Bool) sound?

2013-03-05 Thread Shachaf Ben-Kiki
I was trying to figure out a way to write absurd :: (forall p. p Char - p Bool) - Void using only rank-n types. Someone suggested that Haskell with RankNTypes and a magic primitive of type (forall p. p Char - p Bool) might be sound (disregarding the normal ways to get ⊥, of course). Is that true?

Re: [Haskell-cafe] Haskell syntax/indentation for vim

2013-03-05 Thread Alfredo Di Napoli
Here is the crazy idea; instead of having a vim plugin to rule-them-all, why you don't join your efforts and create a plugin which does only indentation for Haskell code? This way, we could have a modular stack and be free to use whatever plugins work for syntax highlighting / unicode syntactic

Re: [Haskell-cafe] simple parsec question

2013-03-05 Thread S. Doaitse Swierstra
Maybe this is something you do not even want to use a parser combinator library for. The package http://hackage.haskell.org/packages/archive/list-grouping/0.1.1/doc/html/Data-List-Grouping.html contains a function breakBefore, so you can write main = do inp - readFile ... let

Re: [Haskell-cafe] Library API design: functional objects VS type classes

2013-03-05 Thread Atsuro Hoshino
Hi Rob, I usually prefer type class approach for early stage of development. Type class approach is more flexible, less works required. One might get a function with lots of constraints, and quite a lot of language extensions may appear, though it works. Once things got settled down, I

Re: [Haskell-cafe] What pattern is this (Something.T - IO a) in Sound.ALSA.Sequencer

2013-03-05 Thread Roman Cheplyaka
* Martin Drautzburg martin.drautzb...@web.de [2013-03-04 21:21:30+0100] On Sunday, 3. March 2013 21:11:21 Roman Cheplyaka wrote: Admittedly, programming with callbacks is not very pleasant. So we have an excellent alternative — the continuation monad transformer! This nested code

Re: [Haskell-cafe] Library API design: functional objects VS type classes

2013-03-05 Thread Edsko de Vries
What is the advance of using type classes? A function of the form f :: Show a = ... really has an implicit argument f :: Show__Dict a - ... that the compiler infers for us. So, the advantage of type classes is one of convenience: we don't have to pass dictionaries around, or even figure

Re: [Haskell-cafe] Simple way to do something like ArrowChoice.right on a Conduit? (version 1.0.0)

2013-03-05 Thread Michael Snoyman
Wow, I hadn't realized that someone had implemented resumable sinks... and now resumable conduits too! Very interesting. I'm not sure if I entirely understand your use case, but in general it should be possible to have multiple Conduits running one after the other. Here's an example of restarting

Re: [Haskell-cafe] Haskell + RankNTypes + (forall p. p Char - p Bool) sound?

2013-03-05 Thread Dan Doel
Just because you can't use the 'magic primitive' in question to produce an element of the empty type doesn't mean the system is sound (nor does type soundness have anything to do with proving 'false'). The question is what the primitive is supposed to do. If it's supposed to work as a witness of

Re: [Haskell-cafe] Concurrency performance problem

2013-03-05 Thread Nathan Howell
Depends on the application, of course. The (on by default) parallel GC tends to kill performance for me... you might try running both with +RTS -sstderr to see if GC time is significantly higher, and try adding +RTS -qg1 if it is. On Mon, Mar 4, 2013 at 2:23 PM, Łukasz Dąbek sznu...@gmail.com

Re: [Haskell-cafe] Concurrency performance problem

2013-03-05 Thread Łukasz Dąbek
2013/3/5 Nathan Howell nathan.d.how...@gmail.com Depends on the application, of course. The (on by default) parallel GC tends to kill performance for me... you might try running both with +RTS -sstderr to see if GC time is significantly higher, and try adding +RTS -qg1 if it is. You are

Re: [Haskell-cafe] translating recursively defined sequence

2013-03-05 Thread Albert Y. C. Lai
On 13-03-05 12:19 AM, Christopher Howard wrote: Hi. My Haskell is (sadly) getting a bit rusty. I was wondering what would be the most straightforward and easily followed procedure for translating a recursively defined sequence into a Haskell function. For example, this one from a homework

Re: [Haskell-cafe] translating recursively defined sequence

2013-03-05 Thread Don Stewart
Isn't that already valid Haskell? :) (remove the underscore). On Mar 5, 2013 5:21 AM, Christopher Howard christopher.how...@frigidcode.com wrote: Hi. My Haskell is (sadly) getting a bit rusty. I was wondering what would be the most straightforward and easily followed procedure for

Re: [Haskell-cafe] Library API design: functional objects VS type classes

2013-03-05 Thread Joey Adams
On Mon, Mar 4, 2013 at 5:50 PM, Rob Stewart robstewar...@gmail.com wrote: ... - import Control.Concurrent -- API approach 1: Using type classes class FooC a where mkFooC :: IO a readFooC :: a - IO Int incrFooC :: a - IO () I recommend taking 'mkFooC' out of the typeclass. It

[Haskell-cafe] ANNOUNCE: io-streams 1.0.0.0

2013-03-05 Thread Gregory Collins
Hi all, After more than eight months of careful design and development, The Snap Framework team is happy to announce the first version of io-streams, a simple and easy-to-use library for doing streaming I/O in Haskell. The io-streams library is based around two basic types, InputStream a and

Re: [Haskell-cafe] ANNOUNCE: io-streams 1.0.0.0

2013-03-05 Thread s9gf4ult
Is this something like conduits ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Simple way to do something like ArrowChoice.right on a Conduit? (version 1.0.0)

2013-03-05 Thread Joey Adams
On Tue, Mar 5, 2013 at 9:24 AM, Michael Snoyman mich...@snoyman.com wrote: ... I'm not sure if I entirely understand your use case, but in general it should be possible to have multiple Conduits running one after the other. Here's an example of restarting an accumulator after every multiple

Re: [Haskell-cafe] ANNOUNCE: io-streams 1.0.0.0

2013-03-05 Thread Erik de Castro Lopo
s9gf4ult wrote: Is this something like conduits ? Yes, its also a bit like Iteratee, Enumerator, Pipes and Machines. Erik -- -- Erik de Castro Lopo http://www.mega-nerd.com/ ___

Re: [Haskell-cafe] Simple way to do something like ArrowChoice.right on a Conduit? (version 1.0.0)

2013-03-05 Thread Michael Snoyman
On Wed, Mar 6, 2013 at 5:48 AM, Joey Adams joeyadams3.14...@gmail.comwrote: On Tue, Mar 5, 2013 at 9:24 AM, Michael Snoyman mich...@snoyman.comwrote: ... I'm not sure if I entirely understand your use case, but in general it should be possible to have multiple Conduits running one after the