1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Test whether Categorizable values are comparable.

This commit is contained in:
Rob Rix 2015-11-18 11:25:53 -08:00
parent f1eed7dac2
commit fba97d256b

View File

@ -4,3 +4,6 @@ import Data.Set
class Categorizable a where
categories :: a -> Set String
comparable :: Categorizable a => a -> a -> Bool
comparable a b = Data.Set.null $ intersection (categories a) (categories b)