News aggregator

Which streaming library do you recommend to parse a network feed, demultiplex it into channels, build some state on each of them and produce events?

Haskell on Reddit - Sun, 02/01/2015 - 4:37pm

I'm trying to build an application that parses an exchange protocol, demultiplexes it into (channels), builds a trading book from the messages, identifies patterns and finally logs them (one file per channel). I would like to use a streaming library to structure the different steps of the application but I haven't been able to find examples of anything similar. I believe the library should follow a push model (the producer drives de computation). I'm not sure if this is possible with Conduit. I saw that Pipes has push-based pipes, but I haven't found many examples either. I'm also trying to digest Enumerators and Arrows, but I feel I'm loosing focus. Could anybody advise which streaming library be a good fit for this problem so I can concentrate on learning just one? Many thanks.

submitted by jeroko
[link] [12 comments]
Categories: Incoming News

stream fusion, concatMap, exisential seed unboxing

glasgow-user - Sun, 02/01/2015 - 2:18pm
Hi everybody, I'm playing around with concatMap in stream fusion (the vector package to be exact). concatMapM :: Monad m => (a->m (Stream m b)) -> Stream m a -> Stream m b concatMapM f (Stream ...) = ... I can get my concatMap to behave nicely and erase all Stream and Step constructors but due to the existential nature of the Stream seeds, they are re-boxed for the inner stream (which is kind-of annoying given that the seed is immediately unboxed again ;-). seq doesn't help here. Otherwise, fusion happens for streams and vectors, so that is ok. But boxing kills performance, criterion says. Do we have s.th. in place that could help here? Currently I could use the vector-concatMap which creates intermediate arrays, my version which has boxed seeds, or hermit but that is too inconvenient for non-ghc savy users. Viele Gruesse, Christian Fusing concatMapM: concatMapM f (SM.Stream ostep t _) = SM.Stream step (Left t) Unknown where step (Left t) = do r <- ostep t case r of
Categories: Offsite Discussion

cpennington/h4sh

del.icio.us/haskell - Sun, 02/01/2015 - 11:17am
Categories: Offsite Blogs

cpennington/h4sh

del.icio.us/haskell - Sun, 02/01/2015 - 11:17am
Categories: Offsite Blogs

Template Haskell attempts to load mingw32.dll duringbuild

haskell-cafe - Sun, 02/01/2015 - 9:15am
Hi all, Windows GHC 7.8.4 build issue here: I've noticed that GHC will attempt to link mingw32 if a related dependency (in my case sdl2) is required in a TH pass. Unsurprisingly, the OS fails to find the imaginary mingw32.dll file. Are there any known resolutions to this quirk? Cheers, Darren _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Proposal: Add mapWithIndex to Data.List

