[commit: packages/filepath] master: #4, make QFilePath have the right set Char instance (e6e5b6f)

git at git.haskell.org git at git.haskell.org
Thu Mar 19 11:33:31 UTC 2015


Repository : ssh://git@git.haskell.org/filepath

On branch  : master
Link       : http://git.haskell.org/packages/filepath.git/commitdiff/e6e5b6faec1d80f88fe4b18ccfe194399252dbd1

>---------------------------------------------------------------

commit e6e5b6faec1d80f88fe4b18ccfe194399252dbd1
Author: Neil Mitchell <ndmitchell at gmail.com>
Date:   Sun Oct 19 14:01:13 2014 +0100

    #4, make QFilePath have the right set Char instance


>---------------------------------------------------------------

e6e5b6faec1d80f88fe4b18ccfe194399252dbd1
 tests/AutoTest.hs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/AutoTest.hs b/tests/AutoTest.hs
index c186570..8902869 100644
--- a/tests/AutoTest.hs
+++ b/tests/AutoTest.hs
@@ -21,16 +21,16 @@ constTest False = error "Failed on constTest"
 
 
 
-data QFilePath = QFilePath FilePath
+newtype QFilePath = QFilePath FilePath
                  deriving Show
 
 instance Arbitrary QFilePath where
-    arbitrary = liftM QFilePath arbitrary
+    arbitrary = fmap (QFilePath . map fromQChar) arbitrary
 
+newtype QChar = QChar {fromQChar :: Char}
 
--- QuickCheck 2.4.1.1 has its own Arbitrary Char instance, so commented out for now
--- instance Arbitrary Char where
---     arbitrary = elements "?|./:\\abcd 123;_"
+instance Arbitrary QChar where
+    arbitrary = fmap QChar $ elements "?|./:\\abcd 123;_"
 
 
 



More information about the ghc-commits mailing list