on master help sign in
Write a Target instance for String

--HG-- extra : convert_revision : 5055f85ee80e0d1a76c2b1024a21b1ae19426cb2

commitddbaab6dff06a5acd7d5c94e184d97e36bcb27f2 authorBryan O'Sullivan <bos@serpentine.com> dateSun 8 Mar 2009, 01:26 (18 years ago) parent1a7653a
1 file changed+6−1
tests/Properties.hs+6−1
tests/Properties.hs+6−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE FlexibleInstances #-}
1+{-# LANGUAGE FlexibleInstances, TypeSynonymInstances #-}
22{-# OPTIONS_GHC -fno-enable-rewrite-rules #-}
33
44import Test.QuickCheck
@@ -61,6 +61,11 @@ class Target t where
6161 packTChunkSize :: Int -> String -> t
6262 packTChunkSize _ = packT
6363
64+instance Target String where
65+ packT = id
66+ unpackT = id
67+ splitAtT = splitAt
68+
6469instance Target (S.Stream Char) where
6570 packT = S.streamList
6671 unpackT = S.unstreamList