News aggregator

structured-haskell-mode screencast - Sat, 01/18/2014 - 10:32pm
Categories: Offsite Blogs

Help with Binary Serialization

haskell-cafe - Sat, 01/18/2014 - 10:17pm
I was wondering if somebody could talk me through the default derived format for binary serialization used, either by binary or by cereal. I'm trying to share data between Haskell and another function language (Elm) which also supports algebraic data types, so the conversion of data should be pretty trivial. I'd like to be able to just derive encode and decode in Haskell using either binary/cereal, and then write a parser for the same format in Elm. The trick is, I don't know what that format is. Is there any documentation on it, or if not, is anybody familiar enough with it that they could explain the format to me? Thanks! _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Noam Lewis: xml-to-json is now a library

Planet Haskell - Sat, 01/18/2014 - 9:31pm

A while back I needed to convert a ton (millions) of small xml files to json, so I could store them in MongoDB. To that end I wrote a teensy-tiny tool called xml-to-json (github, Hackage). Originally it was just a command-line tool with all the code thrown in a single file.

So, I did a quick refactor this week to split it into a library + executable, and pushed it to github (to deafening cries of joy).


First, a non-feature. xml-to-json is “optimized” for many small xml files. If you have many small xml files, you can easily take advantage of multiple cores / cpu’s. You should be aware that for large files (over 10MB of xml data in a single file) something starts to eat up RAM, around 50 times the size of the file.

Other features:

  • You can filter xml subtrees to convert, by element name regex (and you can skip the matching tree root if you wish, converting only the child elements and down).
  • Output either a top-level json object or json array.
  • (Optionally) simplify representation of xml text nodes in attribute-less elements (e.g. “<elem>test</elem>” -> { elem: “test” })
Packages used

For XML decoding, I’m using hxt (over expat using hxt-expat). I tried a few of the xml packages on hackage, and hxt + expat was the only way I could parse quickly while avoiding nasty memory issues. Apparently, tagsoup can be used with Bytestrings to avoid the same issue but I didn’t try.

JSON is encoded using aeson.


Categories: Offsite Blogs

Just started working with Haskell. Need some help

General haskell list - Sat, 01/18/2014 - 7:25pm
Hi, I just started working with Haskell Running it on a RHEL linux operating system I was able to download and install it, along with libraries and packages (or, at least, what I thought were the libraries and packages) But, when I try to run a simple script, I keep getting the error : "Could not find module XXXXXX".............. I understand what this error means ---- there is a package/library missing. I tried using the "Cabal Update" command, but this did not solve the problem. So, I am now fixing this problem the primitive way, as follows : (a) I use Google to first find out what the missing module is (b) then, based on what google says, I am able to determine the name of the actual package that needs to be installed (c) I use "Cabal Install" to install the package (d) I try to run the script again (e) I get the same error, but this time, it cannot find a different module (f) I go back to Google to locate the missing module etc, etc, etc, etc Obviously, this is as slow as
Categories: Incoming News

Christopher Done: structured-haskell-mode screencast

Planet Haskell - Sat, 01/18/2014 - 6:00pm

I’ve created a series of videos explaining structured-haskell-mode; how it works and the feature-set here. While the Github repository’s README shows a series of animations showing off the features, I’ve observed that this, while pretty and impressive, isn’t particularly useful to explain to people the intended use of SHM and what to expect. People really need to see features in context with explanation. This set of videos explains all the features and keybindings.

Categories: Offsite Blogs

Standard implementation of asynchronous helpers?

haskell-cafe - Sat, 01/18/2014 - 5:18pm
I was wondering if a standard implementation of these helpers (or something similar) existed somewhere: startAsync :: IO a -> IO (MVar a) startAsync action = do var <- newEmptyMVar forkIO $ action >>= putMVar var return var wait :: MVar a -> IO a wait = readMVar I've found a few throwaway examples that implement something similar, and I can imagine some improvements already (I guess the MVar should be wrapped, for example, and some higher) but I was unable to find any released library that does something like this. Is it just too trivial for anyone to have bothered?
Categories: Offsite Discussion

Modern OpenGL in Haskell - Shaders, Textures, and Procedural Generation.

Haskell on Reddit - Sat, 01/18/2014 - 4:27pm

Github repo

A project I have been working on, it's still a work in progress. Has shaders, textures, procedural generation, some simple AABB collision detection, .obj + .mtl file loading, and other features. Any advice is welcome!

submitted by fiendfan1
[link] [4 comments]
Categories: Incoming News :: - Sat, 01/18/2014 - 1:55pm
Categories: Offsite Blogs :: - Sat, 01/18/2014 - 1:55pm
Categories: Offsite Blogs

Building ghc-7.6.3 under cygwin

haskell-cafe - Sat, 01/18/2014 - 1:11pm
Trying to build 7.6.3-x86_64-unknown-linux under cygwin. $ ./configure checking for path to top of build tree... ./configure: line 2121: utils/ghc-pwd/dist-install/build/tmp/ghc-pwd: cannot execute binary file configure: error: cannot determine current directory Not sure it is a libgmp issue, because linking doesn't help: $ ln -s /usr/lib/libgmp.dll.a /usr/lib/ Any ideas what is going on and how to fix this? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Hashtables: 'Basic' hashtables performance quirks on Win64

libraries list - Sat, 01/18/2014 - 11:38am
Having built Agda on 64-bit GHC 7.6.3 on Windows I've stumbled on Agda being unbearable slow (I tried it on Penryn and Sandy Bridge computers). The culprit turned out to be Agda uses 'BasicHashTable' in src/full/Agda/TypeChecking/Serialise.hs (line 98). Switching either to Cuckoo or Linear immediately cures the problem. The problem does not manifest itself on 32-bit Windows build or any Linux build. Also 'Basic' hashtable perform better than Cuckoo and Linear in standard benchmarks on Win64. And at the same time in Agda scenario it's performance degrades by a *couple of orders of magnitude*! Thus, *all* things are important here: 64-bit, Windows, Agda use case. I wonder what stands behind this behaviour? What are specifics of 'Basic' hashtable implementation and how to fix this or should this be fixed at all? Regards, Kyra
Categories: Offsite Discussion

Conal Elliott's home page - Sat, 01/18/2014 - 7:12am
Categories: Offsite Blogs - Sat, 01/18/2014 - 6:47am
Categories: Offsite Blogs - Sat, 01/18/2014 - 6:47am
Categories: Offsite Blogs - Sat, 01/18/2014 - 6:28am
Categories: Offsite Blogs - Sat, 01/18/2014 - 6:28am
Categories: Offsite Blogs - Sat, 01/18/2014 - 6:28am
Categories: Offsite Blogs