Wednesday, 16 October 2013

Haskell Data.Map.Lazy

TL;DR:  
cabal install containers # import Data.Map.Lazy

I have been enjoying the Haskell from Scratch series from Jekor over on youtube.

After checking out his example code from github I have been able to compile along with the music... until ep07

./redo redo
redo.do: 1: redo.do: redo-ifchange: not found

redo.hs:5:8:
    Could not find module `Data.Map.Lazy'
    Use -v to see a list of the files searched for.
Redo script exited with non-zero exit code: 1


"Ah ha!" I thought to myself

cabal install Data.Map.Lazy

Nope. Off to Hoogle I go and after a while I worked out that what I needed was:

cabal install containers


but it was not Hoogle, but Google that clued me in.

cabal list|grep -i Map|grep -i Lazy

didn't help. Now that I know the answer it is quite easy to find:

hoogle --info Data.Map.Lazy|grep 'From package'|awk '{print $NF}'

and even create a general Haskell module installer:

#!/bin/sh
#cabalModuleInstall
cabal install $(hoogle --info $1 | grep 'From package'|awk '{print $NF}')

No comments:

Post a Comment

About this blog

Sort of a test blog... until it isn't