diff options
Diffstat (limited to 'testsuite/tests/ghc-regress/lib/Regex/regex003.hs')
-rw-r--r-- | testsuite/tests/ghc-regress/lib/Regex/regex003.hs | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/testsuite/tests/ghc-regress/lib/Regex/regex003.hs b/testsuite/tests/ghc-regress/lib/Regex/regex003.hs deleted file mode 100644 index 0aa51fe7aa..0000000000 --- a/testsuite/tests/ghc-regress/lib/Regex/regex003.hs +++ /dev/null @@ -1,43 +0,0 @@ -import Text.Regex.Base -import Text.Regex.Posix(Regex,(=~),(=~~)) -- or DFA or PCRE or PosixRE -import qualified Data.ByteString.Char8 as B(ByteString,pack) - --- Show mixing of ByteString and String as well as polymorphism: - -main = let x :: (RegexContext Regex String target) => target - x = ("abaca" =~ B.pack "(.)a") - x' :: (RegexContext Regex String target,Monad m) => m target - x' = ("abaca" =~~ "(.)a") - y :: (RegexContext Regex B.ByteString target) => target - y = (B.pack "abaca" =~ "(.)a") - y' :: (RegexContext Regex B.ByteString target,Monad m) => m target - y' = (B.pack "abaca" =~~ B.pack "(.)a") - in do print (x :: Bool) - print (x :: Int) - print (x :: [MatchArray]) - print (x' :: Maybe (String,String,String,[String])) - print (y :: Bool) - print (y :: Int) - print (y :: [MatchArray]) - print (y' :: Maybe (B.ByteString,B.ByteString,B.ByteString,[B.ByteString])) - -{- Output is, except for replacing Full with DFA (which has no capture) -True -2 -[array (0,1) [(0,(1,2)),(1,(1,1))],array (0,1) [(0,(3,2)),(1,(3,1))]] -Just ("a","ba","ca",["b"]) -True -2 -[array (0,1) [(0,(1,2)),(1,(1,1))],array (0,1) [(0,(3,2)),(1,(3,1))]] -Just ("a","ba","ca",["b"]) --} -{- The output for DFA is -True -2 -[array (0,0) [(0,(1,2))],array (0,0) [(0,(3,2))]] -Just ("a","ba","ca",[]) -True -2 -[array (0,0) [(0,(1,2))],array (0,0) [(0,(3,2))]] -Just ("a","ba","ca",[]) --} |