@@ -8,6 +8,7 @@ import Debug.Trace
88import Text.Printf
99import System.Environment
1010import Control.Applicative
11+import Control.Arrow
1112import Control.Monad
1213import qualified Data.Text as T
1314import Data.Text (pack,unpack)
@@ -34,9 +35,10 @@ prop_cons x = (x:) `eqP` (unpack . T.cons x)
3435prop_snoc x = (++ [x]) `eqP` (unpack . (flip T.snoc) x)
3536prop_append s = (s++) `eqP` (unpack . T.append (pack s))
3637prop_appendS s = (s++) `eqP` (unpack . unstream . S.append (stream (pack s)) . stream)
37−prop_uncons s = case T.uncons (pack s) of
38− Nothing -> null s
39− Just (x,xs) -> x == head s && unpack xs == tail s
38+prop_uncons s = uncons `eqP` (fmap (second unpack) . T.uncons)
39+ where uncons (x:xs) = Just (x,xs)
40+ uncons _ = Nothing
41+ types = s :: String
4042prop_head = head `eqEP` T.head
4143prop_last = last `eqEP` T.last
4244prop_lastS = last `eqEP` (S.last . stream)