News aggregator - Fri, 11/14/2014 - 1:19pm
Categories: Offsite Blogs

How can I improve the pipes's performance with ahuge file?

haskell-cafe - Fri, 11/14/2014 - 11:43am
Dear cafe I have 2 file, I want zip the 2 file as couple, and then count each couple's repeat times? The file had more than 40M rows, I use pipe to write code as blow. When I test with 8768000 rows input, it take 30 secs When I test with 18768000 rows input, it take 74 secs But when I test with whole file (40M rows), it take more than 20 minutes and not finished yet. It take more than 9G memorys, and the disk is also busy all time. The result will less than 10k rows, so I had no idea why the memory is so huge. I had use the “” to profile and improve the performance with the small file But I don’t know how to deal with the “hang” situation. Anyone can give me some help, Thanks. =================================== import System.IO import System.Environment import Pipes import qualified Pipes.Prelude as P import qualified Data.Map as DM import Data.List emptyMap = DM.empty::(DM.Map (String,String) Int) keyCount num = do readHandle1 <- openFil
Categories: Offsite Discussion

Programming videogames in haskell

haskell-cafe - Fri, 11/14/2014 - 11:26am
Hello, We're building a indie game studio with some friends. I am the lead developper and i am planning to write the game logic and graphics in haskell. I would like to know if some of you have some experience in game developpement in haskell, functionnal reactive programming in particular. Furthermore, knowing which tools/DSL's/libraries i could use and where to get good documentation could really help me. Elise Huard recently wrote an ebook about game programming in haskell, did some of you read it ? Is it worth buying it ? Thanks for your feedback.
Categories: Offsite Discussion - Fri, 11/14/2014 - 9:16am
Categories: Offsite Blogs

Package versioning, hackage or cabal issue?

Haskell on Reddit - Fri, 11/14/2014 - 7:17am

In the light of the reoccurring version bounds discussion there is one more variable to consider:

The story so far:

  1. I used cabal freeze to have cabal.config in place.
  2. Things were running smoothly for a couple of months.
  3. Recently did 'cabal update'.
  4. cabal install --only-dep stopped working with 'Dependency tree exhaustively searched'.
  5. Applying a change to cabal.config solves problem:
- transformers-compat ==, + transformers-compat ==,
  1. Works again.

Now the real question:

How do I know why this suddenly stopped resolving? Did somebody change version ranges on some of dependent packages? How do i know which one got changed?

If this is really due the feature of hackage being able to retro-change dependency versions then it means that builds that used to work can suddenly become broken.

submitted by gracjan
[link] [5 comments]
Categories: Incoming News

Program slicing binary files in Haskell

Haskell on Reddit - Fri, 11/14/2014 - 7:11am


I would like to perform program slicing on binary files using Haskell language.

Do you know if a Haskell library exists in order to do so? Or maybe a library to perform program slicing on other high-level source code? Or maybe a good way to write one by myself?

Thank you!

EDIT: I'm planning to work on programs compiled to ELF format for PowerPC or ARM targets. (Knowing the syntax and semantics of such binary files it's possible to perform a safe slicing on them.)

EDIT: I found ParaSlicer, a tool for parameterized program slicing in Haskell using the LLVM analysis library. I think that I'll have to made my own to slice binaries...

submitted by liberh
[link] [10 comments]
Categories: Incoming News

More flexible literate Haskell extensions (Trac #9789), summary on wiki

glasgow-user - Fri, 11/14/2014 - 6:22am
As requested on my ticket I summarised the entire proposal on the wiki here: I don't expect a lot of disagreement on discussion, aside from minor bike shedding on the flavour of the extension. I've started implementing this already. I'm open to bikesheds on exact extension, as it shouldn't affect the implementation. Unless there's any vehement objections, I'll produce a diff on fabricator asap. Cheers, Merijn
Categories: Offsite Discussion

Robin KAY: HsQML released: Enters the Third Dimension

Planet Haskell - Fri, 11/14/2014 - 4:04am
Last night I released HsQML, the latest edition of my Haskell binding to the Qt Quick GUI library. As usual, it's available for download from Hackage.

HsQML allows you to bind declarative user interfaces written in QML against a Haskell back-end, but sometimes you can't just let QML hog all the graphical fun to itself. This latest release allows you incorporate 3D (OpenGL) graphics rendered from Haskell into your QML scenes using the new Canvas module.

The screenshot below shows off the OpenGL demo in the samples package. The colourful triangle is rendered using the regular Haskell Platform's OpenGL bindings, but HsQML sets up the environment so that it renders into a special HaskellCanvas element inside the QML scene. If you run the actual program you can see it being animated too, moving around and changing colour.

This release also adds the Objects.Weak module which allows you to hold weak references to QML objects and keep track of their life cycles using finalisers. The new FactoryPool abstraction uses these primitives to help you efficiently keep track of instances you've created, especially for when you need to fire change signals on them for data-binding.

London Haskell User Group

I've been fortunate enough to get a speaking slot at the London Haskell User Group and will be giving a talk on Building Pragmatic User Interfaces in Haskell with HsQML on the 26th of November. Please feel free to come along and watch. You can RSPV on the group's meet-up page.

The talk should be videoed and materials will be available online afterwards.

release- - 2014.11.13

* Added OpenGL canvas support.
* Added weak references and object finalisers.
* Added FactoryPool abstraction.
* Added To-only custom marshallers.
* Added Ignored type.
* Relaxed Cabal dependency constraint on 'text'.
Categories: Offsite Blogs

Pet Haskell peeve: cabal's "Last 10 lines of the build log"

Haskell on Reddit - Fri, 11/14/2014 - 12:28am

Whose idea was this and why? Why would I ever not want to see the whole build log? It's enormously annoying as I can't use the command-line output as the list of errors to work on; I have to go and actually find the build log file.

Even "first 10 lines of the build log" would have been more useful.

submitted by AshleyYakeley
[link] [15 comments]
Categories: Incoming News

Mechanize in Haskell or Revive Shpider?

haskell-cafe - Fri, 11/14/2014 - 12:14am
What would be a good way to model mechanize in Haskell? For instance the python mechanize example is quite simple: def google_search(keyword): br = mechanize.Browser()"") br.select_form(name="gbqf") br["q"] = keyword response = br.submit() print html_to_text( I was thinking I could just use a StateT monad transformer with the current pages html as a cursor. Then have something like: get "" >>= (\c -> c $// form (Name "gbqf") >=> input (Name "q") &| submit . modifyVal "query" "Haskell") That's kinda horrible but it's a place to start. Or would I be better off trying to revive Shpider?
Categories: Offsite Discussion

Under what conditions are finalizers not run?

glasgow-user - Thu, 11/13/2014 - 9:02pm
Hi, the documentation of System.Mem.Weak under <> says the following: In which situations are finalizers not run? I see that they might not be run when the program ends while the weak pointer is still alive, but are there also other situations? The above quote seems to say that even an implementation that ignores any finalizers would conform to the API specification. I think it is actually quite bad if you do not have any guarantees about when finalizers are run. In the memo table example, for instance, this would mean that the memo table could grow very large, which would not just result in bad space complexity, but also bad time complexity for lookups. I am actually particularly interested in adding finalizers to IORefs. Are there any stronger guarantees for finalizers attached to IORefs and MVars? All the best, Wolfgang
Categories: Offsite Discussion