Fix warnings in QC module
Getty Ritter
7 years ago
| 1 | 1 | {-# LANGUAGE OverloadedStrings #-} |
| 2 | 2 | {-# LANGUAGE ScopedTypeVariables #-} |
| 3 | {-# OPTIONS_GHC -fno-warn-orphans #-} | |
| 3 | 4 | |
| 4 | 5 | module Main where |
| 5 | 6 | |
| 11 | 12 | import Data.Text (Text) |
| 12 | 13 | import qualified Data.Text as T |
| 13 | 14 | import Test.QuickCheck |
| 14 | import Test.QuickCheck.Arbitrary | |
| 15 | 15 | import Text.Parsec (char) |
| 16 | import Text.Parsec.Text (Parser) | |
| 17 | 16 | |
| 18 | 17 | instance Arbitrary a => Arbitrary (SExpr a) where |
| 19 | 18 | arbitrary = sized $ \n -> |
| 25 | 24 | elems <- sequence [ resize (n-k) arbitrary |
| 26 | 25 | | _ <- [0..k] |
| 27 | 26 | ] |
| 28 |
|
|
| 27 | rest <- oneof [ SAtom <$> arbitrary | |
| 29 | 28 | , pure SNil |
| 30 | 29 | ] |
| 31 |
pure (foldr SCons |
|
| 30 | pure (foldr SCons rest elems) | |
| 32 | 31 | ] |
| 33 | 32 | |
| 34 | 33 | instance Arbitrary a => Arbitrary (RichSExpr a) where |