-- Random Processes, Ch. 3, Prob. 7 -- Given ([0,1], B([0,1])), and: -- P(F) | 0 in F XOR 1 in F = 1/2 -- | 0 in F AND 1 in F = 1 -- | otherwise = 0 -- Probability space? -- -- David Banas -- 1 July 2011 module Main (main) where import Data.RandProc import Control.Monad {- |Runs 'checkSpace' on all test cases listed in 'testList' and returns /True/ if all tests finished as expected; otherwise, returns /False/. -} main :: IO Bool main = foldr (liftM2 (&&)) (return True) (map checkSpace testList) -- |List of test cases to run testList :: [ProbSpaceTest] testList = [ ProbSpaceTest space1 (Pass) "space1" ] -- |Space #1 space1 :: ProbSpace space1 = ProbSpace [point 0, range (0,1), point 1] [ Measure [Empty] 0 , Measure [point 0] 0.5 , Measure [point 1] 0.5 , Measure [range (0,1), point 1] 1.0 , Measure [point 0, range (0,1)] 1.0 , Measure [point 0, point 1] 1.0 , Measure [range (0,1)] 0 , Measure [point 0, range (0,1), point 1] 1.0 ]