Codingame & Haskell

For the crowd dozen of Haskell developers around, I’ve put on GitHub a small library to play with Codingame.

It won’t bring you another bunch of ground-breaking solutions for all the easy puzzle set, but just two services to package your multi-modules AI into a single module and use the CG web services API from your code. It’s a bit like the CodinGame Sync plugin for Chrome, just without Chrome and with a better support of Haskell.

To be honest, I’m still on my learning path of this great language and creating a Haskell library (Cabal, Haddock, etc.) is a first for me. So, things could still be a little rough around the edges and in need of some polishing, but you should be able to enjoy it.

:cat2: + :octopus: = no octocat emoji!


For the still dozen haskellers around, I’ve brought some improvements to the codingame-hs package, including a preprocessing support (using hpp). I’m still pondering the use of the GHC API to enhance the packaging (by pruning unused imported parts and preventing name clashs), but I’m afraid that it will bring more dependencies and inconveniences than real benefits. Using the preprocessor being probably enough for most use cases. So, I guess KISS is the answer for now.

I’ve also created a sister project codingame-hs-skeleton to show how the package could be used in practice during a contest. Among other things, it introduces a small trick to easily replay locally a game, conveniently allowing the use of GHCI to debug the code.

:pick: Two years later? Damn… That’s make for a stable API at least.

1 Like