@@ -0,0 +1,24 @@
1+-- This script compares the strict and lazy Text APIs to ensure that
2+-- they're reasonably in sync.
3+
4+{-# LANGUAGE OverloadedStrings #-}
5+
6+import qualified Data.Set as S
7+import qualified Data.Text as T
8+import System.Process
9+
10+main = do
11+ let tidy pkg = (S.fromList . filter (T.isInfixOf "::") . T.lines .
12+ T.replace "GHC.Int.Int64" "Int" .
13+ T.replace "\n " "" .
14+ T.replace (T.append (T.pack pkg) ".") "" . T.pack) `fmap`
15+ readProcess "ghci" [] (":browse " ++ pkg)
16+ let diff a b = mapM_ (putStrLn . (" "++) . T.unpack) . S.toList $
17+ S.difference a b
18+ text <- tidy "Data.Text"
19+ lazy <- tidy "Data.Text.Lazy"
20+ putStrLn "In Data.Text:"
21+ diff text lazy
22+ putStrLn ""
23+ putStrLn "In Data.Text.Lazy:"
24+ diff lazy text