mirror of
https://github.com/github/semantic.git
synced 2025-01-02 12:23:08 +03:00
Define a Listable instance for Declaration.
This commit is contained in:
parent
0d13175085
commit
8ef8115775
@ -20,7 +20,9 @@ import Data.Aeson
|
|||||||
import Data.Align (crosswalk)
|
import Data.Align (crosswalk)
|
||||||
import Data.Functor.Both hiding (fst, snd)
|
import Data.Functor.Both hiding (fst, snd)
|
||||||
import qualified Data.Functor.Both as Both
|
import qualified Data.Functor.Both as Both
|
||||||
|
import Data.Functor.Listable
|
||||||
import Data.Text (toLower)
|
import Data.Text (toLower)
|
||||||
|
import Data.Text.Listable
|
||||||
import Data.Record
|
import Data.Record
|
||||||
import Diff
|
import Diff
|
||||||
import Info
|
import Info
|
||||||
@ -232,3 +234,9 @@ toCategoryName :: Category -> Text
|
|||||||
toCategoryName category = case category of
|
toCategoryName category = case category of
|
||||||
C.SingletonMethod -> "Method"
|
C.SingletonMethod -> "Method"
|
||||||
c -> show c
|
c -> show c
|
||||||
|
|
||||||
|
instance Listable Declaration where
|
||||||
|
tiers
|
||||||
|
= cons1 (MethodDeclaration . unListableText)
|
||||||
|
\/ cons1 (FunctionDeclaration . unListableText)
|
||||||
|
\/ cons1 (ErrorDeclaration . unListableText)
|
||||||
|
Loading…
Reference in New Issue
Block a user