
Untitled
By: a guest on
May 1st, 2012 | syntax:
None | size: 0.80 KB | hits: 13 | expires: Never
importing lib in haskell after installing with cabal
-----------------------------------------------------------------------------
--
-- 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]
)
import Data.Number.Nat