MicroHs-0.17.4.0 / tests / Dict.hs
module Dict(module Dict) whereimport Data.Constraintfac :: forall a . (Num a, Eq a) => a -> afac n = if n == 0 then 1 else n * fac(n - 1)facD :: forall a . Dict (Num a, Eq a) -> a -> afacD Dict = facfacDO :: forall a . Dict (Ord a, Num a) -> a -> afacDO Dict = facdictInt :: Dict (Num Int, Eq Int)dictInt = DictdictIntO :: Dict (Ord Int, Num Int)dictIntO = Dictmain :: IO ()main = do print $ facD dictInt 10 print $ withDict dictInt (fac (11::Int)) print $ facDO dictIntO 12