mirror of
https://github.com/github/semantic.git
synced 2025-01-03 13:02:37 +03:00
Add text conversion for Category
This commit is contained in:
parent
df2fbfe060
commit
117a131fc3
@ -1,8 +1,10 @@
|
|||||||
|
{-# LANGUAGE MultiParamTypeClasses #-}
|
||||||
{-# OPTIONS_GHC -funbox-strict-fields #-}
|
{-# OPTIONS_GHC -funbox-strict-fields #-}
|
||||||
module Category where
|
module Category where
|
||||||
|
|
||||||
import Prologue
|
import Prologue
|
||||||
import Test.QuickCheck hiding (Args)
|
import Test.QuickCheck hiding (Args)
|
||||||
|
import Data.Text (pack)
|
||||||
import Data.Text.Arbitrary()
|
import Data.Text.Arbitrary()
|
||||||
|
|
||||||
-- | A standardized category of AST node. Used to determine the semantics for
|
-- | A standardized category of AST node. Used to determine the semantics for
|
||||||
@ -132,6 +134,9 @@ data Category
|
|||||||
|
|
||||||
instance Hashable Category
|
instance Hashable Category
|
||||||
|
|
||||||
|
instance (StringConv Category Text) where
|
||||||
|
strConv _ = pack . show
|
||||||
|
|
||||||
instance Arbitrary Category where
|
instance Arbitrary Category where
|
||||||
arbitrary = oneof [
|
arbitrary = oneof [
|
||||||
pure Program
|
pure Program
|
||||||
|
Loading…
Reference in New Issue
Block a user