@@ -3,14 +3,15 @@ module Util.Arbs where
3import Control.Applicative
3import Control.Applicative
4import Test.QuickCheck
4import Test.QuickCheck
5import Util.CharGens
5import Util.CharGens
7import Util.String
6import Util.String
8+import Text.InterpolatedString.Perl6 (ShowQ(showQ))
10newtype ValidIdent = ValidIdent String deriving (Eq, Show)
11newtype ValidIdent = ValidIdent String deriving (Eq, Show)
12−instance Stringable ValidIdent where
13+instance ShowQ ValidIdent where
13− stringify (ValidIdent v) = v
14+ showQ (ValidIdent v) = v
15instance Arbitrary ValidIdent where
16instance Arbitrary ValidIdent where
16 arbitrary = ValidIdent <$> ((:) <$> lowerAlpha <*> (listOf alphaNumUnderPrime))
17 arbitrary = ValidIdent <$> ((:) <$> lowerAlpha <*> (listOf alphaNumUnderPrime))
@@ -18,8 +19,8 @@ instance Arbitrary ValidIdent where
19newtype StringValue = StringValue String deriving (Eq, Show)
20newtype StringValue = StringValue String deriving (Eq, Show)
21−instance Stringable StringValue where
22+instance ShowQ StringValue where
22− stringify (StringValue v) = v
23+ showQ (StringValue v) = v
24instance Arbitrary StringValue where
25instance Arbitrary StringValue where
25 arbitrary = StringValue <$> escape <$> arbitrary
26 arbitrary = StringValue <$> escape <$> arbitrary
@@ -27,8 +28,8 @@ instance Arbitrary StringValue where
28newtype InvalidIdentChar = InvalidIdentChar Char deriving (Eq, Show)
29newtype InvalidIdentChar = InvalidIdentChar Char deriving (Eq, Show)
30−instance Stringable InvalidIdentChar where
31+instance ShowQ InvalidIdentChar where
31− stringify (InvalidIdentChar c) = [c]
32+ showQ (InvalidIdentChar c) = [c]
33instance Arbitrary InvalidIdentChar where
34instance Arbitrary InvalidIdentChar where
34 arbitrary = InvalidIdentChar <$> elements "!@#$%^&*()-=+\\|/?.>,<`~"
35 arbitrary = InvalidIdentChar <$> elements "!@#$%^&*()-=+\\|/?.>,<`~"