module Tests.Src.Test_AdvancedListTests where -- @@ Export summerize :: [Int] -> [Int] -> Int summerize x y = sum $ x ++ y -- @@ Export single :: Int -> [Int] single x = [1..x] -- @@ Export -- | Simple function to test higher-order -- functions with lists. ply :: Int -> (Int -> [Int] -> [Int]) -> Int ply x f = summerize (f x []) (f x []) -- @@ Export myPly :: Int -> MyPly -> Int myPly x m = summerize (unPly m x []) (unPly m x []) data MyPly = MyPly { unPly :: Int -> [Int] -> [Int] , ploo :: [Int]} -- @@ Export munch :: Int -> MyPly munch i = MyPly { ploo = [i] , unPly = (:) }