From 640449e2f382f00cc4fd4f9b9164d14b4b7f9243 Mon Sep 17 00:00:00 2001 From: Matt Diephouse Date: Thu, 14 Jan 2016 09:17:12 -0500 Subject: [PATCH] Document declarations in Categorizable.hs --- src/Categorizable.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Categorizable.hs b/src/Categorizable.hs index 0b344ff04..2a8385821 100644 --- a/src/Categorizable.hs +++ b/src/Categorizable.hs @@ -5,12 +5,14 @@ import Term import Control.Comonad.Cofree import Data.Set +-- | The class of types that have categories. class Categorizable a where categories :: a -> Set String instance Categorizable annotation => Categorizable (Term a annotation) where categories (annotation :< _) = categories annotation +-- | Test whether the categories from the categorizables intersect. comparable :: Categorizable a => a -> a -> Bool comparable a b = catsA == catsB || (not . Data.Set.null $ intersection catsA catsB) where