Excuse the simplicity of this question, but I didn't find another question that addressed my issue. I have installed haskell and leksah, then performed "cabal install nat" to install the natural numbers lib. The lib looks like it was installed in "/Users/jstanford/Library/Haskell/ghc-7.0.4/lib/nat-0.2/lib"
I created a workspace and a package in leksah, and updated my prefs to look in:
/Library/Frameworks/GHC.framework /Users/jstanford/Library/Haskell /Users/jstanford/.leksah-0.10/packageSources
for package sources and left the default ~/.leksah-0.10/packageSources for unpacking cabal packages.
I grabbed the first snippets of code from "Pearls of Functional Algorithm Design", so my code looks like this:
-----------------------------------------------------------------------------
--
-- Module : Main
-- Copyright :
-- License : AllRightsReserved
--
-- Maintainer :
-- Stability :
-- Portability :
--
-- |
--
-----------------------------------------------------------------------------
module Main (
main
) where
import Data.List ((\\))
import GHC.Arr (accumArray, elems, Array(..))
minfree :: [Nat] -> Nat
minfree xs = head([0 ..])\\ xs
search :: Array Int Bool -> Int
search = length takeWhile id . elems
checklist :: [Int] -> Array Int Bool
checklist xs = accumArray(V) False (0,n)
(zip (filter (<= n) xs) (repeat True))
where n = length xs
main = (
minfree[0, 2, 5]
)
Leksah was able to find the imports for \ and Array, but can't find Nat. Any pointers on how to find the import? The compiler also complains about accumArray(V). I suspect that V is not really supposed to be the capital letter V, rather some symbol that looks like a V. Guidance on that would be very much appreciated as well!