1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Define a Listable instance over Category.

This commit is contained in:
Rob Rix 2017-01-05 14:59:55 -05:00
parent c4c37914a0
commit 5a6d8676cf

View File

@ -280,6 +280,91 @@ instance Arbitrary Category where
shrink (Other s) = Other <$> shrink s
shrink _ = []
instance Listable Category where
tiers
= cons0 Program
\/ cons0 Error
\/ cons0 Boolean
\/ cons0 BooleanOperator
\/ cons0 MathOperator
\/ cons0 DictionaryLiteral
\/ cons0 Pair
\/ cons0 FunctionCall
\/ cons0 Function
\/ cons0 Identifier
\/ cons0 Params
\/ cons0 ExpressionStatements
\/ cons0 MethodCall
\/ cons0 Args
\/ cons0 StringLiteral
\/ cons0 IntegerLiteral
\/ cons0 NumberLiteral
\/ cons0 Regex
\/ cons0 Return
\/ cons0 SymbolLiteral
\/ cons0 TemplateString
\/ cons0 ArrayLiteral
\/ cons0 Assignment
\/ cons0 MathAssignment
\/ cons0 MemberAccess
\/ cons0 SubscriptAccess
\/ cons0 VarAssignment
\/ cons0 VarDecl
\/ cons0 For
\/ cons0 DoWhile
\/ cons0 While
\/ cons0 Switch
\/ cons0 Ternary
\/ cons0 Case
\/ cons0 Operator
\/ cons0 Object
\/ cons0 Throw
\/ cons0 Constructor
\/ cons0 Try
\/ cons0 Catch
\/ cons0 Finally
\/ cons0 Class
\/ cons0 Method
\/ cons0 Module
\/ cons0 Import
\/ cons0 Export
\/ cons0 Interpolation
\/ cons0 Subshell
\/ cons0 OperatorAssignment
\/ cons0 Yield
\/ cons0 Until
\/ cons0 Unless
\/ cons0 Begin
\/ cons0 Else
\/ cons0 Elsif
\/ cons0 Ensure
\/ cons0 Rescue
\/ cons0 RescueModifier
\/ cons0 RescuedException
\/ cons0 RescueArgs
\/ cons0 When
\/ cons0 Negate
\/ cons0 Select
\/ cons0 Defer
\/ cons0 Go
\/ cons0 Slice
\/ cons0 TypeAssertion
\/ cons0 TypeConversion
\/ cons0 ArgumentPair
\/ cons0 KeywordParameter
\/ cons0 OptionalParameter
\/ cons0 SplatParameter
\/ cons0 HashSplatParameter
\/ cons0 BlockParameter
\/ cons0 Break
\/ cons0 Continue
\/ cons0 Binary
\/ cons0 Unary
\/ cons0 Constant
\/ cons0 Superclass
\/ cons0 SingletonClass
\/ cons1 (Other . unListableText)
newtype ListableText = ListableText { unListableText :: Text }
instance Listable ListableText where