Re: [Haskell-cafe] Composing a list of Enumeratees

2011-10-08 Thread oleg
Roma'n Gonza'lez wrote how can one compose a list of enumeratees, is it even possible? It is possible. Composition of enumeratees is interesting because -- there are several, distinct and useful ways of doing it, -- one of the composition methods, shell-like pipelining, requires

Re: [Haskell-cafe] Problem on using class as type.

2011-10-08 Thread Magicloud Magiclouds
Hi there, I am using the toJson = id way, which doesn't seem to cause other problem. Thank you. On Mon, Oct 3, 2011 at 11:18 PM, Steffen Schuldenzucker sschuldenzuc...@uni-bonn.de wrote: On 10/03/2011 10:42 PM, Magicloud Magiclouds wrote: Hi,   I have a function: post :: (ToJson p,

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-08 Thread Heinrich Apfelmus
David Barbour wrote: Heinrich Apfelmus wrote: Even then, events and behaviors are one abstraction level too low. In my opinion, you are better off with a library/approach geared directly towards incremental computations. I believe behaviors are precisely the 'right' abstraction if the goal is

[Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-08 Thread Captain Freako
Hi all, In this definition from the Parsec library: parse :: (Stream s Identity t) = Parsec s () a - SourceName - s - Either ParseError aparse p = runP p () what's the significance of `Identity t'? (`t' isn't used anywhere.) Thanks, -db ___

Re: [Haskell-cafe] Question: Lazy Incremental Evaluation and Haskell?

2011-10-08 Thread Jan-Willem Maessen
On Fri, Oct 7, 2011 at 2:46 PM, Brandon Moore brandon_m_mo...@yahoo.com wrote: Margnus Carlsson did something monadic several years ago. http://dl.acm.org/citation.cfm?doid=581478.581482 Perhaps there is an implementation on Hackage or on his website. This stuff also goes by the moniker

Re: [Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-08 Thread Yves Parès
If I have this right, Stream is a monad transformer. Stream s m t means that it parses 's', is stacked with monad 'm' and has a result of type 't' So Identity is a monad, the simplest monad, defined as such: newtype Indentity t = Identity { runIdentity :: t } It's the identity monad, that does

Re: [Haskell-cafe] Question on definition of `parse' function in Parsec library.

2011-10-08 Thread Yves Parès
Wow... my bad. Stream is in no way a monad transformer. I really should read before speaking... Stream s m t is such as An instance of Stream has stream type s, underlying monad m and token type t determined by the stream (

[Haskell-cafe] Parsec and Text

2011-10-08 Thread Yves Parès
Hallo Café, Is there a package that allows parsing Text with parsec, or do you have to switch to attoparsec-text or convert your Text to a ByteString? Thanks! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Parsec and Text

2011-10-08 Thread Antoine Latter
On Sat, Oct 8, 2011 at 12:37 PM, Yves Parès limestr...@gmail.com wrote: Hallo Café, Is there a package that allows parsing Text with parsec, or do you have to switch to attoparsec-text or convert your Text to a ByteString? I haven't tested it, but this declaration should work: instance

[Haskell-cafe] ANNOUNCE: Parsec 3.1.2

2011-10-08 Thread Antoine Latter
Parsec is a monadic combinator library that is well-documented, simple to use, and produces good error messages. This is a minor point release over Parsec 3.1.1. The changes in this release are: From Roman Cheplyaka: - 'lookAhead' no longer counts as 'consuming input', even when it succeeds. -

[Haskell-cafe] Call for Contributions - Haskell Communities and Activities Report, November 2011 edition

2011-10-08 Thread Janis Voigtländer
Dear all, I would like to collect contributions for the 21st edition of the Haskell Communities Activities Report http://www.haskell.org/haskellwiki/Haskell_Communities_and_Activities_Report

[Haskell-cafe] Trouble using State Monad.

2011-10-08 Thread Captain Freako
Hi all, I'm trying to use the State Monad to help implement a digital filter: 17 newtype Filter e a = F { 18 runFilter :: a - EitherT e (State FilterState) a 19 } deriving (Monad, MonadState FilterState) but I'm getting these compiler errors: Filter.hs:19:14: Can't make a derived

Re: [Haskell-cafe] Trouble using State Monad.

2011-10-08 Thread David Barbour
On Sat, Oct 8, 2011 at 4:28 PM, Captain Freako capn.fre...@gmail.comwrote: 17 newtype Filter e a = F { * 18 runFilter :: EitherT e (State FilterState) a ** * 19 } deriving (Monad, MonadState FilterState) it compiles, but I can't figure out how I'd feed the input to the filter, in

Re: [Haskell-cafe] Parsec and Text

2011-10-08 Thread Ozgur Akgun
Hi. See the following for the recent announcement: http://permalink.gmane.org/gmane.comp.lang.haskell.general/18972 On 8 October 2011 18:37, Yves Parès limestr...@gmail.com wrote: Is there a package that allows parsing Text with parsec, ... HTH, Ozgur

[Haskell-cafe] ANNOUNCE: knob, a library for memory-backed handles

2011-10-08 Thread John Millikin
http://hackage.haskell.org/package/knob This is a small package which allows you to create memory-backed handles. I found it as a pattern in a few of my test suites, so I spent a day or so polishing it up before posting it to the internet. Feel free to play around with it and tell me about any

Re: [Haskell-cafe] Trouble using State Monad.

2011-10-08 Thread Brent Yorgey
On Sat, Oct 08, 2011 at 04:28:34PM -0700, Captain Freako wrote: Hi all, I'm trying to use the State Monad to help implement a digital filter: (a - EitherT e (State FilterState) a) is definitely not monadic. There is an 'a' in a negative position (to the left of an odd number of arrows) so it