News aggregator

The Prettiest Printer

del.icio.us/haskell - Sun, 11/16/2014 - 6:07pm
Categories: Offsite Blogs

What's up with Hackage's Haddock again?

Haskell on Reddit - Sun, 11/16/2014 - 5:30pm

It hasn't been generating any documentation for any of my packages for at least three days now. What's going on? When's it gonna be fixed?

submitted by nikita-volkov
[link] [9 comments]
Categories: Incoming News

How do I build a library locally?

Haskell on Reddit - Sun, 11/16/2014 - 4:03pm

I've been working on some Haskell board games as a learning exercise, using Gloss for the interface. The main program is an implementation of HexDame (a hex-grid version of draughts), with some basic game-tree-searching AI. Here's where it's at, if you're curious:

https://github.com/mcneja/haskell-board-games

The game tree search is fairly slow. I thought I'd switch to an infinite tree data structure for the game tree, to effectively cache the results of previous frames' searches. Unfortunately this made my program explode with memory usage, which was somewhat surprising.

I read a few days ago that someone discovered a memory leak in Gloss, where it was hanging on to every frame's state. Checking the Gloss Github (https://github.com/benl23x5/gloss) I see that this was fixed in August, but I don't know if the fix is present in the current 1.8.2 version that I installed via Cabal.

I'd like to try out the current head version of Gloss to see if the memory leak I'm experiencing is fixed. I'm working on Windows, and I'm fairly new to working with Cabal. I installed the Haskell Platform 2014.2 and then ran 'cabal install gloss' and that was it.

Can anyone point me to info about how I would go about installing Gloss as a library that I build from source? I've heard about Cabal sandboxing but I'm not sure how one does it.

Thanks, James

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

How to reverse ghc encoding of command line arguments

haskell-cafe - Sun, 11/16/2014 - 3:42pm
I have a question about how to reverse the text encoding as done by ghc and the base library for stuff that comes from the command line or the environment. Assume the user's environment specifies a non-Unicode locale, e.g. some latin encoding. In this case, the String we get from e.g. System.Environment.getArgs does *not* contain the Unicode code points of the characters the user has entered. Instead the input bytes are mapped one-to- one to Char. This has probably been done for compatibility reasons, and I do not want to discuss this choice here. Rather, I want to find out how I can convert such a string back to some proper Unicode representation, for instance in order to store the value in a file with a defined encoding such as utf-8. This should be done in a generic way, i.e. without making ad-hoc assumptions about what the user's encoding might be. There is the iconv package. However, it takes ByteString as input and output and it also requires that I give it the encoding as input. How do I
Categories: Offsite Discussion

Are there ways to relax the typing system for IO?

Haskell on Reddit - Sun, 11/16/2014 - 11:55am

Sorry, I am annoying. Good news, though, this complaint isn't about Cabal, but the language itself. I've noticed (maybe it is just me?) that doing some really simple, almost trivial things become really difficult in Haskell due to the treatment of IO. Monads transformers and such are really laborious to work with for me, which is ironic, because the IO is almost aways the easiest part of the work in other languages, as well as the place where you care less about potential bugs - thus, the least place you need types anyway.

Given that, is there any way to just relax the typing system when I want to do IO? Honestly, I wouldn't mind something as simple as an embedded Scheme interpreter with a lot of IO (file systems, networking, everything goes there), and access to Haskell's pure functions. That way I'd just program stuff in Haskell and use that language as a bridge to the real world.

submitted by SrPeixinho
[link] [13 comments]
Categories: Incoming News