
27 Jun
2015
27 Jun
'15
7:59 p.m.
I'm sorry, I made a mistake in the type signature of 'prefer' -- CatEntry ought to be CatAssoc:
prefer ∷ Category c ⇒ c → CatAssoc → CatX c → CatX c
yielding:
prefer ∷ Category c ⇒ c → CatAssoc → CatX c → CatX c prefer cat (CatAssoc xs) defx = case find (\(CatEntry (icat, _)) → cat == icat) xs of Just (CatEntry (icat, x)) → x Nothing → defx
..and
prefer ∷ Category c ⇒ c → CatAssoc → LayoutName c → LayoutName c prefer cat (CatAssoc xs) deflayout = case find (\(CatEntry (icat, _)) → cat == icat) xs of Just (CatEntry (icat, lay)) → lay Nothing → deflayout
-- respectfully, Косырев Серёга