From 5a6d8676cf669f95d3948603c257644089a401b9 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 5 Jan 2017 14:59:55 -0500 Subject: [PATCH] Define a Listable instance over Category. --- src/Category.hs | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/src/Category.hs b/src/Category.hs index 3312973fd..414533248 100644 --- a/src/Category.hs +++ b/src/Category.hs @@ -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