1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 18:36:27 +03:00

Define a Listable instance for Declaration.

This commit is contained in:
Rob Rix 2017-05-11 15:48:27 -04:00
parent 0d13175085
commit 8ef8115775

View File

@ -20,7 +20,9 @@ import Data.Aeson
import Data.Align (crosswalk)
import Data.Functor.Both hiding (fst, snd)
import qualified Data.Functor.Both as Both
import Data.Functor.Listable
import Data.Text (toLower)
import Data.Text.Listable
import Data.Record
import Diff
import Info
@ -232,3 +234,9 @@ toCategoryName :: Category -> Text
toCategoryName category = case category of
C.SingletonMethod -> "Method"
c -> show c
instance Listable Declaration where
tiers
= cons1 (MethodDeclaration . unListableText)
\/ cons1 (FunctionDeclaration . unListableText)
\/ cons1 (ErrorDeclaration . unListableText)