libraries list - Sun, 02/01/2015 - 3:21am
Vectors offer `imap` and sequences offer `mapWithIndex`. I think lists deserve to have something like this too. The obvious implementation, using `zipWith`, is unlikely to be the most efficient (because foldr/build fusion doesn't handle zips so wonderfully). To a first approximation: mapWithIndex :: (Int -> a -> b) -> [a] -> [b] mapWithIndex f xs = build $ \c n -> let go x cont !i = f i x `c` cont (i+1) in foldr go (`seq` n) 0
Categories: Offsite Discussion

Cabal config file - default install flags?

haskell-cafe - Sat, 01/31/2015 - 11:02pm
I'd like to have cabal automatically use -j8 when I cabal install something. Is there something I can put into the .cabal/config file that will accomplish this? More generally, where can I find documentation on that config file? - Lucas Paul
Categories: Offsite Discussion

Side conditions on Data.Profunctor.Choice?

haskell-cafe - Sat, 01/31/2015 - 10:31am
Hi, I was expecting to see coherence conditions for instances of Data.Profunctor.Choice along the lines of: dimap (either (Left . f) Right) id . right' === dimap id (either (Left . f) Right) . right' and similarly for left', but there's nothing like that in the docs. Does anyone know whether (a) those conditions aren't true in general, or (b) they are true but provable from other theorems so not worth mentioning? Many thanks, David
Categories: Offsite Discussion

ANN: processor-creative-kit

haskell-cafe - Sat, 01/31/2015 - 3:10am
Dear Haskellers, I am pleased to announce the first release of processor-creative-kit package for playing processors. You can create your processors with your own instruction set. It simulates a simple microprocessor(cpu) with some development tools. https://hackage.haskell.org/package/processor-creative-kit https://github.com/takenobu-hs/processor-creative-kit feature: * easy try, easy modify * a purely functional CPU core (without IO) * including a very simple prototype assembler * including a very simple prototype profiler * including a very simple prototype debugger Thank you, Takenobu _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Using m4 as a preprocessor

haskell-cafe - Fri, 01/30/2015 - 10:26pm
Hello, today I tried to compile a Haskell program using m4 as preprocessor, with the {-# OPTIONS_GHC -F -pgmF m4 #-} pragma on top of a .hs file. I didn't add anything else, there are no ''' or '`' in the source. Upon compiling, ghc (7.8.3) complains: m4: cannot open `/tmp/ghc10655_0/ghc10655_1.hspp': No such file or directory I searched the net for a solution, but no dice (apparently there are no Haskell programs using -F -pgmF m4?), so I am writing here. Any ideas on what is wrong?
Categories: Offsite Discussion

Upcoming GHC version (was: Re: Drastic Prelude changes imminent)

libraries list - Wed, 01/28/2015 - 1:16am
If BBP is going to be released as-is, can we please call the next release GHC 8.0? Good stuff: http://semver.org/ Thanks, Greg On Tue, Jan 27, 2015 at 10:22 AM, David Luposchainsky <dluposchainsky< at >googlemail.com> wrote:
Categories: Offsite Discussion

Drastic Prelude changes imminent

libraries list - Tue, 01/27/2015 - 12:32pm
The next version (7.10) of GHC is slated to have a drastically changed Prelude. This message is very late in the release process, but I would urge caution before changing. The changes are (aptly) named the Burning Bridges Proposal (BBP). Even though the work has been going on for a while, it seems that this change is coming as a surprise to many people (including Simon Peyton Jones). In summary, it generalizes many list operation, e.g., foldr, to be overloaded. There is much to welcome in BBP, but changing the Prelude cannot be done lightly since it really is like changing the language. So I think it's really important for a large number of people to be able to try out such changes before they come into effect, and to have time to let the changes stabilize (you rarely get it right the first time). I've discussed this with a number of people, including Simon PJ, and we have concrete proposals. Proposal 1: * Add a new pragma {-# LANGUAGE Prelude=AlternativePrelude #-} * This is a new fe
Categories: Offsite Discussion

Problem using Text.Regex on OS X.

libraries list - Mon, 01/26/2015 - 1:29am
Hi, I'm new to Haskell so I'm not sure how to solve this issue, yet. I was directed to this list from the IRC channel. Here's the issue: Using GHCi on OS X: Prelude Data.Text> :m Text.Regex Prelude Text.Regex> let r = mkRegex "_" ... eliding successful "Loading package ..." lines ... Loading package regex-compat-0.95.1 ... can't load .so/.DLL for: /Library/Haskell/ghc-7.8.3-x86_64/lib/regex-compat-0.95.1/libHSregex-compat-0.95.1-ghc7.8.3.dylib (dlopen(/Library/Haskell/ghc-7.8.3-x86_64/lib/regex-compat-0.95.1/libHSregex-compat-0.95.1-ghc7.8.3.dylib, 9): Library not loaded: < at >rpath/libHSmtl-2.1.3.1-ghc7.8.3.dylib Referenced from: /Library/Haskell/ghc-7.8.3-x86_64/lib/regex-compat-0.95.1/libHSregex-compat-0.95.1-ghc7.8.3.dylib Reason: image not found) After running otool over the regex-compat dylib I can see lines like: ... Load command 24 cmd LC_RPATH cmdsize 80 path /Users/mark/Projects/hp/build/package/mtl-2.1.3.1/build/dist/build (offset 12) ... Which is not a path that is
Categories: Offsite Discussion

New gtk2hs 0.12.4 release

gtk2hs - Wed, 11/21/2012 - 12:56pm

Thanks to John Lato and Duncan Coutts for the latest bugfix release! The latest packages should be buildable on GHC 7.6, and the cairo package should behave a bit nicer in ghci on Windows. Thanks to all!

~d

Categories: Incoming News