WeakSets-0.1.0.0: test/TestHomogeneousSet.hs
module TestHomogeneousSet where
import HomogeneousSet
-- | Tests all functions related to homogeneous sets.
main :: IO ()
main = do
putStrLn "Beginning of TestHomogeneousSet"
let s1 = set [1,2,3]
let s2 = set [3,4,5]
putStrLn $ show $ s1
putStrLn $ show $ setToList s1
putStrLn $ show $ s2 `isIncludedIn` s1
putStrLn $ show $ (set [1,2]) `isIncludedIn` s1
putStrLn $ show $ cardinal s1
putStrLn $ show $ 3 `isIn` s1
putStrLn $ show $ (+1) |<$>| s1
putStrLn $ show $ s1 |&| s2
putStrLn $ show $ s1 ||| s2
putStrLn $ show $ s1 |*| s2
putStrLn $ show $ s1 |+| s2
putStrLn $ show $ s1 |-| s2
putStrLn $ show $ powerSet s1
let f = function $ zip (setToList s1) (setToList s2)
let g = function $ zip (setToList s2) (setToList s1)
putStrLn $ show $ f
putStrLn $ show $ g
putStrLn $ show $ functionToSet $ f
putStrLn $ show $ domain $ f
putStrLn $ show $ image $ f
putStrLn $ show $ f |$| 1
putStrLn $ show $ f |!| 1
putStrLn $ show $ f |.| g
putStrLn $ show $ g |.| f
putStrLn $ show $ memorizeFunction (*3) (set [1..10])
putStrLn "End of TestHomogeneousSet"