packages feed

ghc-exactprint 0.4.2.0 → 0.5.0.0

raw patch · 966 files changed

+17833/−11122 lines, 966 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Language.Haskell.GHC.ExactPrint.Print: semanticPrint :: (Annotate ast, Monoid b) => (forall a. Data a => Located a -> b -> b) -> (String -> b) -> (String -> b) -> Located ast -> Anns -> b
- Language.Haskell.GHC.ExactPrint.Print: semanticPrintM :: (Annotate ast, Monoid b, Monad m) => (forall a. Data a => Located a -> b -> m b) -> (String -> m b) -> (String -> m b) -> Located ast -> Anns -> m b
+ Language.Haskell.GHC.ExactPrint.Delta: data DeltaOptions
+ Language.Haskell.GHC.ExactPrint.Delta: deltaOptions :: Rigidity -> DeltaOptions
+ Language.Haskell.GHC.ExactPrint.Delta: normalLayout :: DeltaOptions
+ Language.Haskell.GHC.ExactPrint.Delta: relativiseApiAnnsWithOptions :: Annotate ast => DeltaOptions -> [Comment] -> Located ast -> ApiAnns -> Anns
+ Language.Haskell.GHC.ExactPrint.Parsers: parseModuleApiAnnsWithCpp :: CppOptions -> FilePath -> IO (Either (SrcSpan, String) (ApiAnns, [Comment], DynFlags, ParsedSource))
+ Language.Haskell.GHC.ExactPrint.Parsers: parseModuleWithOptions :: DeltaOptions -> FilePath -> IO (Either (SrcSpan, String) (Anns, ParsedSource))
+ Language.Haskell.GHC.ExactPrint.Print: data PrintOptions m a
+ Language.Haskell.GHC.ExactPrint.Print: exactPrintWithOptions :: (Annotate ast, Monoid b, Monad m) => PrintOptions m b -> Located ast -> Anns -> m b
+ Language.Haskell.GHC.ExactPrint.Print: printOptions :: (forall ast. Data ast => Located ast -> a -> m a) -> (String -> m a) -> (String -> m a) -> Rigidity -> PrintOptions m a
+ Language.Haskell.GHC.ExactPrint.Print: stringOptions :: PrintOptions Identity String
+ Language.Haskell.GHC.ExactPrint.Types: NormalLayout :: Rigidity
+ Language.Haskell.GHC.ExactPrint.Types: RigidLayout :: Rigidity
+ Language.Haskell.GHC.ExactPrint.Types: data Rigidity
+ Language.Haskell.GHC.ExactPrint.Types: instance GHC.Classes.Eq Language.Haskell.GHC.ExactPrint.Types.Rigidity
+ Language.Haskell.GHC.ExactPrint.Types: instance GHC.Classes.Ord Language.Haskell.GHC.ExactPrint.Types.Rigidity
+ Language.Haskell.GHC.ExactPrint.Types: instance GHC.Show.Show Language.Haskell.GHC.ExactPrint.Types.Rigidity
- Language.Haskell.GHC.ExactPrint: parseModule :: FilePath -> IO (Either (SrcSpan, String) (Anns, Located (HsModule RdrName)))
+ Language.Haskell.GHC.ExactPrint: parseModule :: FilePath -> IO (Either (SrcSpan, String) (Anns, ParsedSource))
- Language.Haskell.GHC.ExactPrint.Annotate: SetLayoutFlag :: Annotated () -> next -> AnnotationF next
+ Language.Haskell.GHC.ExactPrint.Annotate: SetLayoutFlag :: Rigidity -> Annotated () -> next -> AnnotationF next
- Language.Haskell.GHC.ExactPrint.Parsers: parseModule :: FilePath -> IO (Either (SrcSpan, String) (Anns, Located (HsModule RdrName)))
+ Language.Haskell.GHC.ExactPrint.Parsers: parseModule :: FilePath -> IO (Either (SrcSpan, String) (Anns, ParsedSource))
- Language.Haskell.GHC.ExactPrint.Parsers: parseModuleWithCpp :: CppOptions -> FilePath -> IO (Either (SrcSpan, String) (Anns, Located (HsModule RdrName)))
+ Language.Haskell.GHC.ExactPrint.Parsers: parseModuleWithCpp :: CppOptions -> DeltaOptions -> FilePath -> IO (Either (SrcSpan, String) (Anns, ParsedSource))
- Language.Haskell.GHC.ExactPrint.Preprocess: getPreprocessedSrcDirect :: (GhcMonad m) => CppOptions -> FilePath -> m String
+ Language.Haskell.GHC.ExactPrint.Preprocess: getPreprocessedSrcDirect :: (GhcMonad m) => CppOptions -> FilePath -> m (String, DynFlags)

This diff is very large; some files are shown as “too large to diff”. Download the raw patch for the complete diff.

Files

ChangeLog view
@@ -1,3 +1,14 @@+2015-11-21 v0.5+	* Add new options to enable "rigid" layout rules. This makes the+	annotations more rigid in the sense that if you move AST fragments around+	it is more likely that their internal components will remain in the same+	position relative to each other.++	* Fix a bug where files failed to parse if the file started with comments.++	* Fix a bug where "[e||" was turned into "[||"++ 2015-11-15 v0.4.2 	* Fix round tripping of arrow notation using ">-" and ">>-". 2015-09-28 v0.4.1
ghc-exactprint.cabal view
@@ -1,5 +1,5 @@ name:                ghc-exactprint-version:             0.4.2.0+version:             0.5.0.0 synopsis:            ExactPrint for GHC description:         Using the API Annotations available from GHC 7.10.2, this                      library provides a means to round trip any code that can@@ -27,10 +27,13 @@ category:            Development build-type:          Simple extra-source-files:  ChangeLog-                     tests/examples/*.hs-                     tests/examples/*.hs.bad-                     tests/examples/*.hs.expected-                     tests/examples/*.hs-boot+                     tests/examples/failing/*.hs+                     tests/examples/ghc710/*.hs+                     tests/examples/ghc8/*.hs+                     tests/examples/transform/*.hs+                     tests/examples/failing/*.hs.bad+                     tests/examples/transform/*.hs.expected+                     tests/examples/ghc710/*.hs-boot cabal-version:       >=1.10  source-repository head
src/Language/Haskell/GHC/ExactPrint/Annotate.hs view
@@ -111,7 +111,7 @@   CountAnns      :: GHC.AnnKeywordId                        -> (Int     -> next) -> AnnotationF next   WithSortKey    :: [(GHC.SrcSpan, Annotated ())]                       -> next -> AnnotationF next -  SetLayoutFlag  ::  Annotated ()                         -> next -> AnnotationF next+  SetLayoutFlag  ::  Rigidity -> Annotated ()                         -> next -> AnnotationF next    -- Required to work around deficiencies in the GHC AST   StoreOriginalSrcSpan :: AnnKey                        -> (AnnKey -> next) -> AnnotationF next@@ -138,11 +138,16 @@ makeFreeCon  'GetSrcSpanForKw makeFreeCon  'StoreString makeFreeCon  'AnnotationsToComments-makeFreeCon  'SetLayoutFlag makeFreeCon  'WithSortKey  -- --------------------------------------------------------------------- +setLayoutFlag :: Annotated () -> Annotated ()+setLayoutFlag action = liftF (SetLayoutFlag NormalLayout action ())++setRigidFlag :: Annotated () -> Annotated ()+setRigidFlag action = liftF (SetLayoutFlag RigidLayout action ())+ -- | Construct a syntax tree which represent which KeywordIds must appear -- where. annotate :: (Annotate ast) => GHC.Located ast -> Annotated ()@@ -431,8 +436,9 @@          "()" -> do            mark GHC.AnnOpenP  -- '('            mark GHC.AnnCloseP -- ')'-         "(##)" -> do+         ('(':'#':_) -> do            markWithString GHC.AnnOpen  "(#" -- '(#'+           markMany GHC.AnnCommaTuple            markWithString GHC.AnnClose  "#)"-- '#)'          "[::]" -> do            markWithString GHC.AnnOpen  "[:" -- '[:'@@ -1672,7 +1678,7 @@                       else markWithString GHC.AnnClose "#)"  -  markAST l (GHC.HsCase e1 matches) = do+  markAST l (GHC.HsCase e1 matches) = setRigidFlag $ do     mark GHC.AnnCase     markLocated e1     mark GHC.AnnOf@@ -1685,7 +1691,7 @@   -- when moving these expressions it's useful that they maintain "internal   -- integrity", that is to say the subparts remain indented relative to each   -- other.-  markAST _ (GHC.HsIf _ e1 e2 e3) = setLayoutFlag $ do+  markAST _ (GHC.HsIf _ e1 e2 e3) = setRigidFlag $ do     mark GHC.AnnIf     markLocated e1     markOffset GHC.AnnSemi 0@@ -1860,7 +1866,13 @@     markLocated e     markWithString GHC.AnnClose "|]"   markAST _ (GHC.HsBracket (GHC.TExpBr e)) = do-    markWithString GHC.AnnOpen "[||"+    -- markWithString GHC.AnnOpen "[||"+    -- This exists like this as the lexer collapses [e|| and [|| into the+    -- same construtor+    workOutString GHC.AnnOpen+      (\ss -> if spanLength ss == 3+                then "[||"+                else "[e||")     markLocated e     markWithString GHC.AnnClose "||]"   markAST _ (GHC.HsBracket (GHC.TypBr e)) = do
src/Language/Haskell/GHC/ExactPrint/Delta.hs view
@@ -51,6 +51,12 @@ module Language.Haskell.GHC.ExactPrint.Delta   ( relativiseApiAnns   , relativiseApiAnnsWithComments+  , relativiseApiAnnsWithOptions++  -- * Configuration+  , DeltaOptions(drRigidity)+  , deltaOptions+  , normalLayout   ) where  import Control.Monad.RWS@@ -94,18 +100,30 @@                   -> GHC.Located ast                   -> GHC.ApiAnns                   -> Anns-relativiseApiAnnsWithComments cs modu ghcAnns-   = runDeltaWithComments cs (annotate modu) ghcAnns (ss2pos $ GHC.getLoc modu)+relativiseApiAnnsWithComments =+    relativiseApiAnnsWithOptions normalLayout +relativiseApiAnnsWithOptions ::+                     Annotate ast+                  => DeltaOptions+                  -> [Comment]+                  -> GHC.Located ast+                  -> GHC.ApiAnns+                  -> Anns+relativiseApiAnnsWithOptions opts cs modu ghcAnns+   = runDeltaWithComments+      opts cs (annotate modu) ghcAnns+      (ss2pos $ GHC.getLoc modu)+ -- --------------------------------------------------------------------- -- -- | Type used in the Delta Monad.-type Delta a = RWS DeltaReader DeltaWriter DeltaState a+type Delta a = RWS DeltaOptions DeltaWriter DeltaState a -runDeltaWithComments :: [Comment] -> Annotated () -> GHC.ApiAnns -> Pos -> Anns-runDeltaWithComments cs action ga priorEnd =+runDeltaWithComments :: DeltaOptions -> [Comment] -> Annotated () -> GHC.ApiAnns -> Pos -> Anns+runDeltaWithComments opts cs action ga priorEnd =   mkAnns . snd-  . (\next -> execRWS next initialDeltaReader (defaultDeltaState cs priorEnd ga))+  . (\next -> execRWS next opts (defaultDeltaState cs priorEnd ga))   . deltaInterpret $ action   where     mkAnns :: DeltaWriter -> Anns@@ -115,7 +133,7 @@  -- --------------------------------------------------------------------- -data DeltaReader = DeltaReader+data DeltaOptions = DeltaOptions        {          -- | Current `SrcSpan, part of current AnnKey`          curSrcSpan  :: !GHC.SrcSpan@@ -123,6 +141,9 @@          -- | Constuctor of current AST element, part of current AnnKey        , annConName       :: !AnnConName +        -- | Whether to use rigid or normal layout rules+       , drRigidity :: Rigidity+        }  data DeltaWriter = DeltaWriter@@ -153,13 +174,17 @@  -- --------------------------------------------------------------------- -initialDeltaReader :: DeltaReader-initialDeltaReader =-  DeltaReader+deltaOptions :: Rigidity -> DeltaOptions+deltaOptions ridigity =+  DeltaOptions     { curSrcSpan = GHC.noSrcSpan     , annConName = annGetConstr ()+    , drRigidity = ridigity     } +normalLayout :: DeltaOptions+normalLayout = deltaOptions NormalLayout+ defaultDeltaState :: [Comment] -> Pos -> GHC.ApiAnns -> DeltaState defaultDeltaState injectedComments priorEnd ga =     DeltaState@@ -214,7 +239,10 @@     go (MarkOffsetPrim akwid n _ next)  = addDeltaAnnotationLs akwid n >> next     go (WithAST lss prog next)          = withAST lss (deltaInterpret prog) >> next     go (CountAnns kwid next)             = countAnnsDelta kwid >>= next-    go (SetLayoutFlag action next)       = setLayoutFlag (deltaInterpret action)  >> next+    go (SetLayoutFlag r action next)     = do+      rigidity <- asks drRigidity+      (if (r <= rigidity) then setLayoutFlag else id) (deltaInterpret action)+      next     go (MarkExternal ss akwid _ next)    = addDeltaAnnotationExt ss akwid >> next     go (StoreOriginalSrcSpan key next)   = storeOriginalSrcSpanDelta key >>= next     go (GetSrcSpanForKw kw next)         = getSrcSpanForKw kw >>= next@@ -374,8 +402,8 @@     l <- ask     tellFinalAnn (getAnnKey l,ann) -getAnnKey :: DeltaReader -> AnnKey-getAnnKey DeltaReader {curSrcSpan, annConName}+getAnnKey :: DeltaOptions -> AnnKey+getAnnKey DeltaOptions {curSrcSpan, annConName}   = AnnKey curSrcSpan annConName  -- -------------------------------------
src/Language/Haskell/GHC/ExactPrint/Parsers.hs view
@@ -17,6 +17,7 @@          -- * Module Parsers         , parseModule+        , parseModuleWithOptions         , parseModuleWithCpp          -- * Basic Parsers@@ -28,6 +29,10 @@         , parseStmt          , parseWith++        -- * Internal++        , parseModuleApiAnnsWithCpp         ) where  import Language.Haskell.GHC.ExactPrint.Annotate@@ -143,44 +148,69 @@ -- @ -- -- Note: 'GHC.ParsedSource' is a synonym for 'GHC.Located' ('GHC.HsModule' 'GHC.RdrName')-parseModule :: FilePath -> IO (Either (GHC.SrcSpan, String) (Anns, (GHC.Located (GHC.HsModule GHC.RdrName))))-parseModule = parseModuleWithCpp defaultCppOptions+parseModule :: FilePath+            -> IO (Either (GHC.SrcSpan, String)+                          (Anns, GHC.ParsedSource))+parseModule = parseModuleWithCpp defaultCppOptions normalLayout +parseModuleWithOptions :: DeltaOptions+                       -> FilePath+                       -> IO (Either (GHC.SrcSpan, String)+                                     (Anns, GHC.ParsedSource))+parseModuleWithOptions opts fp =+  parseModuleWithCpp defaultCppOptions opts fp++ -- | Parse a module with specific instructions for the C pre-processor. parseModuleWithCpp :: CppOptions+                   -> DeltaOptions                    -> FilePath-                   -> IO (Either (GHC.SrcSpan, String) (Anns, GHC.Located (GHC.HsModule GHC.RdrName)))-parseModuleWithCpp cppOptions file =+                   -> IO (Either (GHC.SrcSpan, String) (Anns, GHC.ParsedSource))+parseModuleWithCpp cpp opts fp = do+  res <- parseModuleApiAnnsWithCpp cpp fp+  return (either Left mkAnns res)+  where+    mkAnns (apianns, cs, _, m) =+      Right (relativiseApiAnnsWithOptions opts cs m apianns, m)++-- | Low level function which is used in the internal tests.+-- It is advised to use 'parseModule' or 'parseModuleWithCpp' instead of+-- this function.+parseModuleApiAnnsWithCpp :: CppOptions+                          -> FilePath+                          -> IO (Either (GHC.SrcSpan, String)+                                        (GHC.ApiAnns, [Comment], GHC.DynFlags, GHC.ParsedSource))+parseModuleApiAnnsWithCpp cppOptions file =   GHC.defaultErrorHandler GHC.defaultFatalMessager GHC.defaultFlushOut $     GHC.runGhc (Just libdir) $ do       dflags <- initDynFlags file       let useCpp = GHC.xopt GHC.Opt_Cpp dflags-      (fileContents, injectedComments) <-+      (fileContents, injectedComments, dflags') <-         if useCpp           then do-            contents <- getPreprocessedSrcDirect cppOptions file+            (contents,dflags1) <- getPreprocessedSrcDirect cppOptions file             cppComments <- getCppTokensAsComments cppOptions file-            return (contents,cppComments)+            return (contents,cppComments,dflags1)           else do             txt <- GHC.liftIO $ readFile file             let (contents1,lp) = stripLinePragmas txt-            return (contents1,lp)+            return (contents1,lp,dflags)       return $-        case parseFile dflags file fileContents of+        case parseFile dflags' file fileContents of           GHC.PFailed ss m -> Left $ (ss, (GHC.showSDoc dflags m))           GHC.POk (mkApiAnns -> apianns) pmod  ->-            let as = relativiseApiAnnsWithComments injectedComments pmod apianns in-            Right $ (as, pmod)+            Right $ (apianns, injectedComments, dflags', pmod)  -- ---------------------------------------------------------------------  initDynFlags :: GHC.GhcMonad m => FilePath -> m GHC.DynFlags initDynFlags file = do   dflags0 <- GHC.getSessionDynFlags-  let dflags1 = GHC.gopt_set dflags0 GHC.Opt_KeepRawTokenStream-  src_opts <- GHC.liftIO $ GHC.getOptionsFromFile dflags1 file-  (dflags2, _, _)-    <- GHC.parseDynamicFilePragma dflags1 src_opts+  src_opts <- GHC.liftIO $ GHC.getOptionsFromFile dflags0 file+  (dflags1, _, _)+    <- GHC.parseDynamicFilePragma dflags0 src_opts+  -- Turn this on last to avoid T10942+  let dflags2 = dflags1 `GHC.gopt_set` GHC.Opt_KeepRawTokenStream   void $ GHC.setSessionDynFlags dflags2   return dflags2 
src/Language/Haskell/GHC/ExactPrint/Preprocess.hs view
@@ -21,6 +21,7 @@ import qualified Lexer          as GHC import qualified MonadUtils     as GHC import qualified SrcLoc         as GHC+import qualified DriverPhases   as GHC import qualified StringBuffer   as GHC  import SrcLoc (mkSrcSpan, mkSrcLoc)@@ -87,7 +88,7 @@ -- See bug <http://ghc.haskell.org/trac/ghc/ticket/8265> getCppTokensAsComments :: GHC.GhcMonad m                        => CppOptions  -- ^ Preprocessor Options-                       -> FilePath  -- ^ Path to source file+                       -> FilePath    -- ^ Path to source file                        -> m [Comment] getCppTokensAsComments cppOptions sourceFile = do   source <- GHC.liftIO $ GHC.hGetStringBuffer sourceFile@@ -173,9 +174,12 @@ sbufToString sb@(GHC.StringBuffer _buf len _cur) = GHC.lexemeToString sb len  -- ----------------------------------------------------------------------getPreprocessedSrcDirect :: (GHC.GhcMonad m) => CppOptions -> FilePath -> m String+getPreprocessedSrcDirect :: (GHC.GhcMonad m)+                         => CppOptions+                         -> FilePath+                         -> m (String, GHC.DynFlags) getPreprocessedSrcDirect cppOptions src =-    (\(a,_,_) -> a) <$> getPreprocessedSrcDirectPrim cppOptions src+    (\(s,_,d) -> (s,d)) <$> getPreprocessedSrcDirectPrim cppOptions src  getPreprocessedSrcDirectPrim :: (GHC.GhcMonad m)                               => CppOptions@@ -185,7 +189,8 @@   hsc_env <- GHC.getSession   let dfs = GHC.extractDynFlags hsc_env       new_env = GHC.replaceDynFlags hsc_env (injectCppOptions cppOptions dfs)-  (dflags', hspp_fn) <- GHC.liftIO $ GHC.preprocess new_env (src_fn, Nothing)+  (dflags', hspp_fn) <-+      GHC.liftIO $ GHC.preprocess new_env (src_fn, Just (GHC.Cpp GHC.HsSrcFile))   buf <- GHC.liftIO $ GHC.hGetStringBuffer hspp_fn   txt <- GHC.liftIO $ readFile hspp_fn   return (txt, buf, dflags')
src/Language/Haskell/GHC/ExactPrint/Print.hs view
@@ -15,9 +15,13 @@ module Language.Haskell.GHC.ExactPrint.Print         (         exactPrint-        , semanticPrint-        , semanticPrintM+        , exactPrintWithOptions +        -- * Configuration+        , PrintOptions(epRigidity, epAstPrint, epTokenPrint, epWhitespacePrint)+        , stringOptions+        , printOptions+         ) where  import Language.Haskell.GHC.ExactPrint.Types@@ -47,43 +51,50 @@                      => GHC.Located ast                      -> Anns                      -> String-exactPrint = semanticPrint (\_ b -> b) id id---- | A more general version of `semanticPrint`.-semanticPrintM :: (Annotate ast, Monoid b, Monad m) =>-              (forall a . Data a => GHC.Located a -> b -> m b) -- ^ How to surround an AST fragment-              -> (String -> m b) -- ^ How to output a token-              -> (String -> m b) -- ^ How to output whitespace-              -> GHC.Located ast-              -> Anns-              -> m b-semanticPrintM astOut tokenOut whiteOut ast as =  runEP astOut tokenOut whiteOut (annotate ast) as----- | A more general version of 'exactPrint' which allows the customisation--- of the output whilst retaining the original source formatting. This is--- useful for smarter syntax highlighting.-semanticPrint :: (Annotate ast, Monoid b) =>-              (forall a . Data a => GHC.Located a -> b -> b) -- ^ How to surround an AST fragment-              -> (String -> b) -- ^ How to output a token-              -> (String -> b) -- ^ How to output whitespace-              -> GHC.Located ast-              -> Anns-              -> b-semanticPrint a b c d e = runIdentity (semanticPrintM (\ast s -> Identity (a ast s)) (return . b) (return . c) d e)+exactPrint ast as = runIdentity (exactPrintWithOptions stringOptions ast as) +-- | The additional option to specify the rigidity and printing+-- configuration.+exactPrintWithOptions :: (Annotate ast, Monoid b, Monad m)+                      => PrintOptions m b+                      -> GHC.Located ast+                      -> Anns+                      -> m b+exactPrintWithOptions r ast as =+    runEP r (annotate ast) as  ------------------------------------------------------ -- The EP monad and basic combinators -data EPReader m a = EPReader+data PrintOptions m a = PrintOptions             {               epAnn :: !Annotation             , epAstPrint :: forall ast . Data ast => GHC.Located ast -> a -> m a             , epTokenPrint :: String -> m a             , epWhitespacePrint :: String -> m a+            , epRigidity :: Rigidity             } +-- | Helper to create a 'PrintOptions'+printOptions ::+      (forall ast . Data ast => GHC.Located ast -> a -> m a)+      -> (String -> m a)+      -> (String -> m a)+      -> Rigidity+      -> PrintOptions m a+printOptions astPrint tokenPrint wsPrint rigidity = PrintOptions+             {+               epAnn = annNone+             , epAstPrint = astPrint+             , epWhitespacePrint = wsPrint+             , epTokenPrint = tokenPrint+             , epRigidity = rigidity+             }++-- | Options which can be used to print as a normal String.+stringOptions :: PrintOptions Identity String+stringOptions = printOptions (\_ b -> return b) return return NormalLayout+ data EPWriter a = EPWriter               { output :: !a } @@ -101,18 +112,17 @@  --------------------------------------------------------- -type EP w m a = RWST (EPReader m w) (EPWriter w) EPState m a+type EP w m a = RWST (PrintOptions m w) (EPWriter w) EPState m a   -runEP :: (Monad m, Monoid a) =>-      (forall ast . Data ast => GHC.Located ast -> a -> m a)-      -> (String -> m a)-      -> (String -> m a)+runEP :: (Monad m, Monoid a)+      => PrintOptions m a       -> Annotated () -> Anns -> m a-runEP astPrint wsPrint tokenPrint action ans =+runEP epReader action ans =   fmap (output . snd) .-    (\next -> execRWST next (initialEPReader astPrint tokenPrint wsPrint) (defaultEPState ans))+    (\next -> execRWST next epReader+    (defaultEPState ans))   . printInterpret $ action  -- ---------------------------------------------------------------------@@ -126,18 +136,6 @@              , epMarkLayout = False              } -initialEPReader ::-      (forall ast . Data ast => GHC.Located ast -> a -> m a)-      -> (String -> m a)-      -> (String -> m a)-      -> EPReader m a-initialEPReader astPrint tokenPrint wsPrint  = EPReader-             {-               epAnn = annNone-             , epAstPrint = astPrint-             , epWhitespacePrint = wsPrint-             , epTokenPrint = tokenPrint-             }  -- --------------------------------------------------------------------- @@ -167,8 +165,10 @@       exactPC lss (printInterpret action) >> next     go (CountAnns kwid next) =       countAnnsEP (G kwid) >>= next-    go (SetLayoutFlag  action next) =-      setLayout (printInterpret action) >> next+    go (SetLayoutFlag r action next) = do+      rigidity <- asks epRigidity+      (if (r <= rigidity) then setLayout else id) (printInterpret action)+      next     go (MarkExternal _ akwid s next) =       printStringAtMaybeAnn (G akwid) s >> next     go (StoreOriginalSrcSpan _ next) = storeOriginalSrcSpanPrint >>= next@@ -229,7 +229,7 @@                 , annFollowingComments=fcomments                 , annsDP=kds                 } = fromMaybe annNone ma-      EPReader{epAstPrint} <- ask+      PrintOptions{epAstPrint} <- ask       r <- withContext kds an        (mapM_ (uncurry printQueuedComment) comments        >> advance edp@@ -415,7 +415,7 @@ printString :: (Monad m, Monoid w) => Bool -> String -> EP w m () printString layout str = do   EPState{epPos = (l,c), epMarkLayout} <- get-  EPReader{epTokenPrint, epWhitespacePrint} <- ask+  PrintOptions{epTokenPrint, epWhitespacePrint} <- ask   when (epMarkLayout && layout) (                       modify (\s -> s { epLHS = LayoutStartCol c, epMarkLayout = False } ))   setPos (l, c + length str)
src/Language/Haskell/GHC/ExactPrint/Types.hs view
@@ -22,10 +22,16 @@   , mkAnnKey   , AnnConName(..)   , annGetConstr++  -- * Other++  , Rigidity(..)+   -- * Internal Types   , LayoutStartCol(..)   , declFun +   ) where  import Data.Data (Data, Typeable, toConstr,cast)@@ -193,6 +199,9 @@   ppr a     = GHC.text (show a)  -- ---------------------------------------------------------------------+--+-- Flag used to control whether we use rigid or normal layout rules.+data Rigidity = NormalLayout | RigidLayout deriving (Eq, Ord, Show)  declFun :: (forall a . Data a => GHC.Located a -> b) -> GHC.LHsDecl GHC.RdrName -> b declFun f (GHC.L l de) =
tests/Test.hs view
@@ -1,12 +1,13 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TupleSections #-}+{-# LANGUAGE CPP #-} -- | Use "runhaskell Setup.hs test" or "cabal test" to run these tests. module Main where  import Language.Haskell.GHC.ExactPrint.Utils (showGhc) -import qualified FastString     as GHC-import qualified GHC            as GHC+-- import qualified FastString     as GHC+-- import qualified GHC            as GHC  -- import qualified Data.Generics as SYB -- import qualified GHC.SYB.Utils as SYB@@ -29,10 +30,28 @@  -- import Debug.Trace +data GHCVersion = GHC710 | GHC8 deriving (Eq, Ord, Show)++ghcVersion :: GHCVersion+ghcVersion =+#if __GLASGOW_HASKELL__ >= 711+  GHC8+#else+  GHC710+#endif++-- | Directories to automatically find roundtrip tests+testDirs :: [FilePath]+testDirs =+  "ghc710" : ["ghc8" | ghcVersion >= GHC8]++ -- ---------------------------------------------------------------------  main :: IO () main = hSilence [stderr] $ do+  print ghcVersion+  tests <- mkTests   cnts <- fst <$> runTestText (putTextToHandle stdout True) tests   putStrLn $ show cnts   if errors cnts > 0 || failures cnts > 0@@ -41,7 +60,7 @@  transform :: IO () transform = hSilence [stderr] $ do-  cnts <- fst <$> runTestText (putTextToHandle stdout True) (TestList transformTests)+  cnts <- fst <$> runTestText (putTextToHandle stdout True) transformTests   putStrLn $ show cnts   if errors cnts > 0 || failures cnts > 0      then exitFailure@@ -49,245 +68,52 @@  -- --------------------------------------------------------------------- -tests :: Test-tests = TestList $-  [-    mkTestMod "AddAndOr3.hs"             "AddAndOr3"-  , mkTestMod "AltsSemis.hs"             "Main"-  , mkTestMod "Ann01.hs"                 "Ann01"-  , mkTestMod "Annotations.hs"           "Annotations"-  , mkTestMod "Arrow.hs"                 "Arrow"-  , mkParserTest "Arrows.hs"-  , mkParserTest "Arrow2.hs"-  , mkTestMod "Associated.hs"            "Main"-  , mkTestMod "B.hs"                     "Main"-  , mkTestMod "C.hs"                     "C"-  , mkTestMod "BCase.hs"                 "Main"-  , mkTestMod "BangPatterns.hs"          "Main"-  , mkTestMod "Cg008.hs"                 "Cg008"-  , mkTestMod "DataDecl.hs"              "Main"-  , mkTestMod "DataFamilies.hs"          "DataFamilies"-  , mkTestMod "Dead1.hs"                 "Dead1"-  , mkTestMod "Default.hs"               "Main"-  , mkTestMod "Deriving.hs"              "Main"-  , mkParserTest "DerivingOC.hs"-  , mkTestMod "DocDecls.hs"              "DocDecls"-  , mkTestMod "DocDecls.hs"              "DocDecls"-  , mkTestMod "EmptyMostly.hs"           "EmptyMostly"-  , mkTestMod "EmptyMostlyInst.hs"       "EmptyMostlyInst"-  , mkTestMod "EmptyMostlyNoSemis.hs"    "EmptyMostlyNoSemis"-  , mkTestMod "Existential.hs"           "Main"-  , mkTestMod "ExprPragmas.hs"           "ExprPragmas"-  , mkTestMod "ExtraConstraints1.hs"     "ExtraConstraints1"-  , mkTestMod "ForAll.hs"                "ForAll"-  , mkTestMod "ForeignDecl.hs"           "ForeignDecl"-  , mkTestMod "FromUtils.hs"             "Main"-  , mkTestMod "FunDeps.hs"               "Main"-  , mkTestMod "FunctionalDeps.hs"        "Main"-  , mkTestMod "GenericDeriving.hs"       "Main"-  , mkTestMod "Guards.hs"                "Main"-  , mkTestMod "HsDo.hs"                  "HsDo"-  , mkTestMod "IfThenElse1.hs"           "Main"-  , mkTestMod "IfThenElse2.hs"           "Main"-  , mkTestMod "IfThenElse3.hs"           "Main"-  , mkTestMod "ImplicitParams.hs"        "Main"-  , mkTestMod "ImportsSemi.hs"           "ImportsSemi"-  , mkTestMod "Infix.hs"                 "Main"-  , mkTestMod "LayoutIn1.hs"             "LayoutIn1"-  , mkTestMod "LayoutIn3.hs"             "LayoutIn3"-  , mkTestMod "LayoutIn3a.hs"            "LayoutIn3a"-  , mkTestMod "LayoutIn3b.hs"            "LayoutIn3b"-  , mkTestMod "LayoutIn4.hs"             "LayoutIn4"-  , mkTestMod "LayoutLet.hs"             "Main"-  , mkTestMod "LayoutLet2.hs"            "LayoutLet2"-  , mkTestMod "LayoutLet3.hs"            "LayoutLet3"-  , mkTestMod "LayoutLet4.hs"            "LayoutLet4"-  , mkTestMod "LayoutWhere.hs"           "Main"-  , mkTestMod "LetExpr.hs"               "LetExpr"-  , mkTestMod "LetExprSemi.hs"           "LetExprSemi"-  , mkTestMod "LetIn1.hs"                "LetIn1"-  , mkTestMod "LetStmt.hs"               "Layout.LetStmt"-  , mkTestMod "ListComprehensions.hs"    "Main"-  , mkTestMod "LocToName.hs"             "LocToName"-  , mkTestMod "Mixed.hs"                 "Main"-  , mkTestMod "MonadComprehensions.hs"   "Main"-  , mkTestMod "Move1.hs"                 "Move1"-  , mkTestMod "MultiParamTypeClasses.hs" "Main"-  , mkTestMod "NullaryTypeClasses.hs"    "Main"-  , mkTestMod "OverloadedStrings.hs"     "Main"-  , mkTestMod "PArr.hs"                  "PArr"-  , mkTestMod "PatSynBind.hs"            "Main"-  , mkTestMod "ParensAroundContext.hs"   "ParensAroundContext"-  , mkTestMod "RankNTypes.hs"            "Main"-  , mkTestMod "RdrNames.hs"              "RdrNames"-  , mkTestMod "RebindableSyntax.hs"      "Main"-  , mkTestMod "RecordUpdate.hs"          "Main"-  , mkParserTest "RecursiveDo.hs"-  , mkTestMod "Roles.hs"                 "Roles"-  , mkTestMod "Rules.hs"                 "Rules"-  , mkTestMod "ScopedTypeVariables.hs"   "Main"-  , mkTestMod "Sigs.hs"                  "Sigs"-  , mkTestMod "Simple.hs"                "Main"-  , mkTestMod "Splice.hs"                "Splice"-  , mkTestMod "StaticPointers.hs"        "Main"-  , mkTestMod "Stmts.hs"                 "Stmts"-  , mkTestMod "Stream.hs"                "Stream"-  , mkTestMod "StrictLet.hs"             "Main"-  , mkTestMod "T2388.hs"                 "T2388"-  , mkTestMod "T3132.hs"                 "T3132"-  , mkTestMod "TH.hs"                    "Main"-  , mkTestMod "Trit.hs"                  "Trit"-  , mkTestMod "TransformListComp.hs"     "Main"-  , mkTestMod "Tuple.hs"                 "Main"-  , mkTestMod "TypeFamilies.hs"          "Main"-  , mkTestMod "TypeOperators.hs"         "Main"-  , mkTestMod "Utils2.hs"                "Utils2"-  , mkTestMod "Vect.hs"                  "Vect"-  , mkTestMod "ViewPatterns.hs"          "Main"-  , mkTestMod "Warning.hs"               "Warning"-  , mkTestMod "WhereIn4.hs"              "WhereIn4"-  , mkTestMod "Zipper.hs"                "Zipper"-  , mkTestMod "QuasiQuote.hs"            "QuasiQuote"-  , mkTestMod "Pseudonym.hs"             "Main"-  , mkTestMod "Obscure.hs"               "Main"-  , mkTestMod "Remorse.hs"               "Main"-  , mkTestMod "Jon.hs"                   "Main"-  , mkTestMod "RSA.hs"                   "Main"-  , mkTestMod "WhereIn3.hs"              "WhereIn3"-  , mkTestMod "Backquote.hs"             "Main"-  , mkTestMod "PatternGuards.hs"         "Main"-  , mkParserTest "Minimal.hs"-  , mkParserTest "Undefined2.hs"-  , mkParserTest "Undefined3.hs"-  , mkParserTest "Undefined4.hs"-  , mkParserTest "Undefined5.hs"-  , mkParserTest "Undefined6.hs"-  , mkParserTest "Undefined7.hs"-  , mkParserTest "Undefined8.hs"-  , mkParserTest "Undefined9.hs"-  , mkParserTest "Undefined10.hs"-  , mkParserTest "Undefined11.hs"-  , mkParserTest "Undefined13.hs"-  , mkParserTest "TypeSynOperator.hs"-  , mkParserTest "TemplateHaskell.hs"-  , mkParserTest "TypeBrackets.hs"-  , mkParserTest "SlidingDoClause.hs"-  , mkParserTest "SlidingListComp.hs"-  , mkParserTest "LiftedConstructors.hs"-  , mkParserTest "LambdaCase.hs"-  , mkParserTest "PuncFunctions.hs"-  , mkParserTest "TupleSections.hs"-  , mkParserTest "TypeSynParens.hs"-  , mkParserTest "SlidingRecordSetter.hs"-  , mkParserTest "MultiLineCommentWithPragmas.hs"-  , mkParserTest "GHCOrig.hs"-  , mkParserTest "DoubleForall.hs"-  , mkParserTest "AnnPackageName.hs"-  , mkParserTest "NestedLambda.hs"-  , mkParserTest "DefaultTypeInstance.hs"-  , mkParserTest "RecordWildcard.hs"-  , mkParserTest "MagicHash.hs"-  , mkParserTest "GADTRecords.hs"-  , mkParserTest "MangledSemiLet.hs"-  , mkParserTest "MultiImplicitParams.hs"-  , mkParserTest "UnicodeSyntaxFailure.hs"--  , mkParserTest "HangingRecord.hs"-  , mkParserTest "InfixPatternSynonyms.hs"-  , mkParserTest "LiftedInfixConstructor.hs"-  , mkParserTest "MultiWayIf.hs"-  , mkParserTest "OptSig.hs"-  , mkParserTest "StrangeTypeClass.hs"-  , mkParserTest "TypeSignatureParens.hs"-  , mkParserTest "Cpp.hs"--  , mkParserTest "Shebang.hs"-  , mkParserTest "PatSigBind.hs"-  , mkParserTest "ProcNotation.hs"-  , mkParserTest "DroppedDoSpace.hs"-  , mkParserTest "IndentedDo.hs"-  , mkParserTest "BracesSemiDataDecl.hs"-  , mkParserTest "SpacesSplice.hs"-  , mkParserTest "SemiWorkout.hs"-  , mkParserTest "ShiftingLambda.hs"-  , mkParserTest "NestedDoLambda.hs"-  , mkParserTest "DoPatBind.hs"--  , mkParserTest "LinePragma.hs"-  , mkParserTest "Hang.hs"--  , mkParserTest "HashQQ.hs"-  , mkParserTest "TypeBrackets2.hs"-  , mkParserTest "ExplicitNamespaces.hs"-  , mkParserTest "CorePragma.hs"-  , mkParserTest "GADTContext.hs"-  , mkParserTest "THMonadInstance.hs"---  , mkParserTest "TypeBrackets3.hs" --  I think this test is junk but it parses?-  , mkParserTest "TypeBrackets4.hs"-  , mkParserTest "SlidingTypeSyn.hs"-  , mkParserTest "RecordSemi.hs"-  , mkParserTest "SlidingLambda.hs"-  , mkParserTest "DroppedComma.hs"-  , mkParserTest "TypeInstance.hs"-  , mkParserTest "ImplicitTypeSyn.hs"-  , mkParserTest "OveridingPrimitives.hs"-  , mkParserTest "SlidingDataClassDecl.hs"-  , mkParserTest "SemiInstance.hs"-  , mkParserTest "ImplicitSemi.hs"-  , mkParserTest "RulesSemi.hs"-  , mkParserTest "InlineSemi.hs"-  , mkParserTest "SpliceSemi.hs"-  , mkParserTest "Imports.hs"-  , mkParserTest "Internals.hs"-  , mkParserTest "Control.hs"-  , mkParserTest "T10196.hs"-  , mkParserTest "StringGap.hs"-  , mkParserTest "RedundantDo.hs"-  , mkParserTest "TypeSignature.hs"-  ]--  ++ transformTests+findTests :: IO Test+findTests = testList "Round-trip tests" <$> mapM findTestsDir testDirs -  ++ failingTests+findTestsDir :: FilePath -> IO Test+findTestsDir dir = do+  let fp = testPrefix </> dir+  fs <- getDirectoryContents fp+  let testFiles = filter (".hs" `isSuffixOf`) fs+  return $ testList dir (map (mkParserTest dir) testFiles) +mkTests :: IO Test+mkTests = do+  roundTripTests <- findTests+  return $ TestList [roundTripTests, transformTests, failingTests]  -- Tests that will fail until https://phabricator.haskell.org/D907 lands in a -- future GHC-failingTests :: [Test]-failingTests =+failingTests :: Test+failingTests = testList "Failing tests"   [   -- Require current master #10313 / Phab:D907-    mkTestModBad "Deprecation.hs"            "Deprecation"-  , mkTestModBad "MultiLineWarningPragma.hs" "Main"-  , mkTestModBad "UnicodeRules.hs"           "Main"+    mkTestModBad "Deprecation.hs"+  , mkTestModBad "MultiLineWarningPragma.hs"+  , mkTestModBad "UnicodeRules.hs"    -- Tests requiring future GHC modifications-  , mkTestModBad "UnicodeSyntax.hs"          "Tutorial"-  , mkTestModBad "InfixOperator.hs"          "Main"+  , mkTestModBad "UnicodeSyntax.hs"+  , mkTestModBad "InfixOperator.hs"   ]  -mkParserTest :: FilePath -> Test-mkParserTest fp =-  let basename       = "tests" </> "examples" </> fp+mkParserTest :: FilePath -> FilePath -> Test+mkParserTest dir fp =+  let basename       = testPrefix </> dir </> fp       writeFailure   = writeFile (basename <.> "out")       writeHsPP      = writeFile (basename <.> "hspp")       writeIncons s  = writeFile (basename <.> "incons") (showGhc s)   in-    TestCase (do r <- either (\(ParseFailure _ s) -> error s) id-                        <$> roundTripTest ("tests" </> "examples" </> fp)+    TestCase (do r <- either (\(ParseFailure _ s) -> error (s ++ basename)) id+                        <$> roundTripTest basename                  writeFailure (debugTxt r)                  forM_ (inconsistent r) writeIncons                  forM_ (cppStatus r) writeHsPP                  assertBool fp (status r == Success))  --mkTestMod :: FilePath -> String -> Test-mkTestMod fileName _modName-  =  mkParserTest fileName-- -- ---------------------------------------------------------------------  formatTT :: ([([Char], Bool)], [([Char], Bool)]) -> IO ()@@ -300,216 +126,34 @@     putStrLn "Fail"     mapM_ (putStrLn . fst) fs) -tt' :: IO ()-tt' = formatTT =<< partition snd <$> sequence [ return ("", True)-    -- , manipulateAstTestWFname "ExprPragmas.hs"           "ExprPragmas"-    -- , manipulateAstTestWFname "MonadComprehensions.hs"   "Main"-    -- , manipulateAstTestWFname "RecursiveDo.hs"           "Main"-    -- , manipulateAstTestWFname "MultiParamTypeClasses.hs" "Main"-    -- , manipulateAstTestWFname "DataFamilies.hs"          "DataFamilies"-    -- , manipulateAstTestWFname "Deriving.hs"              "Main"-    -- , manipulateAstTestWFname "Default.hs"               "Main"-    -- , manipulateAstTestWFname "ForeignDecl.hs"           "ForeignDecl"-    -- , manipulateAstTestWFname "Warning.hs"               "Warning"-    -- , manipulateAstTestWFname "Annotations.hs"           "Annotations"-    -- -- , manipulateAstTestWFnameTH "QuasiQuote.hs"          "QuasiQuote"-    -- , manipulateAstTestWFname "Roles.hs"                 "Roles"-    -- , manipulateAstTestWFname "ImportsSemi.hs"           "ImportsSemi"-    -- , manipulateAstTestWFname "Stmts.hs"                 "Stmts"-    -- , manipulateAstTestWFname "Mixed.hs"                 "Main"-    -- , manipulateAstTestWFname "Arrow.hs"                 "Arrow"-    -- , manipulateAstTestWFname "PatSynBind.hs"            "Main"-    -- , manipulateAstTestWFname "HsDo.hs"                  "HsDo"-    -- , manipulateAstTestWFname "ForAll.hs"                "ForAll"-    -- , manipulateAstTestWFname "BangPatterns.hs"          "Main"-    -- , manipulateAstTestWFname "Move1.hs"                 "Move1"-    -- , manipulateAstTestWFname "TypeOperators.hs"         "Main"-    -- , manipulateAstTestWFname "NullaryTypeClasses.hs"    "Main"-    -- , manipulateAstTestWFname "FunctionalDeps.hs"        "Main"-    -- , manipulateAstTestWFname "DerivingOC.hs"            "Main"-    -- , manipulateAstTestWFname "GenericDeriving.hs"       "Main"-    -- , manipulateAstTestWFname "OverloadedStrings.hs"     "Main"-    -- , manipulateAstTestWFname "RankNTypes.hs"            "Main"-    -- , manipulateAstTestWFname "Arrows.hs"                "Main"-    -- , manipulateAstTestWFname "TH.hs"                    "Main"-    -- , manipulateAstTestWFname "StaticPointers.hs"        "Main"-    -- , manipulateAstTestWFname "Guards.hs"                "Main"-    -- , manipulateAstTestWFname "Vect.hs"                  "Vect"-    -- , manipulateAstTestWFname "Tuple.hs"                 "Main"-    -- , manipulateAstTestWFname "ExtraConstraints1.hs"     "ExtraConstraints1"-    -- , manipulateAstTestWFname "AddAndOr3.hs"             "AddAndOr3"-    -- , manipulateAstTestWFname "Ann01.hs"                 "Ann01"-    -- , manipulateAstTestWFname "StrictLet.hs"             "Main"-    -- , manipulateAstTestWFname "Cg008.hs"                 "Cg008"-    -- , manipulateAstTestWFname "T2388.hs"                 "T2388"-    -- , manipulateAstTestWFname "T3132.hs"                 "T3132"-    -- , manipulateAstTestWFname "Stream.hs"                "Stream"-    -- , manipulateAstTestWFname "Trit.hs"                  "Trit"-    -- , manipulateAstTestWFname "Zipper.hs"                "Zipper"-    -- , manipulateAstTestWFname "Sigs.hs"                  "Sigs"-    -- , manipulateAstTestWFname "Utils2.hs"                "Utils2"-    -- , manipulateAstTestWFname "EmptyMostlyInst.hs"       "EmptyMostlyInst"-    -- , manipulateAstTestWFname "EmptyMostlyNoSemis.hs"    "EmptyMostlyNoSemis"-    -- , manipulateAstTestWFname "EmptyMostly.hs"           "EmptyMostly"-    -- , manipulateAstTestWFname "FromUtils.hs"             "Main"-    -- , manipulateAstTestWFname "DocDecls.hs"              "DocDecls"-    -- , manipulateAstTestWFname "RecordUpdate.hs"          "Main"-    -- -- manipulateAstTestWFname "Unicode.hs"               "Main"-    -- , manipulateAstTestWFname "B.hs"                     "Main"-    -- , manipulateAstTestWFname "LayoutWhere.hs"           "Main"-    -- , manipulateAstTestWFname "Deprecation.hs"           "Deprecation"-    -- , manipulateAstTestWFname "UnicodeRules.hs"               "Main"-    -- , manipulateAstTestWFname "Infix.hs"                 "Main"-    -- , manipulateAstTestWFname "BCase.hs"                 "Main"-    -- , manipulateAstTestWFname "LetExprSemi.hs"           "LetExprSemi"-    -- , manipulateAstTestWFname "LetExpr2.hs"              "Main"-    -- , manipulateAstTestWFname "LetStmt.hs"               "Layout.LetStmt"-    -- , manipulateAstTestWFname "RebindableSyntax.hs"      "Main"-    -- -- , manipulateAstTestWithMod changeLayoutLet3 "LayoutLet4.hs" "LayoutLet4"-    -- -- , manipulateAstTestWithMod changeLayoutLet5 "LayoutLet5.hs" "LayoutLet5"-    -- , manipulateAstTestWFname "EmptyMostly2.hs"          "EmptyMostly2"-    -- , manipulateAstTestWFname "Dead1.hs"                 "Dead1"-    -- , manipulateAstTestWFname "DocDecls.hs"              "DocDecls"-    -- , manipulateAstTestWFname "ViewPatterns.hs"          "Main"-    -- , manipulateAstTestWFname "FooExpected.hs"          "Main"-    -- -- , manipulateAstTestWithMod changeLayoutLet2 "LayoutLet2.hs" "LayoutLet2"-    -- , manipulateAstTestWFname "LayoutIn1.hs"                 "LayoutIn1"-    -- -- , manipulateAstTestWithMod changeLayoutIn1  "LayoutIn1.hs" "LayoutIn1"-    -- , manipulateAstTestWFname "LocToName.hs"                 "LocToName"-    -- -- , manipulateAstTestWithMod changeLayoutIn4  "LayoutIn4.hs" "LayoutIn4"-    -- -- , manipulateAstTestWithMod changeLocToName  "LocToName.hs" "LocToName"-    -- -- , manipulateAstTestWithMod changeLayoutLet3 "LayoutLet3.hs" "LayoutLet3"-    -- -- , manipulateAstTestWithMod changeRename1    "Rename1.hs"  "Main"-    -- , manipulateAstTestWFname    "Rename1.hs"  "Main"-    -- , manipulateAstTestWFname "AltsSemis.hs"             "Main"-    -- , manipulateAstTestWFname "LetExpr.hs"               "LetExpr"-    -- , manipulateAstTestWFname "Rules.hs"                 "Rules"-    -- , manipulateAstTestWFname "LayoutLet2.hs"             "LayoutLet2"-    -- , manipulateAstTestWFname "LayoutIn3.hs"             "LayoutIn3"-    -- , manipulateAstTestWFname "LayoutIn3a.hs"             "LayoutIn3a"-    -- -- , manipulateAstTestWFnameMod changeLayoutIn3  "LayoutIn3a.hs" "LayoutIn3a"-    -- , manipulateAstTestWFname "LetIn1.hs"             "LetIn1"-    -- -- , manipulateAstTestWFnameMod changeLetIn1  "LetIn1.hs" "LetIn1"-    -- -- , manipulateAstTestWFnameMod changeLayoutIn3  "LayoutIn3b.hs" "LayoutIn3b"-    -- -- , manipulateAstTestWFnameMod changeLayoutIn3  "LayoutIn3.hs" "LayoutIn3"-    -- , manipulateAstTestWFname "LayoutLet2.hs"             "LayoutLet2"-    -- , manipulateAstTestWFname "LayoutLet.hs"             "Main"-    -- , manipulateAstTestWFname "Simple.hs"             "Main"-    -- , manipulateAstTestWFname "FunDeps.hs"               "Main"-    -- , manipulateAstTestWFname "IfThenElse3.hs"              "Main"-    -- , manipulateAstTestWFname "ImplicitParams.hs"        "Main"-    -- , manipulateAstTestWFname "ListComprehensions.hs"    "Main"-    -- , manipulateAstTestWFname "TransformListComp.hs"     "Main"-    -- , manipulateAstTestWFname "PArr.hs"                  "PArr"-    -- , manipulateAstTestWFname "DataDecl.hs"              "Main"-    -- , manipulateAstTestWFname "WhereIn4.hs"              "WhereIn4"-    -- , manipulateAstTestWFname "Pseudonym.hs"             "Main"-    -- , manipulateAstTestWFname "Obscure.hs"             "Main"-    -- , manipulateAstTestWFname "Remorse.hs"             "Main"-    -- , manipulateAstTestWFname "Jon.hs"             "Main"-    -- , manipulateAstTestWFname "RSA.hs"             "Main"-    -- , manipulateAstTestWFname "CExpected.hs"                "CExpected"-    -- , manipulateAstTestWFname "C.hs"                        "C"-    -- -- , manipulateAstTestWFnameMod changeCifToCase  "C.hs"    "C"-    -- -- , manipulateAstTestWFnameMod changeWhereIn3 "WhereIn3.hs"    "WhereIn3"-    -- , manipulateAstTestWFname "DoParens.hs"   "Main"-    -- , manipulateAstTestWFname "SimpleComplexTuple.hs" "Main"-    -- , manipulateAstTestWFname "Backquote.hs" "Main"-    -- , manipulateAstTestWFname "HangingRecord.hs" "Main"-    -- , manipulateAstTestWFname "PatternGuards.hs"              "Main"-    -- -- , manipulateAstTestWFnameMod (changeWhereIn3 2) "WhereIn3.hs"    "WhereIn3"-    -- -- , manipulateAstTestWFnameMod (changeWhereIn3 2) "WhereIn3.hs"    "WhereIn3"-    -- , manipulateAstTestWFname "DoParens.hs"   "Main"--    -- -- Future tests to pass, after appropriate dev is done-    -- -- , manipulateAstTestWFname "MultipleInferredContexts.hs"   "Main"-    -- -- , manipulateAstTestWFname "ArgPuncParens.hs"   "Main"-    -- -- , manipulateAstTestWFname "SimpleComplexTuple.hs" "Main"-    -- -- , manipulateAstTestWFname "DoPatBind.hs" "Main"-    -- , manipulateAstTestWFname "DroppedDoSpace.hs" "Main"-    -- , manipulateAstTestWFname "DroppedDoSpace2.hs" "Main"-    -- , manipulateAstTestWFname "GHCOrig.hs" "GHC.Tuple"--    -- , manipulateAstTestWFname "Cpp.hs"                   "Main"-    -- , manipulateAstTestWFname "MangledSemiLet.hs"        "Main"-    -- , manipulateAstTestWFname "ListComprehensions.hs"    "Main"-    -- , manipulateAstTestWFname "ParensAroundContext.hs"   "ParensAroundContext"-    -- , manipulateAstTestWFname "TypeFamilies.hs"          "Main"-    -- , manipulateAstTestWFname "Associated.hs"            "Main"-    -- , manipulateAstTestWFname "RdrNames.hs"              "RdrNames"-    -- , manipulateAstTestWFname "StrangeTypeClass.hs"      "Main"-    -- , manipulateAstTestWFname "TypeSignatureParens.hs"   "Main"-    -- , manipulateAstTestWFname "DoubleForall.hs"          "Main"-    -- , manipulateAstTestWFname "GADTRecords.hs"           "Main"-    -- , manipulateAstTestWFname "Existential.hs"           "Main"-    -- , manipulateAstTestWFname "ScopedTypeVariables.hs"   "Main"-    -- , manipulateAstTestWFname "T5951.hs"   "T5951"-    -- , manipulateAstTestWFname "Zipper2.hs"               "Zipper2"-    -- , manipulateAstTestWFname "RdrNames2.hs"             "RdrNames2"-    -- , manipulateAstTestWFname "Unicode.hs"               "Unicode"-    -- , manipulateAstTestWFname "OptSig2.hs"               "Main"-    -- , manipulateAstTestWFname "Minimal.hs"               "Main"-    -- , manipulateAstTestWFname "DroppedComma.hs"          "Main"-    -- , manipulateAstTestWFname "SlidingTypeSyn.hs"        "Main"-    -- , manipulateAstTestWFname "TupleSections.hs"         "Main"-    -- , manipulateAstTestWFname "CorePragma.hs"            "Main"-    -- , manipulateAstTestWFname "Splice.hs"                "Splice"-    -- , manipulateAstTestWFname "TemplateHaskell.hs"       "Main"-    -- , manipulateAstTestWFname "GADTContext.hs"           "Main"-    -- , manipulateAstTestWFnameBad "UnicodeSyntax.hs"      "Tutorial"-    -- , manipulateAstTestWFname "DataDecl.hs"              "Main"--    -- , manipulateAstTestWFname "TypeBrackets.hs"         "Main"-    -- , manipulateAstTestWFname "TypeBrackets2.hs"        "Main"-    -- , manipulateAstTestWFname "TypeBrackets4.hs"        "Main"-    -- , manipulateAstTestWFname "NestedLambda.hs"         "Main"-    -- , manipulateAstTestWFname "ShiftingLambda.hs"       "Main"-    -- , manipulateAstTestWFname "SlidingLambda.hs"        "Main"---    , manipulateAstTestWFnameMod changeAddDecl "AddDecl.hs" "AddDecl"-    -- , manipulateAstTestWFnameMod changeLocalDecls "LocalDecls.hs" "LocalDecls"-    -- , manipulateAstTestWFname "LocalDecls2Expected.hs"        "LocalDecls2Expected"-    -- , manipulateAstTestWFname "LocalDecls2.hs"        "LocalDecls2"-    -- , manipulateAstTestWFnameMod changeLocalDecls2 "LocalDecls2.hs" "LocalDecls2"-    -- , manipulateAstTestWFname "WhereIn3.hs"                 "WhereIn3"-    -- , manipulateAstTestWFnameMod changeWhereIn3a "WhereIn3a.hs" "WhereIn3a"-    -- , manipulateAstTestWFname "Imports.hs"              "Imports"-    -- , manipulateAstTestWFname "T10196.hs"               "T10196"-    , manipulateAstTestWFnameMod addLocaLDecl1 "AddLocalDecl1.hs" "AddLocaLDecl1"-    -- , manipulateAstTestWFnameMod addLocaLDecl2 "AddLocalDecl2.hs" "AddLocaLDecl2"-    -- , manipulateAstTestWFnameMod addLocaLDecl3 "AddLocalDecl3.hs" "AddLocaLDecl3"-    -- , manipulateAstTestWFnameMod addLocaLDecl4 "AddLocalDecl4.hs" "AddLocaLDecl4"-    -- , manipulateAstTestWFnameMod addLocaLDecl5 "AddLocalDecl5.hs" "AddLocaLDecl5"-    -- , manipulateAstTestWFnameMod addLocaLDecl6 "AddLocalDecl6.hs" "AddLocaLDecl6"-    -- , manipulateAstTestWFnameMod rmDecl1       "RmDecl1.hs"       "RmDecl1"-    -- , manipulateAstTestWFname "RmDecl2.hs"                        "RmDecl2"-    -- , manipulateAstTestWFnameMod rmDecl2       "RmDecl2.hs"       "RmDecl2"-    -- , manipulateAstTestWFnameMod rmDecl3       "RmDecl3.hs"       "RmDecl3"-    -- , manipulateAstTestWFnameMod rmDecl4       "RmDecl4.hs"       "RmDecl4"-    -- , manipulateAstTestWFnameMod rmDecl5       "RmDecl5.hs"       "RmDecl5"-    -- , manipulateAstTestWFname "RmDecl5.hs"                        "RmDecl5"-    -- , manipulateAstTestWFnameMod rmDecl6       "RmDecl6.hs"       "RmDecl6"-    -- , manipulateAstTestWFnameMod rmDecl7       "RmDecl7.hs"       "RmDecl7"-    -- , manipulateAstTestWFname "TypeSignature.hs"                  "TypeSignature"-    -- , manipulateAstTestWFnameMod rmTypeSig1    "RmTypeSig1.hs"    "RmTypeSig1"-    -- , manipulateAstTestWFnameMod rmTypeSig2    "RmTypeSig2.hs"    "RmTypeSig2"-    -- , manipulateAstTestWFname "StringGap.hs"                      "StringGap"-    -- , manipulateAstTestWFnameMod addHiding1    "AddHiding1.hs"    "AddHiding1"-    -- , manipulateAstTestWFnameMod addHiding2    "AddHiding2.hs"    "AddHiding2"-    -- , manipulateAstTestWFnameMod cloneDecl1    "CloneDecl1.hs"    "CloneDecl1"-    -- , manipulateAstTestWFname "SimpleDo.hs"                      "Main"-    -- , manipulateAstTestWFnameMod changeRename2    "Rename2.hs"  "Main"-    , manipulateAstTestWFname "Arrow2.hs"                      "Arrow2"-    {--    , manipulateAstTestWFname "Lhs.lhs"                  "Main"-    , manipulateAstTestWFname "Foo.hs"                   "Main"-    -}+tt' :: IO (Counts,Int)+tt' = runTestText (putTextToHandle stdout True) $ TestList [+  -- , mkTestModChange changeLayoutLet2  "LayoutLet2.hs"+  -- , mkTestModChange changeLayoutLet3  "LayoutLet3.hs"+  -- , mkTestModChange changeLayoutLet3  "LayoutLet4.hs"+  -- , mkTestModChange changeRename1     "Rename1.hs"+  -- , mkTestModChange changeRename2     "Rename2.hs"+  -- , mkTestModChange changeLayoutIn1   "LayoutIn1.hs"+  -- , mkTestModChange changeLayoutIn3   "LayoutIn3.hs"+  -- , mkTestModChange changeLayoutIn3   "LayoutIn3a.hs"+  -- , mkTestModChange changeLayoutIn3   "LayoutIn3b.hs"+  -- , mkTestModChange changeLayoutIn4   "LayoutIn4.hs"+  -- , mkTestModChange changeLocToName   "LocToName.hs"+  -- , mkTestModChange changeLetIn1      "LetIn1.hs"+  -- , mkTestModChange changeWhereIn4    "WhereIn4.hs"+  -- , mkTestModChange changeAddDecl     "AddDecl.hs"+    mkTestModChange changeLocalDecls  "LocalDecls.hs"+  -- , mkTestModChange changeLocalDecls2 "LocalDecls2.hs"+  -- , mkTestModChange changeWhereIn3a   "WhereIn3a.hs"+    , mkTestModChange changeRenameCase1 "RenameCase1.hs"+    , mkTestModChange changeRenameCase2 "RenameCase2.hs"     ]  testsTT :: Test testsTT = TestList   [-    mkParserTest "Cpp.hs"-  , mkParserTest "DroppedDoSpace.hs"+    mkParserTest "ghc710" "Cpp.hs"+  , mkParserTest "ghc710" "DroppedDoSpace.hs"   ]  tt :: IO ()@@ -522,28 +166,8 @@      else return () -- exitSuccess  --- | Where all the tests are to be found-examplesDir :: FilePath-examplesDir = "tests" </> "examples"--examplesDir2 :: FilePath-examplesDir2 = "examples"------ ---------------------------------------------------------------------- pwd :: IO FilePath pwd = getCurrentDirectory  cd :: FilePath -> IO () cd = setCurrentDirectory---- -----------------------------------------------------------------------mkSs :: (Int,Int) -> (Int,Int) -> GHC.SrcSpan-mkSs (sr,sc) (er,ec)-  = GHC.mkSrcSpan (GHC.mkSrcLoc (GHC.mkFastString "examples/PatBind.hs") sr sc)-                  (GHC.mkSrcLoc (GHC.mkFastString "examples/PatBind.hs") er ec)---- ---------------------------------------------------------------------
tests/Test/Common.hs view
@@ -12,12 +12,19 @@               , ReportType(..)               , roundTripTest               , getModSummaryForFile++              , testList+              , testPrefix+              , Changer+              , genTest+              , noChange               ) where    import Language.Haskell.GHC.ExactPrint import Language.Haskell.GHC.ExactPrint.Utils+import Language.Haskell.GHC.ExactPrint.Parsers (parseModuleApiAnnsWithCpp) import Language.Haskell.GHC.ExactPrint.Preprocess  import GHC.Paths (libdir)@@ -43,10 +50,16 @@  import Test.Consistency -import Control.Arrow (first)+import Test.HUnit+import System.FilePath  -- import Debug.Trace+testPrefix :: FilePath+testPrefix = "tests" </> "examples" +testList :: String -> [Test] -> Test+testList s ts = TestLabel s (TestList ts)+ -- --------------------------------------------------------------------- -- Roundtrip machinery @@ -83,59 +96,45 @@ removeSpaces :: String -> String removeSpaces = map (\case {'\160' -> ' '; s -> s}) -initDynFlags :: GHC.GhcMonad m => FilePath -> m GHC.DynFlags-initDynFlags file = do-  dflags0 <- GHC.getSessionDynFlags-  let dflags1 = GHC.gopt_set dflags0 GHC.Opt_KeepRawTokenStream-  src_opts <- GHC.liftIO $ GHC.getOptionsFromFile dflags1 file-  (!dflags2, _, _)-    <- GHC.parseDynamicFilePragma dflags1 src_opts-  void $ GHC.setSessionDynFlags dflags2-  return dflags2- roundTripTest :: FilePath -> IO Report-roundTripTest file =-  GHC.defaultErrorHandler GHC.defaultFatalMessager GHC.defaultFlushOut $-    GHC.runGhc (Just libdir) $ do-      dflags <- initDynFlags file-      let useCpp = GHC.xopt GHC.Opt_Cpp dflags-      (fileContents, injectedComments) <--        if useCpp-          then do-            contents <- getPreprocessedSrcDirect defaultCppOptions file-            cppComments <- getCppTokensAsComments defaultCppOptions file-            return (contents,cppComments)-          else do-            txt <- GHC.liftIO $ readFile file-            let (contents1,lp) = stripLinePragmas txt-            return (contents1,lp)+roundTripTest f = genTest noChange f f -      orig <- GHC.liftIO $ readFile file-      let origContents = removeSpaces fileContents-          pristine     = removeSpaces orig-      return $-        case parseFile dflags file origContents of-          GHC.PFailed ss m -> Left $ ParseFailure ss (GHC.showSDoc dflags m)-          GHC.POk (mkApiAnns -> apianns) pmod   ->-            let (printed, anns) = first trimPrinted $ runRoundTrip apianns pmod injectedComments-                -- Clang cpp adds an extra newline character-                -- Do not remove this line!-                trimPrinted p = if useCpp-                                  then unlines $ take (length (lines pristine)) (lines p)-                                  else p-                debugTxt = mkDebugOutput file printed pristine apianns anns pmod-                consistency = checkConsistency apianns pmod-                inconsistent = if null consistency then Nothing else Just consistency-                status = if printed == pristine then Success else RoundTripFailure-                cppStatus = if useCpp then Just origContents else Nothing-            in-              Right Report {..}+type Changer = (Anns -> GHC.ParsedSource -> IO (Anns,GHC.ParsedSource)) +noChange :: Changer+noChange ans parsed = return (ans,parsed) +genTest :: Changer -> FilePath -> FilePath -> IO Report+genTest f origFile expectedFile  = do+      res <- parseModuleApiAnnsWithCpp defaultCppOptions origFile+      expected <- GHC.liftIO $ readFile expectedFile+      orig <- GHC.liftIO $ readFile origFile+      let pristine = removeSpaces expected++      case res of+        Left (ss, m) -> return . Left $ ParseFailure ss m+        Right (apianns, injectedComments, dflags, pmod)  -> do+          (printed', anns, pmod') <- GHC.liftIO (runRoundTrip f apianns pmod injectedComments)+          let useCpp = GHC.xopt GHC.Opt_Cpp dflags+              printed = trimPrinted printed'+          -- let (printed, anns) = first trimPrinted $ runRoundTrip apianns pmod injectedComments+              -- Clang cpp adds an extra newline character+              -- Do not remove this line!+              trimPrinted p = if useCpp+                                then unlines $ take (length (lines pristine)) (lines p)+                                else p+              debugTxt = mkDebugOutput origFile printed pristine apianns anns pmod'+              consistency = checkConsistency apianns pmod+              inconsistent = if null consistency then Nothing else Just consistency+              status = if printed == pristine then Success else RoundTripFailure+              cppStatus = if useCpp then Just orig else Nothing+          return $ Right Report {..}++ mkDebugOutput :: FilePath -> String -> String               -> GHC.ApiAnns               -> Anns-              -> GHC.Located (GHC.HsModule GHC.RdrName) -> String+              -> GHC.ParsedSource -> String mkDebugOutput filename printed original apianns anns parsed =   intercalate sep [ printed                  , filename@@ -149,14 +148,15 @@   -runRoundTrip :: GHC.ApiAnns -> GHC.Located (GHC.HsModule GHC.RdrName)+runRoundTrip :: Changer+             -> GHC.ApiAnns -> GHC.Located (GHC.HsModule GHC.RdrName)              -> [Comment]-             -> (String, Anns)-runRoundTrip !anns !parsedOrig cs =-  let-    !relAnns = relativiseApiAnnsWithComments cs parsedOrig anns-    !printed = exactPrint parsedOrig relAnns-  in (printed,  relAnns)+             -> IO (String, Anns, GHC.ParsedSource)+runRoundTrip f !anns !parsedOrig cs = do+  let !relAnns = relativiseApiAnnsWithComments cs parsedOrig anns+  (annsMod, pmod) <- f relAnns parsedOrig+  let !printed = exactPrint pmod annsMod+  return (printed,  relAnns, pmod)  -- ---------------------------------------------------------------------` 
tests/Test/Transform.hs view
@@ -2,15 +2,11 @@ module Test.Transform where  import Language.Haskell.GHC.ExactPrint-import Language.Haskell.GHC.ExactPrint.Preprocess import Language.Haskell.GHC.ExactPrint.Types-import Language.Haskell.GHC.ExactPrint.Utils import Language.Haskell.GHC.ExactPrint.Parsers -import GHC.Paths ( libdir )  import qualified Bag            as GHC-import qualified DynFlags       as GHC import qualified GHC            as GHC import qualified OccName        as GHC import qualified RdrName        as GHC@@ -20,21 +16,17 @@ import qualified Data.Generics as SYB -- import qualified GHC.SYB.Utils as SYB -import Control.Monad import System.FilePath-import System.IO import qualified Data.Map as Map -- import Data.List import Data.Maybe -import System.IO.Silently- import Test.Common  import Test.HUnit -transformTests :: [Test]-transformTests =+transformTests :: Test+transformTests = TestLabel "transformation tests" $ TestList   [     TestLabel "Low level transformations"        (TestList transformLowLevelTests)@@ -44,33 +36,46 @@  transformLowLevelTests :: [Test] transformLowLevelTests = [-    mkTestModChange changeLayoutLet2  "LayoutLet2.hs"  "LayoutLet2"-  , mkTestModChange changeLayoutLet3  "LayoutLet3.hs"  "LayoutLet3"-  , mkTestModChange changeLayoutLet3  "LayoutLet4.hs"  "LayoutLet4"-  , mkTestModChange changeRename1     "Rename1.hs"     "Main"-  , mkTestModChange changeRename2     "Rename2.hs"     "Main"-  , mkTestModChange changeLayoutIn1   "LayoutIn1.hs"   "LayoutIn1"-  , mkTestModChange changeLayoutIn3   "LayoutIn3.hs"   "LayoutIn3"-  , mkTestModChange changeLayoutIn3   "LayoutIn3a.hs"  "LayoutIn3a"-  , mkTestModChange changeLayoutIn3   "LayoutIn3b.hs"  "LayoutIn3b"-  , mkTestModChange changeLayoutIn4   "LayoutIn4.hs"   "LayoutIn4"-  , mkTestModChange changeLocToName   "LocToName.hs"   "LocToName"-  , mkTestModChange changeLetIn1      "LetIn1.hs"      "LetIn1"-  , mkTestModChange changeWhereIn4    "WhereIn4.hs"    "WhereIn4"-  , mkTestModChange changeAddDecl     "AddDecl.hs"     "AddDecl"-  , mkTestModChange changeLocalDecls  "LocalDecls.hs"  "LocalDecls"-  , mkTestModChange changeLocalDecls2 "LocalDecls2.hs" "LocalDecls2"-  , mkTestModChange changeWhereIn3a   "WhereIn3a.hs"   "WhereIn3a"+    mkTestModChange changeRenameCase1 "RenameCase1.hs"+  , mkTestModChange changeLayoutLet2  "LayoutLet2.hs"+  , mkTestModChange changeLayoutLet3  "LayoutLet3.hs"+  , mkTestModChange changeLayoutLet3  "LayoutLet4.hs"+  , mkTestModChange changeRename1     "Rename1.hs"+  , mkTestModChange changeRename2     "Rename2.hs"+  , mkTestModChange changeLayoutIn1   "LayoutIn1.hs"+  , mkTestModChange changeLayoutIn3   "LayoutIn3.hs"+  , mkTestModChange changeLayoutIn3   "LayoutIn3a.hs"+  , mkTestModChange changeLayoutIn3   "LayoutIn3b.hs"+  , mkTestModChange changeLayoutIn4   "LayoutIn4.hs"+  , mkTestModChange changeLocToName   "LocToName.hs"+  , mkTestModChange changeLetIn1      "LetIn1.hs"+  , mkTestModChange changeWhereIn4    "WhereIn4.hs"+  , mkTestModChange changeAddDecl     "AddDecl.hs"+  , mkTestModChange changeLocalDecls  "LocalDecls.hs"+  , mkTestModChange changeLocalDecls2 "LocalDecls2.hs"+  , mkTestModChange changeWhereIn3a   "WhereIn3a.hs" --  , mkTestModChange changeCifToCase  "C.hs"          "C"   ] -mkTestModChange :: Changer -> FilePath -> String -> Test-mkTestModChange change fileName modName-  = TestCase (do r <- manipulateAstTestWithMod change "expected" fileName modName-                 assertBool fileName r )+mkTestModChange :: Changer -> FilePath -> Test+mkTestModChange = mkTestMod "expected" "transform" -type Changer = (Anns -> GHC.ParsedSource -> IO (Anns,GHC.ParsedSource))+mkTestModBad :: FilePath -> Test+mkTestModBad = mkTestMod "bad" "failing" noChange ++mkTestMod :: String -> FilePath -> Changer -> FilePath ->  Test+mkTestMod suffix dir f fp =+  let basename       = testPrefix </> dir </> fp+      expected       = basename <.> suffix+      writeFailure   = writeFile (basename <.> "out")+  in+    TestCase (do r <- either (\(ParseFailure _ s) -> error (s ++ basename)) id+                        <$> genTest f basename expected+                 writeFailure (debugTxt r)+                 assertBool fp (status r == Success))++ -- ---------------------------------------------------------------------  changeWhereIn3a :: Changer@@ -199,111 +204,12 @@       -- error $ "doRmDecl:decls2=" ++ showGhc (length decls,decls1,decls2)  -- ----------------------------------------------------------------------{---- |Convert the if statement in C.hs to a case, adjusting layout appropriately.-changeCifToCase :: Changer-changeCifToCase ans p = return (ans',p')-  where-    (p',(ans',_),_) = runTransform ans doTransform-    doTransform = SYB.everywhereM (SYB.mkM ifToCaseTransform) p -    ifToCaseTransform :: GHC.Located (GHC.HsExpr GHC.RdrName)-                      -> Transform (GHC.Located (GHC.HsExpr GHC.RdrName))-    ifToCaseTransform li@(GHC.L l (GHC.HsIf _se e1 e2 e3)) = do-      caseLoc        <- uniqueSrcSpanT -- HaRe:-1:1-      trueMatchLoc   <- uniqueSrcSpanT -- HaRe:-1:2-      trueLoc1       <- uniqueSrcSpanT -- HaRe:-1:3-      trueLoc        <- uniqueSrcSpanT -- HaRe:-1:4-      trueRhsLoc     <- uniqueSrcSpanT -- HaRe:-1:5-      falseLoc1      <- uniqueSrcSpanT -- HaRe:-1:6-      falseLoc       <- uniqueSrcSpanT -- HaRe:-1:7-      falseMatchLoc  <- uniqueSrcSpanT -- HaRe:-1:8-      falseRhsLoc    <- uniqueSrcSpanT -- HaRe:-1:9-      caseVirtualLoc <- uniqueSrcSpanT -- HaRe:-1:10-      let trueName  = mkRdrName "True"-      let falseName = mkRdrName "False"-      let ret = GHC.L caseLoc (GHC.HsCase e1-                 (GHC.MG-                  [-                    (GHC.L trueMatchLoc $ GHC.Match-                     Nothing-                     [-                       GHC.L trueLoc1 $ GHC.ConPatIn (GHC.L trueLoc trueName) (GHC.PrefixCon [])-                     ]-                     Nothing-                     (GHC.GRHSs-                       [-                         GHC.L trueRhsLoc $ GHC.GRHS [] e2-                       ] GHC.EmptyLocalBinds)-                    )-                  , (GHC.L falseMatchLoc $ GHC.Match-                     Nothing-                     [-                       GHC.L falseLoc1 $ GHC.ConPatIn (GHC.L falseLoc falseName) (GHC.PrefixCon [])-                     ]-                     Nothing-                     (GHC.GRHSs-                       [-                         GHC.L falseRhsLoc $ GHC.GRHS [] e3-                       ] GHC.EmptyLocalBinds)-                    )-                  ] [] GHC.placeHolderType GHC.FromSource))--      oldAnns <- getAnnsT-      let annIf   = gfromJust "Case.annIf"   $ getAnnotationEP li NotNeeded oldAnns-      let annCond = gfromJust "Case.annCond" $ getAnnotationEP e1 NotNeeded oldAnns-      let annThen = gfromJust "Case.annThen" $ getAnnotationEP e2 NotNeeded oldAnns-      let annElse = gfromJust "Case.annElse" $ getAnnotationEP e3 NotNeeded oldAnns-      logTr $ "Case:annIf="   ++ show annIf-      logTr $ "Case:annThen=" ++ show annThen-      logTr $ "Case:annElse=" ++ show annElse--      -- let ((_ifr,    ifc),  ifDP) = getOriginalPos oldAnns li (G GHC.AnnIf)-      -- let ((_thenr,thenc),thenDP) = getOriginalPos oldAnns li (G GHC.AnnThen)-      -- let ((_elser,elsec),elseDP) = getOriginalPos oldAnns li (G GHC.AnnElse)-      -- let newCol = ifc + 2-      let newCol = 6--      -- AZ:TODO: under some circumstances the GRHS annotations need LineSame, in others LineChanged.-      let ifDelta     = gfromJust "Case.ifDelta"     $ lookup (G GHC.AnnIf) (annsDP annIf)-      -- let ifSpanEntry = gfromJust "Case.ifSpanEntry" $ lookup AnnSpanEntry (annsDP annIf)-      -- let ifSpanEntry = annEntryDelta annIf-      let anne2' =-            [ ( AnnKey caseLoc       (CN "HsCase") NotNeeded,   annIf { annsDP = [ (G GHC.AnnCase, ifDelta)-                                                                     , (G GHC.AnnOf,     DP (0,1))]-                                                                     , annCapturedSpan = Just (AnnKey caseVirtualLoc (CN "(:)") NotNeeded)-                                                                     } )-            , ( AnnKey caseVirtualLoc (CN "(:)") NotNeeded,     Ann (DP (1,newCol)) (ColDelta newCol) (DP (1,newCol)) [] [] [(AnnSpanEntry,DP (1,0))] Nothing Nothing)-            , ( AnnKey trueMatchLoc  (CN "Match") NotNeeded,   annNone )-            , ( AnnKey trueLoc1      (CN "ConPatIn") NotNeeded, annNone )-            , ( AnnKey trueLoc       (CN "Unqual") NotNeeded,  annNone )-            , ( AnnKey trueRhsLoc    (CN "GRHS") NotNeeded,     Ann (DP (0,2)) 6 (DP (0,0)) [] [] [(AnnSpanEntry,DP (0,2)),(G GHC.AnnRarrow, DP (0,0))] Nothing Nothing )--            , ( AnnKey falseMatchLoc (CN "Match") NotNeeded,    Ann (DP (1,0)) 0 (DP (0,0)) [] [] [(AnnSpanEntry,DP (1,0))] Nothing Nothing )-            , ( AnnKey falseLoc1     (CN "ConPatIn") NotNeeded, annNone )-            , ( AnnKey falseLoc      (CN "Unqual") NotNeeded, annNone )-            , ( AnnKey falseRhsLoc   (CN "GRHS") NotNeeded,     Ann (DP (0,1)) 6 (DP (0,0)) [] [] [(AnnSpanEntry,DP (0,1)),(G GHC.AnnRarrow, DP (0,0))] Nothing Nothing )-            ]--      let annThen' = adjustAnnOffset (ColDelta 6) annThen-      let anne1 = modifyKeywordDeltas (Map.delete (AnnKey l (CN "HsIf") NotNeeded)) oldAnns-          final = modifyKeywordDeltas (\s -> Map.union s (Map.fromList anne2')) anne1-          anne3 = setLocatedAnns final-                    [ (e1, annCond)-                    , (e2, annThen')-                    , (e3, annElse)-                    ]-      putAnnsT anne3-      return ret-    ifToCaseTransform x = return x--    mkRdrName :: String -> GHC.RdrName-    mkRdrName s = GHC.mkVarUnqual (GHC.mkFastString s)--}--- ---------------------------------------------------------------------+changeRenameCase1 :: Changer+changeRenameCase1 ans parsed = return (ans,rename "bazLonger" [((3,15),(3,18))] parsed) -noChange :: Changer-noChange ans parsed = return (ans,parsed)+changeRenameCase2 :: Changer+changeRenameCase2 ans parsed = return (ans,rename "fooLonger" [((3,1),(3,4))] parsed)  changeLayoutLet2 :: Changer changeLayoutLet2 ans parsed = return (ans,rename "xxxlonger" [((7,5),(7,8)),((8,24),(8,27))] parsed)@@ -398,183 +304,31 @@  -- --------------------------------------------------------------------- --manipulateAstTestWithMod :: Changer -> String -> FilePath -> String -> IO Bool-manipulateAstTestWithMod change suffix file modname = manipulateAstTest' (Just (change, suffix)) False file modname--manipulateAstTestWFnameMod :: Changer -> FilePath -> String -> IO (FilePath,Bool)-manipulateAstTestWFnameMod change fileName modname-  = do r <- manipulateAstTestWithMod change "expected" fileName modname-       return (fileName,r)--manipulateAstTestWFnameBad :: FilePath -> String -> IO (FilePath,Bool)-manipulateAstTestWFnameBad fileName modname-  = do r <- manipulateAstTestWithMod noChange "bad" fileName modname-       return (fileName,r)--manipulateAstTest :: FilePath -> String -> IO Bool-manipulateAstTest file modname = manipulateAstTest' Nothing False file modname--manipulateAstTestWFname :: FilePath -> String -> IO (FilePath, Bool)-manipulateAstTestWFname file modname = (file,) <$> manipulateAstTest file modname---mkTestModBad :: FilePath -> String -> Test-mkTestModBad fileName modName-  = TestCase (do r <- manipulateAstTestWithMod noChange "bad" fileName modName-                 assertBool fileName r )--manipulateAstTest' :: Maybe (Changer, String)-                   -> Bool -> FilePath -> String -> IO Bool-manipulateAstTest' mchange useTH file' modname = do-  let testpath = "./tests/examples/"-      file     = testpath </> file'-      out      = file <.> "out"--  contents <- case mchange of-                   Nothing                 -> readFile file-                   Just (_,expectedSuffix) -> readFile (file <.> expectedSuffix)-  (ghcAnns',p,cppComments) <- hSilence [stderr] $  parsedFileGhc file modname useTH-  -- (ghcAnns',p,cppComments) <-                      parsedFileGhc file modname useTH-  let-    parsedOrig = GHC.pm_parsed_source $ p-    (ghcAnns,parsed) = (ghcAnns', parsedOrig)-    parsedAST = showAnnData emptyAnns 0 parsed-    -- cppComments = map (tokComment . commentToAnnotation . fst) cppCommentToks-    -- parsedAST = showGhc parsed-       -- `debug` ("getAnn:=" ++ (show (getAnnotationValue (snd ann) (GHC.getLoc parsed) :: Maybe AnnHsModule)))-    -- try to pretty-print; summarize the test result-    ann = relativiseApiAnnsWithComments cppComments parsedOrig ghcAnns'-      `debug` ("ghcAnns:" ++ showGhc ghcAnns)--  (ann',parsed') <- case mchange of-                   Nothing         -> return (ann,parsed)-                   Just (change,_) -> change ann parsed--  let-    printed = exactPrint parsed' ann' -- `debug` ("ann=" ++ (show $ map (\(s,a) -> (ss2span s, a)) $ Map.toList ann))-    outcome = if printed == contents-                then "Match\n"-                else "Fail\n"-    result = printed ++ "\n==============\n"-             ++ outcome ++ "\n==============\n"-             ++ "lengths:" ++ show (length printed,length contents) ++ "\n"-             ++ showAnnData ann' 0 parsed'-             ++ "\n========================\n"-             ++ showGhc ann'-             ++ "\n========================\n"-             ++ showGhc ghcAnns-             ++ "\n========================\n"-             ++ parsedAST-             ++ "\n========================\n"-             ++ showGhc ann-  -- putStrLn $ "Test:ann :" ++ showGhc ann-  writeFile out $ result-  -- putStrLn $ "Test:contents' :" ++ contents-  -- putStrLn $ "Test:parsed=" ++ parsedAST-  -- putStrLn $ "Test:showdata:parsedOrig" ++ SYB.showData SYB.Parser 0 parsedOrig-  -- putStrLn $ "Test:ann :" ++ showGhc ann-  -- putStrLn $ "Test:ghcAnns :" ++ showGhc ghcAnns-  -- putStrLn $ "Test:ghcAnns' :" ++ showGhc ghcAnns'-  -- putStrLn $ "Test:showdata:" ++ showAnnData ann 0 parsed-  -- putStrLn $ "Test:showdata:parsed'" ++ SYB.showData SYB.Parser 0 parsed'-  -- putStrLn $ "Test:showdata:parsed'" ++ showAnnData ann 0 parsed'-  -- putStrLn $ "Test:outcome' :" ++ outcome-  return (printed == contents)----- ------------------------------------------------------------------------ |Result of parsing a Haskell source file. It is simply the--- TypeCheckedModule produced by GHC.-type ParseResult = GHC.ParsedModule--parsedFileGhc :: String -> String -> Bool -> IO (GHC.ApiAnns,ParseResult,[Comment])-parsedFileGhc fileName _modname useTH = do-    -- putStrLn $ "parsedFileGhc:" ++ show fileName-    GHC.defaultErrorHandler GHC.defaultFatalMessager GHC.defaultFlushOut $ do-      GHC.runGhc (Just libdir) $ do-        dflags <- GHC.getSessionDynFlags-        let dflags2 = dflags { GHC.importPaths = ["./tests/examples/","../tests/examples/",-                                                  "./src/","../src/"] }-            tgt = if useTH then GHC.HscInterpreted-                           else GHC.HscNothing -- allows FFI-            dflags3 = dflags2 { GHC.hscTarget = tgt-                              , GHC.ghcLink =  GHC.LinkInMemory-                              }--            dflags4 = GHC.gopt_set dflags3 GHC.Opt_KeepRawTokenStream--        (dflags5,_args,_warns) <- GHC.parseDynamicFlagsCmdLine dflags4 [GHC.noLoc "-package ghc"]-        -- GHC.liftIO $ putStrLn $ "dflags set:(args,warns)" ++ show (map GHC.unLoc _args,map GHC.unLoc _warns)-        void $ GHC.setSessionDynFlags dflags5-        -- GHC.liftIO $ putStrLn $ "dflags set"--        -- hsc_env <- GHC.getSession-        -- (dflags6,fn_pp) <- GHC.liftIO $ GHC.preprocess hsc_env (fileName,Nothing)-        -- GHC.liftIO $ putStrLn $ "preprocess got:" ++ show fn_pp---        target <- GHC.guessTarget fileName Nothing-        GHC.setTargets [target]-        -- GHC.liftIO $ putStrLn $ "target set:" ++ showGhc (GHC.targetId target)-        void $ GHC.load GHC.LoadAllTargets -- Loads and compiles, much as calling make-        -- GHC.liftIO $ putStrLn $ "targets loaded"-        -- g <- GHC.getModuleGraph-        -- let showStuff ms = show (GHC.moduleNameString $ GHC.moduleName $ GHC.ms_mod ms,GHC.ms_location ms)-        -- GHC.liftIO $ putStrLn $ "module graph:" ++ (intercalate "," (map showStuff g))--        -- modSum <- GHC.getModSummary $ GHC.mkModuleName modname-        Just modSum <- getModSummaryForFile fileName-        -- GHC.liftIO $ putStrLn $ "got modSum"-        -- let modSum = head g-        cppComments <-  if (GHC.xopt GHC.Opt_Cpp dflags5)-                        then getCppTokensAsComments defaultCppOptions fileName-                        else return []-        -- let cppComments = [] :: [(GHC.Located GHC.Token, String)]---        GHC.liftIO $ putStrLn $ "\ncppTokensAsComments for:"  ++ fileName ++ "=========\n"---                              ++ showGhc cppComments ++ "\n================\n"-{--        (sourceFile, source, flags) <- getModuleSourceAndFlags (GHC.ms_mod modSum)-        strSrcBuf <- getPreprocessedSrc sourceFile-        GHC.liftIO $ putStrLn $ "preprocessedSrc====\n" ++ strSrcBuf ++ "\n================\n"--}-        p <- GHC.parseModule modSum-        -- GHC.liftIO $ putStrLn $ "got parsedModule"---        t <- GHC.typecheckModule p-        -- GHC.liftIO $ putStrLn $ "typechecked"-        -- toks <- GHC.getRichTokenStream (GHC.ms_mod modSum)-        -- GHC.liftIO $ putStrLn $ "toks" ++ show toks-        let anns = GHC.pm_annotations p-        -- GHC.liftIO $ putStrLn $ "anns"-        return (anns,p,cppComments)---- ---------------------------------------------------------------------- transformHighLevelTests :: [Test] transformHighLevelTests =   [-    mkTestModChange addLocaLDecl1  "AddLocalDecl1.hs"  "AddLocalDecl1"-  , mkTestModChange addLocaLDecl2  "AddLocalDecl2.hs"  "AddLocalDecl2"-  , mkTestModChange addLocaLDecl3  "AddLocalDecl3.hs"  "AddLocalDecl3"-  , mkTestModChange addLocaLDecl4  "AddLocalDecl4.hs"  "AddLocalDecl4"-  , mkTestModChange addLocaLDecl5  "AddLocalDecl5.hs"  "AddLocalDecl5"-  , mkTestModChange addLocaLDecl6  "AddLocalDecl6.hs"  "AddLocalDecl6"+    mkTestModChange addLocaLDecl1  "AddLocalDecl1.hs"+  , mkTestModChange addLocaLDecl2  "AddLocalDecl2.hs"+  , mkTestModChange addLocaLDecl3  "AddLocalDecl3.hs"+  , mkTestModChange addLocaLDecl4  "AddLocalDecl4.hs"+  , mkTestModChange addLocaLDecl5  "AddLocalDecl5.hs"+  , mkTestModChange addLocaLDecl6  "AddLocalDecl6.hs" -  , mkTestModChange rmDecl1 "RmDecl1.hs" "RmDecl1"-  , mkTestModChange rmDecl2 "RmDecl2.hs" "RmDecl2"-  , mkTestModChange rmDecl3 "RmDecl3.hs" "RmDecl3"-  , mkTestModChange rmDecl4 "RmDecl4.hs" "RmDecl4"-  , mkTestModChange rmDecl5 "RmDecl5.hs" "RmDecl5"-  , mkTestModChange rmDecl6 "RmDecl6.hs" "RmDecl6"-  , mkTestModChange rmDecl7 "RmDecl7.hs" "RmDecl7"+  , mkTestModChange rmDecl1 "RmDecl1.hs"+  , mkTestModChange rmDecl2 "RmDecl2.hs"+  , mkTestModChange rmDecl3 "RmDecl3.hs"+  , mkTestModChange rmDecl4 "RmDecl4.hs"+  , mkTestModChange rmDecl5 "RmDecl5.hs"+  , mkTestModChange rmDecl6 "RmDecl6.hs"+  , mkTestModChange rmDecl7 "RmDecl7.hs" -  , mkTestModChange rmTypeSig1 "RmTypeSig1.hs" "RmTypeSig1"-  , mkTestModChange rmTypeSig2 "RmTypeSig2.hs" "RmTypeSig2"+  , mkTestModChange rmTypeSig1 "RmTypeSig1.hs"+  , mkTestModChange rmTypeSig2 "RmTypeSig2.hs" -  , mkTestModChange addHiding1 "AddHiding1.hs" "AddHiding1"-  , mkTestModChange addHiding2 "AddHiding2.hs" "AddHiding2"+  , mkTestModChange addHiding1 "AddHiding1.hs"+  , mkTestModChange addHiding2 "AddHiding2.hs" -  , mkTestModChange cloneDecl1 "CloneDecl1.hs" "CloneDecl1"+  , mkTestModChange cloneDecl1 "CloneDecl1.hs"   ]  -- ---------------------------------------------------------------------
− tests/examples/AddAndOr3.hs
@@ -1,7 +0,0 @@-{-# LANGUAGE PartialTypeSignatures #-}-module AddAndOr3 where--addAndOr3 :: _ -> _ -> _-addAndOr3 (a, b) (c, d) = (a `plus` d, b || c)-  where plus :: Int -> Int -> Int-        x `plus` y = x + y
− tests/examples/AddDecl.hs
@@ -1,9 +0,0 @@-module AddDecl where---- Adding a declaration to an existing file---- | Do foo-foo a b = a + b---- | Do bar-bar x y = foo (x+y) x
− tests/examples/AddDecl.hs.expected
@@ -1,11 +0,0 @@-module AddDecl where--nn = n2---- Adding a declaration to an existing file---- | Do foo-foo a b = a + b---- | Do bar-bar x y = foo (x+y) x
− tests/examples/AddHiding1.hs
@@ -1,7 +0,0 @@-module AddHiding1 where--import Data.Maybe--import Data.Maybe hiding (n1,n2)--f = 1
− tests/examples/AddHiding1.hs.expected
@@ -1,7 +0,0 @@-module AddHiding1 where--import Data.Maybe hiding (n1,n2)--import Data.Maybe hiding (n1,n2)--f = 1
− tests/examples/AddHiding2.hs
@@ -1,5 +0,0 @@-module AddHiding2 where--import Data.Maybe hiding (f1,f2)--f = 1
− tests/examples/AddHiding2.hs.expected
@@ -1,5 +0,0 @@-module AddHiding2 where--import Data.Maybe hiding (f1,f2,n1,n2)--f = 1
− tests/examples/AddLocalDecl1.hs
@@ -1,9 +0,0 @@-module AddLocalDecl1 where---- |This is a function-foo = x -- comment1---- |Another fun-x = a -- comment2-  where-    a = 3
− tests/examples/AddLocalDecl1.hs.expected
@@ -1,11 +0,0 @@-module AddLocalDecl1 where---- |This is a function-foo = x -- comment1-  where-    nn = 2---- |Another fun-x = a -- comment2-  where-    a = 3
− tests/examples/AddLocalDecl2.hs
@@ -1,10 +0,0 @@-module AddLocalDecl2 where---- |This is a function-foo = x -- comment 0-  where p = 2 -- comment 1---- |Another fun-bar = a -- comment 2-  where nn = 2-        p = 2 -- comment 3
− tests/examples/AddLocalDecl2.hs.expected
@@ -1,11 +0,0 @@-module AddLocalDecl2 where---- |This is a function-foo = x -- comment 0-  where nn = 2-        p = 2 -- comment 1---- |Another fun-bar = a -- comment 2-  where nn = 2-        p = 2 -- comment 3
− tests/examples/AddLocalDecl3.hs
@@ -1,10 +0,0 @@-module AddLocalDecl2 where---- |This is a function-foo = x -- comment 0-  where p = 2 -- comment 1---- |Another fun-bar = a -- comment 2-  where p = 2 -- comment 3-        nn = 2
− tests/examples/AddLocalDecl3.hs.expected
@@ -1,11 +0,0 @@-module AddLocalDecl2 where---- |This is a function-foo = x -- comment 0-  where p = 2 -- comment 1-        nn = 2---- |Another fun-bar = a -- comment 2-  where p = 2 -- comment 3-        nn = 2
− tests/examples/AddLocalDecl4.hs
@@ -1,3 +0,0 @@-module AddLocalDecl4 where--toplevel x = c * x
− tests/examples/AddLocalDecl4.hs.expected
@@ -1,6 +0,0 @@-module AddLocalDecl4 where--toplevel x = c * x-  where-    nn :: Int-    nn = 2
− tests/examples/AddLocalDecl5.hs
@@ -1,8 +0,0 @@-module AddLocalDecl5 where--toplevel :: Integer -> Integer-toplevel x = c * x---- c,d :: Integer-c = 7-d = 9
− tests/examples/AddLocalDecl5.hs.expected
@@ -1,9 +0,0 @@-module AddLocalDecl5 where--toplevel :: Integer -> Integer-toplevel x = c * x-  where-    -- c,d :: Integer-    c = 7--d = 9
− tests/examples/AddLocalDecl6.hs
@@ -1,9 +0,0 @@-module AddLocalDecl6 where--foo [] = 1 -- comment 0-foo xs = 2 -- comment 1--bar [] = 1 -- comment 2-  where-    x = 3-bar xs = 2 -- comment 3
− tests/examples/AddLocalDecl6.hs.expected
@@ -1,11 +0,0 @@-module AddLocalDecl6 where--foo [] = 1 -- comment 0-  where-    x = 3-foo xs = 2 -- comment 1--bar [] = 1 -- comment 2-  where-    x = 3-bar xs = 2 -- comment 3
− tests/examples/AddLocalDecl7.hs
@@ -1,9 +0,0 @@-module AddLocalDecl7 where--toplevel :: Integer -> Integer-toplevel x = c * x---- c,d :: Integer-c = 7-d = 9-
− tests/examples/AddLocalDecl7.hs.expected
@@ -1,11 +0,0 @@-module AddLocalDecl7 where--toplevel :: Integer -> Integer-toplevel x = c * x-  where-    nn = nn2---- c,d :: Integer-c = 7-d = 9-
− tests/examples/AltsSemis.hs
@@ -1,11 +0,0 @@---foo x =-  case x of-   { ;;; -- leading-     0 -> 'a';  -- case 0-     1 -> 'b'   -- case 1-   ; 2 -> 'c' ; -- case 2-   ; 3 -> 'd'   -- case 3-          ;;;   -- case 4-   }
− tests/examples/Ann01.hs
@@ -1,38 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}--module Ann01 where--{-# ANN module (1 :: Int) #-}-{-# ANN module (1 :: Integer) #-}-{-# ANN module (1 :: Double) #-}-{-# ANN module $([| 1 :: Int |]) #-}-{-# ANN module "Hello" #-}-{-# ANN module (Just (1 :: Int)) #-}-{-# ANN module [1 :: Int, 2, 3] #-}-{-# ANN module ([1..10] :: [Integer]) #-}-{-# ANN module ''Foo #-}-{-# ANN module (-1 :: Int) #-}--{-# ANN type Foo (1 :: Int) #-}-{-# ANN type Foo (1 :: Integer) #-}-{-# ANN type Foo (1 :: Double) #-}-{-# ANN type Foo $([| 1 :: Int |]) #-}-{-# ANN type Foo "Hello" #-}-{-# ANN type Foo (Just (1 :: Int)) #-}-{-# ANN type Foo [1 :: Int, 2, 3] #-}-{-# ANN type Foo ([1..10] :: [Integer]) #-}-{-# ANN type Foo ''Foo #-}-{-# ANN type Foo (-1 :: Int) #-}-data Foo = Bar Int--{-# ANN f (1 :: Int) #-}-{-# ANN f (1 :: Integer) #-}-{-# ANN f (1 :: Double) #-}-{-# ANN f $([| 1 :: Int |]) #-}-{-# ANN f "Hello" #-}-{-# ANN f (Just (1 :: Int)) #-}-{-# ANN f [1 :: Int, 2, 3] #-}-{-# ANN f ([1..10] :: [Integer]) #-}-{-# ANN f 'f #-}-{-# ANN f (-1 :: Int) #-}-f x = x
− tests/examples/AnnPackageName.hs
@@ -1,4 +0,0 @@---import "base" Prelude-import "base" Data.Data
− tests/examples/Annotations.hs
@@ -1,40 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}--module Annotations where--{-# ANN module (1 :: Int) #-}-{-# ANN module (1 :: Integer) #-}-{-# ANN module (1 :: Double) #-}-{-# ANN module $([| 1 :: Int |]) #-}-{-# ANN module "Hello" #-}-{-# ANN module (Just (1 :: Int)) #-}-{-# ANN module [1 :: Int, 2, 3] #-}-{-# ANN module ([1..10] :: [Integer]) #-}-{-# ANN module ''Foo #-}-{-# ANN module (-1 :: Int) #-}--{-# ANN type Foo (1 :: Int) #-}-{-# ANN type Foo (1 :: Integer) #-}-{-# ANN type Foo (1 :: Double) #-}-{-# ANN type Foo $([| 1 :: Int |]) #-}-{-# ANN type Foo "Hello" #-}-{-# ANN type Foo (Just (1 :: Int)) #-}-{-# ANN type Foo [1 :: Int, 2, 3] #-}-{-# ANN type Foo ([1..10] :: [Integer]) #-}-{-# ANN type Foo ''Foo #-}-{-# ANN type Foo (-1 :: Int) #-}-data Foo = Bar Int--{-# ANN f (1 :: Int) #-}-{-# ANN f (1 :: Integer) #-}-{-# ANN f (1 :: Double) #-}-{-# ANN f $([| 1 :: Int |]) #-}-{-# ANN f "Hello" #-}-{-# ANN f (Just (1 :: Int)) #-}-{-# ANN f [1 :: Int, 2, 3] #-}-{-# ANN f ([1..10] :: [Integer]) #-}-{-# ANN f 'f #-}-{-# ANN f (-1 :: Int) #-}-f x = x--{-# ANN foo "HLint: ignore" #-};foo = map f (map g x)
− tests/examples/Arrow.hs
@@ -1,46 +0,0 @@-{-# LANGUAGE Arrows #-}-module Arrow where--import Control.Arrow-import qualified Control.Category as Cat--addA :: Arrow a => a b Int -> a b Int -> a b Int-addA f g = proc x -> do-                y <- f -< x-                z <- g -< x-                returnA -< y + z--newtype Circuit a b = Circuit { unCircuit :: a -> (Circuit a b, b) }--instance Cat.Category Circuit where-    id = Circuit $ \a -> (Cat.id, a)-    (.) = dot-      where-        (Circuit cir2) `dot` (Circuit cir1) = Circuit $ \a ->-            let (cir1', b) = cir1 a-                (cir2', c) = cir2 b-            in  (cir2' `dot` cir1', c)--instance Arrow Circuit where-    arr f = Circuit $ \a -> (arr f, f a)-    first (Circuit cir) = Circuit $ \(b, d) ->-        let (cir', c) = cir b-        in  (first cir', (c, d))---- | Accumulator that outputs a value determined by the supplied function.-accum :: acc -> (a -> acc -> (b, acc)) -> Circuit a b-accum acc f = Circuit $ \input ->-    let (output, acc') = input `f` acc-    in  (accum acc' f, output)---- | Accumulator that outputs the accumulator value.-accum' :: b -> (a -> b -> b) -> Circuit a b-accum' acc f = accum acc (\a b -> let b' = a `f` b in (b', b'))--total :: Num a => Circuit a a-total = accum' 0 (+)--mean3 :: Fractional a => Circuit a a-mean3 = proc value -> do-    (t, n) <- (| (&&&) (total -< value) (total -< 1) |)-    returnA -< t / n
− tests/examples/Arrow2.hs
@@ -1,53 +0,0 @@-{-# LANGUAGE Arrows #-}-{-# LANGUAGE RankNTypes #-}-{-# LANGUAGE UnicodeSyntax #-}-module Arrow2 where--nonUnicode :: forall a . a -> IO Int-nonUnicode _ = do-  x <- readChar-  return 4---- ^ An opaque ESD handle for recording data from the soundcard via ESD.-data Recorder fr ch (r ∷ * -> *)-    = Recorder {-        reCloseH :: !(FinalizerHandle r)-      }--f :: Arrow a => a (Int,Int,Int) Int-f = proc (x,y,z) -> returnA -< x+y--f2 :: Arrow a => a (Int,Int,Int) Int-f2 = proc (x,y,z) -> returnA >- x+y--g :: ArrowApply a => Int -> a (a Int Int,Int) Int-g y = proc (x,z) -> x -<< 2+y--g2 :: ArrowApply a => Int -> a (a Int Int,Int) Int-g2 y = proc (x,z) -> x >>- 2+y---- ---------------------------------------unicode ∷ ∀ a . a → IO Int-unicode _ = do-  x ← readChar-  return 4---- ^ An opaque ESD handle for recording data from the soundcard via ESD.--- data RecorderU fr ch (r ∷ ★ → ★)-data RecorderU fr ch (r ∷ * → *)-    = RecorderU {-        reCloseHU ∷ !(FinalizerHandle r)-      }--fU :: Arrow a  ⇒ a (Int,Int,Int) Int-fU = proc (x,y,z) -> returnA ⤙ x+y--f2U :: Arrow a ⇒ a (Int,Int,Int) Int-f2U = proc (x,y,z) -> returnA ⤚ x+y--gU :: ArrowApply a ⇒ Int -> a (a Int Int,Int) Int-gU y = proc (x,z) -> x ⤛ 2+y--g2U :: ArrowApply a ⇒ Int -> a (a Int Int,Int) Int-g2U y = proc (x,z) -> x ⤜ 2+y
− tests/examples/Arrows.hs
@@ -1,87 +0,0 @@-{-# LANGUAGE Arrows #-}--- from https://ocharles.org.uk/blog/guest-posts/2014-12-21-arrows.html--import Control.Monad (guard)-import Control.Monad.Identity (Identity, runIdentity)-import Control.Arrow (returnA, Kleisli(Kleisli), runKleisli)--f :: Int -> (Int, Int)-f = \x ->-  let y  = 2 * x-      z1 = y + 3-      z2 = y - 5-  in (z1, z2)---- ghci> f 10--- (23, 15)--fM :: Int -> Identity (Int, Int)-fM = \x -> do-  y  <- return (2 * x)-  z1 <- return (y + 3)-  z2 <- return (y - 5)-  return (z1, z2)---- ghci> runIdentity (fM 10)--- (23,15)---fA :: Int -> (Int, Int)-fA = proc x -> do-  y  <- (2 *) -< x-  z1 <- (+ 3) -< y-  z2 <- (subtract 5) -< y-  returnA -< (z1, z2)---- ghci> fA 10--- (23,15)--range :: Int -> [Int]-range r = [-r..r]--cM :: Int -> [(Int, Int)]-cM = \r -> do-  x <- range 5-  y <- range 5-  guard (x*x + y*y <= r*r)-  return (x, y)---- ghci> take 10 (cM 5)--- [(-5,0),(-4,-3),(-4,-2),(-4,-1),(-4,0),(-4,1),(-4,2),(-4,3),(-3,-4),(-3,-3)]---type K = Kleisli--k :: (a -> m b) -> Kleisli m a b-k = Kleisli--runK :: Kleisli m a b -> (a -> m b)-runK = runKleisli--cA :: Kleisli [] Int (Int, Int)-cA = proc r -> do-  x <- k range -< 5-  y <- k range -< 5-  k guard -< (x*x + y*y <= r*r)-  returnA -< (x, y)---- ghci> take 10 (runK cA 5)--- [(-5,0),(-4,-3),(-4,-2),(-4,-1),(-4,0),(-4,1),(-4,2),(-4,3),(-3,-4),(-3,-3)]--getLineM :: String -> IO String-getLineM prompt = do-  print prompt-  getLine--printM :: String -> IO ()-printM = print--writeFileM :: (FilePath, String) -> IO ()-writeFileM  (filePath, string) = writeFile filePath string--procedureM :: String -> IO ()-procedureM = \prompt -> do-  input <- getLineM prompt-  if input == "Hello"-    then printM "You said 'Hello'"-    else writeFileM ("/tmp/output", "The user said '" ++ input ++ "'")
− tests/examples/Associated.hs
@@ -1,81 +0,0 @@-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE GADTs #-}---- From https://www.haskell.org/haskellwiki/GHC/Type_families#An_associated_data_type_example--import qualified Data.IntMap-import Prelude hiding (lookup)-import Data.Char (ord)--class GMapKey k where-  data GMap k :: * -> *-  empty       :: GMap k v-  lookup      :: k -> GMap k v -> Maybe v-  insert      :: k -> v -> GMap k v -> GMap k v---- An Int instance-instance GMapKey Int where-  data GMap Int v        = GMapInt (Data.IntMap.IntMap v)-  empty                  = GMapInt Data.IntMap.empty-  lookup k   (GMapInt m) = Data.IntMap.lookup k m-  insert k v (GMapInt m) = GMapInt (Data.IntMap.insert k v m)---- A Char instance-instance GMapKey Char where-  data GMap Char v        = GMapChar (GMap Int v)-  empty                   = GMapChar empty-  lookup k (GMapChar m)   = lookup (ord k) m-  insert k v (GMapChar m) = GMapChar (insert (ord k) v m)---- A Unit instance-instance GMapKey () where-  data GMap () v           = GMapUnit (Maybe v)-  empty                    = GMapUnit Nothing-  lookup () (GMapUnit v)   = v-  insert () v (GMapUnit _) = GMapUnit $ Just v---- Product and sum instances-instance (GMapKey a, GMapKey b) => GMapKey (a, b) where-  data GMap (a, b) v            = GMapPair (GMap a (GMap b v))-  empty                         = GMapPair empty-  lookup (a, b) (GMapPair gm)   = lookup a gm >>= lookup b-  insert (a, b) v (GMapPair gm) = GMapPair $ case lookup a gm of-                                    Nothing  -> insert a (insert b v empty) gm-                                    Just gm2 -> insert a (insert b v gm2  ) gm--instance (GMapKey a, GMapKey b) => GMapKey (Either a b) where-  data GMap (Either a b) v                = GMapEither (GMap a v) (GMap b v)-  empty                                   = GMapEither empty empty-  lookup (Left  a) (GMapEither gm1  _gm2) = lookup a gm1-  lookup (Right b) (GMapEither _gm1 gm2 ) = lookup b gm2-  insert (Left  a) v (GMapEither gm1 gm2) = GMapEither (insert a v gm1) gm2-  insert (Right b) v (GMapEither gm1 gm2) = GMapEither gm1 (insert b v gm2)--myGMap :: GMap (Int, Either Char ()) String-myGMap = insert (5, Left 'c') "(5, Left 'c')"    $-         insert (4, Right ()) "(4, Right ())"    $-         insert (5, Right ()) "This is the one!" $-         insert (5, Right ()) "This is the two!" $-         insert (6, Right ()) "(6, Right ())"    $-         insert (5, Left 'a') "(5, Left 'a')"    $-         empty--main = putStrLn $ maybe "Couldn't find key!" id $ lookup (5, Right ()) myGMap---- (Type) Synonym Family--type family Elem c--type instance Elem [e] = e---- type instance Elem BitSet = Char---data family T a-data    instance T Int  = T1 Int | T2 Bool-newtype instance T Char = TC Bool--data family G a b-data instance G [a] b where-   G1 :: c -> G [Int] b-   G2 :: G [a] Bool
− tests/examples/AssociatedType.hs
@@ -1,5 +0,0 @@-{-# LANGUAGE TypeFamilies #-}-class Foldable t where-  type FoldableConstraint t x :: *-  type FoldableConstraint t x = ()-
− tests/examples/B.hs
@@ -1,4 +0,0 @@--foo x = case (odd x) of-            True  -> "Odd"-            False -> "Even"
− tests/examples/BCase.hs
@@ -1,8 +0,0 @@---main =- case 1 > 10 of-   True  -> do putStrLn "hello"-               putStrLn "there"-   False -> do putStrLn "blah"-               putStrLn "blah"
− tests/examples/BIf.hs
@@ -1,8 +0,0 @@---main =- if 1 > 10-   then do putStrLn "hello"-           putStrLn "there"-   else do putStrLn "blah"-           putStrLn "blah"
− tests/examples/Backquote.hs
@@ -1,11 +0,0 @@-import Data.List--foo = do-  let genOut (f,st) = putStrLn (f ++ "\t"++go [e`div`4,e`div`2,3*e`div`4] (scanl1 (+) $ sort st))-  Just 5--f = undefined-go = undefined-e = undefined--
− tests/examples/BangPatterns.hs
@@ -1,16 +0,0 @@-{-# LANGUAGE BangPatterns #-}---- From https://ocharles.org.uk/blog/posts/2014-12-05-bang-patterns.html--import Data.Function (fix)-import Data.List (foldl')--hello3 :: Bool -> String-hello3 !loud = "Hello."--mean :: [Double] -> Double-mean xs = s / fromIntegral l-  where-    (s, l) = foldl' step (0, 0) xs-    step (!s, !l) a = (s + a, l + 1)-
− tests/examples/BootImport.hs
@@ -1,3 +0,0 @@-module BootImport where--data Foo = Foo Int
− tests/examples/BootImport.hs-boot
@@ -1,3 +0,0 @@-module BootImport where--data Foo
− tests/examples/BracesSemiDataDecl.hs
@@ -1,7 +0,0 @@---data Nat (t :: NatKind) where-{-    ZeroNat :: Nat Zero;-    SuccNat :: Nat t -> Nat (Succ t);-};
− tests/examples/C.hs
@@ -1,12 +0,0 @@-module C where--- Test for refactor of if to case--- The comments on the then and else legs should be preserved--foo x = if (odd x)-          then -- This is an odd result-            bob x 1-          else -- This is an even result-            bob x 2--bob x y = x + y-
− tests/examples/C.hs.expected
@@ -1,12 +0,0 @@-module C where--- Test for refactor of if to case--- The comments on the then and else legs should be preserved--foo x = case (odd x) of-          True  -> -- This is an odd result-            bob x 1-          False -> -- This is an even result-            bob x 2--bob x y = x + y-
− tests/examples/CExpected.hs
@@ -1,12 +0,0 @@-module CExpected where--- Test for refactor of if to case--- The comments on the then and else legs should be preserved--foo x = case (odd x) of-          True  -> -- This is an odd result-            bob x 1-          False -> -- This is an even result-            bob x 2--bob x y = x + y-
− tests/examples/Cg008.hs
@@ -1,21 +0,0 @@-{-# LANGUAGE MagicHash, BangPatterns #-}-{-# OPTIONS_GHC -O0 #-}---- Variant of cgrun066; compilation as a module is different.--module Cg008 (hashStr) where--import Foreign.C-import Data.Word-import Foreign.Ptr-import GHC.Exts--import Control.Exception--hashStr  :: Ptr Word8 -> Int -> Int-hashStr (Ptr a#) (I# len#) = loop 0# 0#-   where-    loop h n | isTrue# (n GHC.Exts.==# len#) = I# h-             | otherwise  = loop h2 (n GHC.Exts.+# 1#)-          where !c = ord# (indexCharOffAddr# a# n)-                !h2 = (c GHC.Exts.+# (h GHC.Exts.*# 128#)) `remInt#` 4091#
− tests/examples/CloneDecl1.hs
@@ -1,10 +0,0 @@-module CloneDecl1 where--z = 3--foo a b =-  let-    x = a + b + z-    y = a * b - z-  in-    x + y
− tests/examples/CloneDecl1.hs.expected
@@ -1,17 +0,0 @@-module CloneDecl1 where--z = 3--foo a b =-  let-    x = a + b + z-    y = a * b - z-  in-    x + y--foo a b =-  let-    x = a + b + z-    y = a * b - z-  in-    x + y
− tests/examples/Commands.hs
@@ -1,257 +0,0 @@-{-# LANGUAGE QuasiQuotes #-}--commands :: [Command]-commands = [-    command "help" "display a list of all commands, and their current keybindings" $ do-      macroGuesses <- Macro.guessCommands commandNames <$> getMacros-      addTab (Other "Help") (makeHelpWidget commands macroGuesses) AutoClose--  , command "log" "show the error log" $ do-      messages <- gets logMessages-      let widget = ListWidget.moveLast (ListWidget.new $ reverse messages)-      addTab (Other "Log") (AnyWidget . LogWidget $ widget) AutoClose--  , command "map" "display a list of all commands that are currently bound to keys" $ do-      showMappings--  , command "map" "display the command that is currently bound to the key {name}" $ do-      showMapping--  , command "map" [help|-        Bind the command {expansion} to the key {name}.  The same command may-        be bound to different keys.-        |] $ do-      addMapping--  , command "unmap" "remove the binding currently bound to the key {name}" $ do-      \(MacroName m) -> removeMacro m--  , command "mapclear" "" $ do-      clearMacros--  , command "exit" "exit vimus" $ do-      eval "quit"--  , command "quit" "exit vimus" $ do-      liftIO exitSuccess :: Vimus ()--  , command "close" "close the current window (not all windows can be closed)" $ do-      void closeTab--  , command "source" "read the file {path} and interprets all lines found there as if they were entered as commands." $ do-      \(Path p) -> liftIO (expandHome p) >>= either printError source_--  , command "runtime" "" $-      \(Path p) -> liftIO (getDataFileName p) >>= source_--  , command "color" "define the fore- and background color for a thing on the screen." $ do-      \color fg bg -> liftIO (defineColor color fg bg) :: Vimus ()--  , command "repeat" "set the playlist option *repeat*. When *repeat* is set, the playlist will start over when the last song has finished playing." $ do-      MPD.repeat  True :: Vimus ()--  , command "norepeat" "Unset the playlist option *repeat*." $ do-      MPD.repeat  False :: Vimus ()--  , command "consume" "set the playlist option *consume*. When *consume* is set, songs that have finished playing are automatically removed from the playlist." $ do-      MPD.consume True :: Vimus ()--  , command "noconsume" "Unset the playlist option *consume*." $ do-      MPD.consume False :: Vimus ()--  , command "random" "set the playlist option *random*. When *random* is set, songs in the playlist are played in random order." $ do-      MPD.random  True :: Vimus ()--  , command "norandom" "Unset the playlist option *random*." $ do-      MPD.random  False :: Vimus ()--  , command "single" "Set the playlist option *single*. When *single* is set, playback does not advance automatically to the next item in the playlist. Combine with *repeat* to repeatedly play the same song." $ do-      MPD.single  True :: Vimus ()--  , command "nosingle" "Unset the playlist option *single*." $ do-      MPD.single  False :: Vimus ()--  , command "autotitle" "Set the *autotitle* option.  When *autotitle* is set, the console window title is automatically set to the currently playing song." $ do-      setAutoTitle True--  , command "noautotitle" "Unset the *autotitle* option." $ do-      setAutoTitle False--  , command "volume" "[+-] set volume to  or adjust by [+-] num" $ do-      volume :: Volume -> Vimus ()-- , command "toggle-repeat" "Toggle the *repeat* option." $ do-      MPD.status >>= MPD.repeat  . not . MPD.stRepeat :: Vimus ()--  , command "toggle-consume" "Toggle the *consume* option." $ do-      MPD.status >>= MPD.consume . not . MPD.stConsume :: Vimus ()--  , command "toggle-random" "Toggle the *random* option." $ do-      MPD.status >>= MPD.random  . not . MPD.stRandom :: Vimus ()--  , command "toggle-single" "Toggle the *single* option." $ do-      MPD.status >>= MPD.single  . not . MPD.stSingle :: Vimus ()--  , command "set-library-path" "While MPD knows where your songs are stored, vimus doesn't. If you want to use the *%* feature of the command :! you need to tell vimus where your songs are stored." $ do-      \(Path p) -> setLibraryPath p--  , command "next" "stop playing the current song, and starts the next one" $ do-      MPD.next :: Vimus ()--  , command "previous" "stop playing the current song, and starts the previous one" $ do-      MPD.previous :: Vimus ()--  , command "toggle" "toggle between play and pause" $ do-      MPDE.toggle :: Vimus ()--  , command "stop" "stop playback" $ do-      MPD.stop :: Vimus ()--  , command "update" "tell MPD to update the music database. You must update your database when you add or delete files in your music directory, or when you edit the metadata of a song.  MPD will only rescan a file already in the database if its modification time has changed." $ do-      void (MPD.update Nothing) :: Vimus ()--  , command "rescan" "" $ do-      void (MPD.rescan Nothing) :: Vimus ()--  , command "clear" "delete all songs from the playlist" $ do-      MPD.clear :: Vimus ()--  , command "search-next" "jump to the next occurrence of the search string in the current window"-      searchNext--  , command "search-prev" "jump to the previous occurrence of the search string in the current window"-      searchPrev---  , command "window-library" "open the *Library* window" $-      selectTab Library--  , command "window-playlist" "open the *Playlist* window" $-      selectTab Playlist--  , command "window-search" "open the *SearchResult* window" $-      selectTab SearchResult--  , command "window-browser" "open the *Browser* window" $-      selectTab Browser--  , command "window-next" "open the window to the right of the current one"-      nextTab--  , command "window-prev" "open the window to the left of the current one"-      previousTab--  , command "!" "execute {cmd} on the system shell. See chapter \"Using an external tag editor\" for an example."-      runShellCommand--  , command "seek" "jump to the given position in the current song"-      seek--  , command "visual" "start visual selection" $-      sendEventCurrent EvVisual--  , command "novisual" "cancel visual selection" $-      sendEventCurrent EvNoVisual--  -- Remove current song from playlist-  , command "remove" "remove the song under the cursor from the playlist" $-      sendEventCurrent EvRemove--  , command "paste" "add the last deleted song after the selected song in the playlist" $-      sendEventCurrent EvPaste--  , command "paste-prev" "" $-      sendEventCurrent EvPastePrevious--  , command "copy" "" $-      sendEventCurrent EvCopy--  , command "shuffle" "shuffle the current playlist" $ do-      MPD.shuffle Nothing :: Vimus ()--  , command "add" "append selected songs to the end of the playlist" $ do-      sendEventCurrent EvAdd--  -- insert a song right after the current song-  , command "insert" [help|-      inserts a song to the playlist. The song is inserted after the currently-      playing song.-      |] $ do-      st <- MPD.status-      case MPD.stSongPos st of-        Just n -> do-          -- there is a current song, insert after-          sendEventCurrent (EvInsert (n + 1))-        _ -> do-          -- there is no current song, just add-          sendEventCurrent EvAdd--  -- Playlist: play selected song-  -- Library:  add song to playlist and play it-  -- Browse:   either add song to playlist and play it, or :move-in-  , command "default-action" [help|-      depending on the item under the cursor, somthing different happens:--      - *Playlist* start playing the song under the cursor--      - *Library* append the song under the cursor to the playlist and start playing it--      - *Browser* on a song: append the song to the playlist and play it. On a directory: go down to that directory.-      |] $ do-      sendEventCurrent EvDefaultAction--  , command "add-album" "add all songs of the album of the selected song to the playlist" $ do-      songs <- fromCurrent MPD.Album [MPD.Disc, MPD.Track]-      maybe (printError "Song has no album metadata!") (MPDE.addMany "" . map MPD.sgFilePath) songs--  , command "add-artist" "add all songs of the artist of the selected song to the playlist" $ do-      songs <- fromCurrent MPD.Artist [MPD.Date, MPD.Album, MPD.Disc, MPD.Track]-      maybe (printError "Song has no artist metadata!") (MPDE.addMany "" . map MPD.sgFilePath) songs--  -- movement-  , command "move-up" "move the cursor one line up" $-      sendEventCurrent EvMoveUp--  , command "move-down" "move the cursor one line down" $-      sendEventCurrent EvMoveDown--  , command "move-album-prev" "move the cursor up to the first song of an album" $-      sendEventCurrent EvMoveAlbumPrev--  , command "move-album-next" "move the cursor down to the first song of an album" $-      sendEventCurrent EvMoveAlbumNext--  , command "move-in" "go down one level the directory hierarchy in the *Browser* window" $-      sendEventCurrent EvMoveIn--  , command "move-out" "go up one level in the directory hierarchy in the *Browser* window" $-      sendEventCurrent EvMoveOut--  , command "move-first" "go to the first line in the current window" $-      sendEventCurrent EvMoveFirst--  , command "move-last" "go to the last line in the current window" $-      sendEventCurrent EvMoveLast--  , command "scroll-up" "scroll the contents of the current window up one line" $-      sendEventCurrent (EvScroll (-1))--  , command "scroll-down" "scroll the contents of the current window down one line" $-      sendEventCurrent (EvScroll 1)--  , command "scroll-page-up" "scroll the contents of the current window up one page" $-      pageScroll >>= sendEventCurrent . EvScroll . negate--  , command "scroll-half-page-up" "scroll the contents of the current window up one half page" $-      pageScroll >>= sendEventCurrent . EvScroll . negate . (`div` 2)--  , command "scroll-page-down" "scroll the contents of the current window down one page" $-      pageScroll >>= sendEventCurrent . EvScroll--  , command "scroll-half-page-down" "scroll the contents of the current window down one half page" $-      pageScroll >>= sendEventCurrent . EvScroll . (`div` 2)--  , command "song-format" "set song rendering format" $-      sendEvent . EvChangeSongFormat-  ]-
− tests/examples/Control.hs
@@ -1,210 +0,0 @@-{-# LANGUAGE Unsafe #-}-{-# LANGUAGE CPP-           , NoImplicitPrelude-           , ScopedTypeVariables-           , BangPatterns-  #-}--module GHC.Event.Control-    (-    -- * Managing the IO manager-      Signal-    , ControlMessage(..)-    , Control-    , newControl-    , closeControl-    -- ** Control message reception-    , readControlMessage-    -- *** File descriptors-    , controlReadFd-    , controlWriteFd-    , wakeupReadFd-    -- ** Control message sending-    , sendWakeup-    , sendDie-    -- * Utilities-    , setNonBlockingFD-    ) where--#include "EventConfig.h"--import Foreign.ForeignPtr (ForeignPtr)-import GHC.Base-import GHC.Conc.Signal (Signal)-import GHC.Real (fromIntegral)-import GHC.Show (Show)-import GHC.Word (Word8)-import Foreign.C.Error (throwErrnoIfMinus1_)-import Foreign.C.Types (CInt(..), CSize(..))-import Foreign.ForeignPtr (mallocForeignPtrBytes, withForeignPtr)-import Foreign.Marshal (alloca, allocaBytes)-import Foreign.Marshal.Array (allocaArray)-import Foreign.Ptr (castPtr)-import Foreign.Storable (peek, peekElemOff, poke)-import System.Posix.Internals (c_close, c_pipe, c_read, c_write,-                               setCloseOnExec, setNonBlockingFD)-import System.Posix.Types (Fd)--#if defined(HAVE_EVENTFD)-import Foreign.C.Error (throwErrnoIfMinus1)-import Foreign.C.Types (CULLong(..))-#else-import Foreign.C.Error (eAGAIN, eWOULDBLOCK, getErrno, throwErrno)-#endif--data ControlMessage = CMsgWakeup-                    | CMsgDie-                    | CMsgSignal {-# UNPACK #-} !(ForeignPtr Word8)-                                 {-# UNPACK #-} !Signal-    deriving (Eq, Show)---- | The structure used to tell the IO manager thread what to do.-data Control = W {-      controlReadFd  :: {-# UNPACK #-} !Fd-    , controlWriteFd :: {-# UNPACK #-} !Fd-#if defined(HAVE_EVENTFD)-    , controlEventFd :: {-# UNPACK #-} !Fd-#else-    , wakeupReadFd   :: {-# UNPACK #-} !Fd-    , wakeupWriteFd  :: {-# UNPACK #-} !Fd-#endif-    , didRegisterWakeupFd :: !Bool-    } deriving (Show)--#if defined(HAVE_EVENTFD)-wakeupReadFd :: Control -> Fd-wakeupReadFd = controlEventFd-{-# INLINE wakeupReadFd #-}-#endif---- | Create the structure (usually a pipe) used for waking up the IO--- manager thread from another thread.-newControl :: Bool -> IO Control-newControl shouldRegister = allocaArray 2 $ \fds -> do-  let createPipe = do-        throwErrnoIfMinus1_ "pipe" $ c_pipe fds-        rd <- peekElemOff fds 0-        wr <- peekElemOff fds 1-        -- The write end must be non-blocking, since we may need to-        -- poke the event manager from a signal handler.-        setNonBlockingFD wr True-        setCloseOnExec rd-        setCloseOnExec wr-        return (rd, wr)-  (ctrl_rd, ctrl_wr) <- createPipe-#if defined(HAVE_EVENTFD)-  ev <- throwErrnoIfMinus1 "eventfd" $ c_eventfd 0 0-  setNonBlockingFD ev True-  setCloseOnExec ev-  when shouldRegister $ c_setIOManagerWakeupFd ev-#else-  (wake_rd, wake_wr) <- createPipe-  when shouldRegister $ c_setIOManagerWakeupFd wake_wr-#endif-  return W { controlReadFd  = fromIntegral ctrl_rd-           , controlWriteFd = fromIntegral ctrl_wr-#if defined(HAVE_EVENTFD)-           , controlEventFd = fromIntegral ev-#else-           , wakeupReadFd   = fromIntegral wake_rd-           , wakeupWriteFd  = fromIntegral wake_wr-#endif-           , didRegisterWakeupFd = shouldRegister-           }---- | Close the control structure used by the IO manager thread.--- N.B. If this Control is the Control whose wakeup file was registered with--- the RTS, then *BEFORE* the wakeup file is closed, we must call--- c_setIOManagerWakeupFd (-1), so that the RTS does not try to use the wakeup--- file after it has been closed.-closeControl :: Control -> IO ()-closeControl w = do-  _ <- c_close . fromIntegral . controlReadFd $ w-  _ <- c_close . fromIntegral . controlWriteFd $ w-  when (didRegisterWakeupFd w) $ c_setIOManagerWakeupFd (-1)-#if defined(HAVE_EVENTFD)-  _ <- c_close . fromIntegral . controlEventFd $ w-#else-  _ <- c_close . fromIntegral . wakeupReadFd $ w-  _ <- c_close . fromIntegral . wakeupWriteFd $ w-#endif-  return ()--io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word8-io_MANAGER_WAKEUP = 0xff-io_MANAGER_DIE    = 0xfe--foreign import ccall "__hscore_sizeof_siginfo_t"-    sizeof_siginfo_t :: CSize--readControlMessage :: Control -> Fd -> IO ControlMessage-readControlMessage ctrl fd-    | fd == wakeupReadFd ctrl = allocaBytes wakeupBufferSize $ \p -> do-                    throwErrnoIfMinus1_ "readWakeupMessage" $-                      c_read (fromIntegral fd) p (fromIntegral wakeupBufferSize)-                    return CMsgWakeup-    | otherwise =-        alloca $ \p -> do-            throwErrnoIfMinus1_ "readControlMessage" $-                c_read (fromIntegral fd) p 1-            s <- peek p-            case s of-                -- Wakeup messages shouldn't be sent on the control-                -- file descriptor but we handle them anyway.-                _ | s == io_MANAGER_WAKEUP -> return CMsgWakeup-                _ | s == io_MANAGER_DIE    -> return CMsgDie-                _ -> do  -- Signal-                    fp <- mallocForeignPtrBytes (fromIntegral sizeof_siginfo_t)-                    withForeignPtr fp $ \p_siginfo -> do-                        r <- c_read (fromIntegral fd) (castPtr p_siginfo)-                             sizeof_siginfo_t-                        when (r /= fromIntegral sizeof_siginfo_t) $-                            error "failed to read siginfo_t"-                        let !s' = fromIntegral s-                        return $ CMsgSignal fp s'--  where wakeupBufferSize =-#if defined(HAVE_EVENTFD)-            8-#else-            4096-#endif--sendWakeup :: Control -> IO ()-#if defined(HAVE_EVENTFD)-sendWakeup c =-  throwErrnoIfMinus1_ "sendWakeup" $-  c_eventfd_write (fromIntegral (controlEventFd c)) 1-#else-sendWakeup c = do-  n <- sendMessage (wakeupWriteFd c) CMsgWakeup-  case n of-    _ | n /= -1   -> return ()-      | otherwise -> do-                   errno <- getErrno-                   when (errno /= eAGAIN && errno /= eWOULDBLOCK) $-                     throwErrno "sendWakeup"-#endif--sendDie :: Control -> IO ()-sendDie c = throwErrnoIfMinus1_ "sendDie" $-            sendMessage (controlWriteFd c) CMsgDie--sendMessage :: Fd -> ControlMessage -> IO Int-sendMessage fd msg = alloca $ \p -> do-  case msg of-    CMsgWakeup        -> poke p io_MANAGER_WAKEUP-    CMsgDie           -> poke p io_MANAGER_DIE-    CMsgSignal _fp _s -> error "Signals can only be sent from within the RTS"-  fromIntegral `fmap` c_write (fromIntegral fd) p 1--#if defined(HAVE_EVENTFD)-foreign import ccall unsafe "sys/eventfd.h eventfd"-   c_eventfd :: CInt -> CInt -> IO CInt--foreign import ccall unsafe "sys/eventfd.h eventfd_write"-   c_eventfd_write :: CInt -> CULLong -> IO CInt-#endif--foreign import ccall unsafe "setIOManagerWakeupFd"-   c_setIOManagerWakeupFd :: CInt -> IO ()
− tests/examples/CorePragma.hs
@@ -1,6 +0,0 @@-{-# INLINE strictStream #-}-strictStream (Bitstream l v)-    = {-# CORE "Strict Bitstream stream" #-}-      S.concatMap stream (GV.stream v)-      `S.sized`-      Exact l
− tests/examples/Cpp.hs
@@ -1,17 +0,0 @@-{-# Language CPP #-}--#if __GLASGOW_HASKELL__ > 704-foo :: Int-#else-foo :: Integer-#endif-foo = 3--bar :: (-#if __GLASGOW_HASKELL__ > 704-    Int)-#else-    Integer)-#endif-bar = 4-
− tests/examples/DataDecl.hs
@@ -1,34 +0,0 @@-{-# Language DatatypeContexts #-}-{-# Language ExistentialQuantification #-}-{-# LAnguage GADTs #-}-{-# LAnguage KindSignatures #-}--data Foo = A-         | B-         | C----         | data_or_newtype capi_ctype tycl_hdr constrs deriving-data {-# Ctype "Foo" "bar" #-} F1 = F1-data {-# Ctype       "baz" #-} Eq a =>  F2 a = F2 a--data (Eq a,Ord a) => F3 a = F3 Int a--data F4 a = forall x y. (Eq x,Eq y) => F4 a x y-          | forall x y. (Eq x,Eq y) => F4b a x y---data G1 a :: * where-  G1A,  G1B :: Int -> G1 a-  G1C :: Double -> G1 a--data G2 a :: * where-  G2A { g2a :: a, g2b :: Int } :: G2 a-  G2C :: Double -> G2 a----data (Eq a,Ord a) => G3 a = G3-  { g3A :: Int-  , g3B :: Bool-  , g3a :: a-  } deriving (Eq,Ord)
− tests/examples/DataFamilies.hs
@@ -1,50 +0,0 @@-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE MultiParamTypeClasses #-}---- Based on https://www.haskell.org/haskellwiki/GHC/Type_families#Detailed_definition_of_data_families--module DataFamilies-  (-    GMap-  , GMapKey(type GMapK)-  ) where---- Type 1, Top level--data family GMap k :: * -> *--data family Array e--data family ArrayK :: * -> *----- Type 2, associated types--class GMapKey k where-  data GMapK k :: * -> *--class C a b c where { data T1 c a :: * }  -- OK--- class C a b c where { data T a a :: * }  -- Bad: repeated variable--- class D a where { data T a x :: * }      -- Bad: x is not a class variable-class D a where { data T2 a :: * -> * }   -- OK---- Instances--data instance GMap (Either a b) v = GMapEither (GMap a v) (GMap b v)--data family T3 a-data instance T3 Int  = A-data instance T3 Char = B-nonsense :: T3 a -> Int--- nonsense A = 1             -- WRONG: These two equations together...--- nonsense B = 2             -- ...will produce a type error.-nonsense = undefined---instance (GMapKey a, GMapKey b) => GMapKey (Either a b) where-  data GMapK (Either a b) v = GMapEitherK (GMap a v) (GMap b v)---- data GMap () v = GMapUnit (Maybe v)---               deriving Show--
− tests/examples/Dead1.hs
@@ -1,42 +0,0 @@-{-# OPTIONS  -O -ddump-stranal #-}--module Dead1(foo) where--foo :: Int -> Int-foo n = baz (n+1) (bar1 n)--{-# NOINLINE bar1 #-}-bar1 n = 1 + bar n--bar :: Int -> Int-{-# NOINLINE bar #-}-{-# RULES-"bar/foo" forall n. bar (foo n) = n-   #-}-bar n = n-1--baz :: Int -> Int -> Int-{-# INLINE [0] baz #-}-baz m n = m---{- Ronam writes (Feb08)--    Note that bar becomes dead as soon as baz gets inlined. But strangely,-    the simplifier only deletes it after full laziness and CSE. That is, it-    is not deleted in the phase in which baz gets inlined. In fact, it is-    still there after w/w and the subsequent simplifier run. It gets deleted-    immediately if I comment out the rule.--    I stumbled over this when I removed one simplifier run after SpecConstr-    (at the moment, it runs twice at the end but I don't think that should-    be necessary). With this change, the original version of a specialised-    loop (the one with the rules) is not longer deleted even if it isn't-    used any more. I'll reenable the second simplifier run for now but-    should this really be necessary?--No, it should not be necessary.  A refactoring in OccurAnal makes-this work right. Look at the simplifier output just before strictness-analysis; there should be a binding for 'foo', but for nothing else.---}
− tests/examples/Default.hs
@@ -1,8 +0,0 @@-default (Integer, Double) -- "default default"--mag :: Float -> Float -> Float-mag x y = sqrt( x^2 + y^2 )--main = do--print $ mag 1 1
− tests/examples/DefaultTypeInstance.hs
@@ -1,6 +0,0 @@-{-# LANGUAGE TypeFamilies #-}---class Foldable t where-  type FoldableConstraint t x :: Constraint-  type FoldableConstraint t x = ()
− tests/examples/Deprecation.hs
@@ -1,16 +0,0 @@--module Deprecation-{-# Deprecated ["This is a module \"deprecation\"",-             "multi-line",-             "with unicode: Frère" ] #-}-   ( foo )- where--{-# DEPRECATEd   foo-         ["This is a multi-line",-          "deprecation message",-          "for foo"] #-}-foo :: Int-foo = 4--{-# DEPRECATED withBool        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
− tests/examples/Deprecation.hs.bad
@@ -1,16 +0,0 @@--module Deprecation-{-# Deprecated ["This is a module \"deprecation\"",-             "multi-line",-             "with unicode: Fr\232re" ] #-}-   ( foo )- where--{-# DEPRECATEd   foo-         ["This is a multi-line",-          "deprecation message",-          "for foo"] #-}-foo :: Int-foo = 4--{-# DEPRECATED withBool        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
− tests/examples/Deriving.hs
@@ -1,14 +0,0 @@-{-# LANGUAGE StandaloneDeriving #-}-{-# LANGUAGE DeriveDataTypeable #-}--import Data.Data--data Foo = FooA | FooB--deriving instance Show Foo--deriving instance {-# Overlappable #-} Eq Foo-deriving instance {-# Overlapping  #-} Ord Foo-deriving instance {-# Overlaps     #-} Typeable Foo-deriving instance {-# Incoherent   #-} Data Foo-
− tests/examples/DerivingOC.hs
@@ -1,36 +0,0 @@-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE DeriveFoldable #-}-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE DeriveTraversable #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}---- from https://ocharles.org.uk/blog/guest-posts/2014-12-15-deriving.html--import Data.Data-import Control.Monad.IO.Class-import Control.Monad.Reader-import Control.Monad.State--data MiniIoF a = Terminate-               | PrintLine String a-               | ReadLine (String -> a)-               deriving (Functor)----- data List a = Nil | Cons a (List a)---               deriving (Eq, Show, Functor, Foldable, Traversable)----data List a = Nil | Cons a (List a)-              deriving ( Eq, Show-                       , Functor, Foldable, Traversable-                       , Typeable, Data)--data Config = C String String-data AppState = S Int Bool--newtype App a = App { unApp :: ReaderT Config (StateT AppState IO) a }-                deriving (Monad, MonadReader Config,-                          MonadState AppState, MonadIO,-                          Applicative,Functor)
− tests/examples/DoParens.hs
@@ -1,4 +0,0 @@--foo = do-  (-) <- Just 5-  return ()
− tests/examples/DoPatBind.hs
@@ -1,4 +0,0 @@-module Main where--bar = do-  foo :: String <- baz
− tests/examples/DocDecls.hs
@@ -1,7 +0,0 @@-module DocDecls where---- | A document before-data Foo = A Int | B Char-         deriving (Show)--
− tests/examples/DoubleForall.hs
@@ -1,9 +0,0 @@-{-# LANGUAGE ScopedTypeVariables #-}---extremumNewton :: (Eq a, Fractional a) =>-                  (forall tag. forall tag1.-                          Tower tag1 (Tower tag a)-                              -> Tower tag1 (Tower tag a))-                      -> a -> [a]-extremumNewton f x0 = zeroNewton (diffUU f) x0
− tests/examples/DroppedComma.hs
@@ -1,5 +0,0 @@---foo =-  let (xs, ys) = ([1,2..3], [4,5..6]) in-  bar
− tests/examples/DroppedDoSpace.hs
@@ -1,26 +0,0 @@-import FooBarBaz -- non-existent import, check that we can still parse--save :: C -> IO ()-save state = saveFileDialog "Save file " (maybe Nothing (Just . (++) "*.") (filesuffix state)) $-             do \fileName ->-                    case onSaveCB state of-                      Nothing ->-                          return ()-                      Just callback ->-                          do-                            c <- callback-                            case c of-                              Nothing ->-                                   return ()-                              Just c' ->-                                  let realfn = maybe-                                                fileName-                                                (extendFileName fileName)-                                                (filesuffix state)-                                  in do-                                    L.writeFile realfn c'-                                    postGUIAsync $ labelSetText (View.statusL $ gui state) $ realfn ++ " Saved."-    where-      extendFileName fileName suffix = if isSuffixOf suffix fileName-                                         then fileName-                                         else fileName ++ "." ++ suffix
− tests/examples/DroppedDoSpace2.hs
@@ -1,6 +0,0 @@---save state = do \fileName ->-                  4--
− tests/examples/EmptyMostly.hs
@@ -1,13 +0,0 @@-module EmptyMostly where-   { ;;;-     ;;x=let{;;;;;y=2;;z=3;;;;}in y;-   -- ;;;;-    class Foo a where {;;;;;;-  (--<>--) :: a -> a -> Int  ;-  infixl 5 --<>-- ;-  (--<>--) _ _ = 2 ; -- empty decl at the end.-};--- ;;;;;;;;;;;;--- foo = a where {;;;;;;;;;;;;;;;;;;;;;;;a=1;;;;;;;;}--- ;;-   }
− tests/examples/EmptyMostly2.hs
@@ -1,8 +0,0 @@-module EmptyMostly2 where-   {-;;;;;;;;;;;;-;-class Baz a where {;;;;;;;;;- ; baz :: a -> Int;;;-}-   }
− tests/examples/EmptyMostlyInst.hs
@@ -1,9 +0,0 @@-{-# LANGUAGE FlexibleInstances #-}-module EmptyMostlyInst where-   {-;;;;;;;;;;;;-;-instance Eq (Int,Integer) where {;;;;;;;;;-;;;;;;; a == b = False;;;;;;;;;;;-}-   }
− tests/examples/EmptyMostlyNoSemis.hs
@@ -1,8 +0,0 @@-module EmptyMostlyNoSemis where--x=let{y=2}in y-class Foo a where {-  (--<>--) :: a -> a -> Int;-  infixl 5 --<>--;-  (--<>--) _ _ = 2 ; -- empty decl at the end.- }
− tests/examples/Existential.hs
@@ -1,59 +0,0 @@-{-# LANGUAGE RankNTypes #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE TypeSynonymInstances #-}-{-# LANGUAGE FlexibleInstances #-}---- from https://ocharles.org.uk/blog/guest-posts/2014-12-19-existential-quantification.html--data HashMap k v = HM  -- ... -- actual implementation--class Hashable v where-  h :: v -> Int--data HashMapM hm = HashMapM-  { empty  :: forall k v . hm k v-  , lookup :: Hashable k => k -> hm k v -> Maybe v-  , insert :: Hashable k => k -> v -> hm k v -> hm k v-  , union  :: Hashable k => hm k v -> hm k v -> hm k v-  }---data HashMapE = forall hm . HashMapE (HashMapM hm)---- public-mkHashMapE :: Int -> HashMapE-mkHashMapE = HashMapE . mkHashMapM---- private-mkHashMapM :: Int -> HashMapM HashMap-mkHashMapM salt = HashMapM { {- implementation -} }--instance Hashable String where--type Name = String-data Gift = G String--giraffe :: Gift-giraffe = G "giraffe"--addGift :: HashMapM hm -> hm Name Gift -> hm Name Gift-addGift mod gifts =-  let-    HashMapM{..} = mod-  in-    insert "Ollie" giraffe gifts---- ---------------------------------santa'sSecretSalt = undefined-sendGiftToOllie = undefined-traverse_ = undefined--sendGifts =-  case mkHashMapE santa'sSecretSalt of-    HashMapE (mod@HashMapM{..}) ->-      let-        gifts = addGift mod empty-      in-        traverse_ sendGiftToOllie $ lookup "Ollie" gifts
− tests/examples/ExplicitNamespaces.hs
@@ -1,9 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE MagicHash #-}-{-# LANGUAGE TypeOperators #-}-{-# LANGUAGE TypeFamilies #-}--module CLaSH.Prelude.BitIndex where--import GHC.TypeLits                   (KnownNat, type (+), type (-))
− tests/examples/Expr.hs
@@ -1,132 +0,0 @@-{-# LANGUAGE DeriveDataTypeable #-}-module Expr where--import Data.Generics-import Language.Haskell.TH as TH-import Language.Haskell.TH.Quote---- import Text.ParserCombinators.Parsec--- import Text.ParserCombinators.Parsec.Char--data Expr  =  IntExpr Integer-           |  AntiIntExpr String-           |  BinopExpr BinOp Expr Expr-           |  AntiExpr String-    deriving(Typeable, Data,Show)--data BinOp  =  AddOp-            |  SubOp-            |  MulOp-            |  DivOp-    deriving(Typeable, Data,Show)--eval :: Expr -> Integer-eval (IntExpr n)        = n-eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y)-  where-    opToFun AddOp = (+)-    opToFun SubOp = (-)-    opToFun MulOp = (*)-    opToFun DivOp = (div)--small   = lower <|> char '_'-large   = upper-idchar  = small <|> large <|> digit <|> char '\''--lexeme p    = do{ x <- p; spaces; return x  }-symbol name = lexeme (string name)-parens p    = undefined -- between (symbol "(") (symbol ")") p--_expr :: CharParser st Expr-_expr   = term   `chainl1` mulop--term :: CharParser st Expr-term    = factor `chainl1` addop--factor :: CharParser st Expr-factor  = parens _expr <|> integer <|> anti--mulop   =  undefined-{--           do{ symbol "*"; return $ BinopExpr MulOp }-        <|> do{ symbol "/"; return $ BinopExpr DivOp }--}-addop   = undefined-{--  do{ symbol "+"; return $ BinopExpr AddOp }-        <|> do{ symbol "-"; return $ BinopExpr SubOp }--}--integer :: CharParser st Expr-integer  = lexeme $ do{ ds <- many1 digit ; return $ IntExpr (read ds) }--anti   = undefined-{--  lexeme $-         do  symbol "$"-             c <- small-             cs <- many idchar-             return $ AntiIntExpr (c : cs)--}--parseExpr :: Monad m => TH.Loc -> String -> m Expr-parseExpr (Loc {loc_filename = file, loc_start = (line,col)}) s =-    case runParser p () "" s of-      Left err  -> fail $ "baz"-      Right e   -> return e-  where-    p = do  pos <- getPosition-            setPosition $ setSourceName (setSourceLine (setSourceColumn pos col) line) file-            spaces-            e <- _expr-            eof-            return e--expr = QuasiQuoter { quoteExp = parseExprExp, quotePat = parseExprPat }--parseExprExp :: String -> Q Exp-parseExprExp s =  do  loc <- location-                      expr <- parseExpr loc s-                      dataToExpQ (const Nothing `extQ` antiExprExp) expr--antiExprExp :: Expr -> Maybe (Q Exp)-antiExprExp  (AntiIntExpr v)  = Just $ appE  (conE (mkName "IntExpr"))-                                                (varE (mkName v))-antiExprExp  (AntiExpr v)     = Just $ varE  (mkName v)-antiExprExp  _                = Nothing--parseExprPat :: String -> Q Pat-parseExprPat s =  do  loc <- location-                      expr <- parseExpr loc s-                      dataToPatQ (const Nothing `extQ` antiExprPat) expr--antiExprPat :: Expr -> Maybe (Q Pat)-antiExprPat  (AntiIntExpr v)  = Just $ conP  (mkName "IntExpr")-                                                [varP (mkName v)]-antiExprPat  (AntiExpr v)     = Just $ varP  (mkName v)-antiExprPat  _                = Nothing---- keep parser happy-runParser = undefined-getPosition = undefined-setPosition = undefined-setSourceName = undefined-setSourceLine = undefined-setSourceColumn = undefined-spaces = undefined-eof = undefined-many = undefined-digit = undefined-many1 = undefined-data CharParser a b = F a b-(<|>) = undefined-chainl1 = undefined-string = undefined-char = undefined-lower = undefined-upper = undefined-between = undefined-instance Monad (CharParser a) where-instance Applicative (CharParser a) where-instance Functor (CharParser a) where-
− tests/examples/ExprPragmas.hs
@@ -1,7 +0,0 @@-module ExprPragmas where--a = {-# SCC "name"   #-}  0x5--b = {-# SCC foo   #-} 006--c = {-# GENERATED "foobar" 1 : 2  -  3 :   4 #-} 0.00
− tests/examples/ExtraConstraints1.hs
@@ -1,17 +0,0 @@-{-# LANGUAGE PartialTypeSignatures #-}-module ExtraConstraints1 where--arbitCs1 :: _ => a -> String-arbitCs1 x = show (succ x) ++ show (x == x)--arbitCs2 :: (Show a, _) => a -> String-arbitCs2 x = arbitCs1 x--arbitCs3 :: (Show a, Enum a, _) => a -> String-arbitCs3 x = arbitCs1 x--arbitCs4 :: (Eq a, _) => a -> String-arbitCs4 x = arbitCs1 x--arbitCs5 :: (Eq a, Enum a, Show a, _) => a -> String-arbitCs5 x = arbitCs1 x
− tests/examples/FooExpected.hs
@@ -1,8 +0,0 @@---main =- case 1 > 10 of-   True  -> do putStrLn "hello"-               putStrLn "there"-   False -> do putStrLn "blah"-               putStrLn "blah"
− tests/examples/ForAll.hs
@@ -1,7 +0,0 @@-{-# LANGUAGE RankNTypes #-}-module ForAll where--import Data.Data--foo ::  (forall a. Data a => a -> a) -> forall a. Data a => a -> a-foo a = a
− tests/examples/ForeignDecl.hs
@@ -1,107 +0,0 @@-{-# LANGUAGE MagicHash, UnliftedFFITypes #-}-{-# LANGUAGE ForeignFunctionInterface #-}---- Based on ghc/testsuite/tests/ffi/should_compile contents-module ForeignDecl where--import Foreign-import GHC.Exts-import Data.Int-import Data.Word---- simple functions--foreign import ccall unsafe "a" a :: IO Int--foreign import ccall unsafe "b" b :: Int -> IO Int--foreign import ccall unsafe "c"-  c :: Int -> Char -> Float -> Double -> IO Float---- simple monadic code--d =     a               >>= \ x ->-        b x             >>= \ y ->-        c y 'f' 1.0 2.0---- We can't import the same function using both stdcall and ccall--- calling conventions in the same file when compiling via C (this is a--- restriction in the C backend caused by the need to emit a prototype--- for stdcall functions).-foreign import stdcall        "p" m_stdcall :: StablePtr a -> IO (StablePtr b)-foreign import ccall   unsafe "q" m_ccall   :: ByteArray# -> IO Int---- We can't redefine the calling conventions of certain functions (those from--- math.h).-foreign import stdcall "my_sin" my_sin :: Double -> IO Double-foreign import stdcall "my_cos" my_cos :: Double -> IO Double--foreign import stdcall "m1" m8  :: IO Int8-foreign import stdcall "m2" m16 :: IO Int16-foreign import stdcall "m3" m32 :: IO Int32-foreign import stdcall "m4" m64 :: IO Int64--foreign import stdcall "dynamic" d8  :: FunPtr (IO Int8) -> IO Int8-foreign import stdcall "dynamic" d16 :: FunPtr (IO Int16) -> IO Int16-foreign import stdcall "dynamic" d32 :: FunPtr (IO Int32) -> IO Int32-foreign import stdcall "dynamic" d64 :: FunPtr (IO Int64) -> IO Int64--foreign import ccall unsafe "safe_qd.h safe_qd_add" c_qd_add :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO ();--foreign import ccall unsafe "kitchen"-   sink :: Ptr a-        -> ByteArray#-        -> MutableByteArray# RealWorld-        -> Int-        -> Int8-        -> Int16-        -> Int32-        -> Int64-        -> Word8-        -> Word16-        -> Word32-        -> Word64-        -> Float-        -> Double-        -> IO ()---type Sink2 b = Ptr b-            -> ByteArray#-            -> MutableByteArray# RealWorld-            -> Int-            -> Int8-            -> Int16-            -> Int32-            -> Word8-            -> Word16-            -> Word32-            -> Float-            -> Double-            -> IO ()--foreign import ccall unsafe "dynamic"-  sink2 :: Ptr (Sink2 b) -> Sink2 b---- exports-foreign export ccall "plusInt" (+) :: Int -> Int -> Int--listToJSArray :: ToJSRef a => [a] -> IO (JSArray a)-listToJSArray = toJSArray deconstr-        where deconstr (x : xs) = Just (x, xs)-              deconstr [] = Nothing--foreign import javascript unsafe "$r = new Float32Array($1);"-        float32Array :: JSArray Float -> IO Float32Array--foreign import javascript unsafe "$r = new Int32Array($1);"-        int32Array :: JSArray Int32 -> IO Int32Array--foreign import javascript unsafe "$r = new Uint16Array($1);"-        uint16Array :: JSArray Word16 -> IO Uint16Array--foreign import javascript unsafe "$r = new Uint8Array($1);"-        uint8Array :: JSArray Word8 -> IO Uint8Array--foreign import javascript unsafe "$r = $1.getContext(\"webgl\");"-        getCtx :: JSRef a -> IO Ctx
− tests/examples/FromUtils.hs
@@ -1,28 +0,0 @@-{-# LANGUAGE TypeSynonymInstances #-}-{-# LANGUAGE FlexibleInstances #-}--import Data.Data----- -----------------------------------------------------------------------instance AnnotateP RdrName where-  annotateP l n = do-    case rdrName2String n of-      "[]" -> do-        addDeltaAnnotation AnnOpenS -- '['-        addDeltaAnnotation AnnCloseS -- ']'---- -----------------------------------------------------------------------class (Typeable ast) => AnnotateP ast where-  annotateP :: SrcSpan -> ast -> IO ()---type SrcSpan = Int-rdrName2String = undefined-type RdrName = String--data A = AnnOpenS | AnnCloseS--addDeltaAnnotation = undefined
− tests/examples/FunDeps.hs
@@ -1,7 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses  #-}-{-# LANGUAGE FunctionalDependencies #-}---- FunDeps example-class Foo a b c | a b -> c where-  bar :: a -> b -> c-
− tests/examples/FunctionalDeps.hs
@@ -1,19 +0,0 @@-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE FunctionalDependencies #-}---- from https://ocharles.org.uk/blog/posts/2014-12-14-functional-dependencies.html--import Data.Foldable (forM_)-import Data.IORef--class Store store m | store -> m where- new :: a -> m (store a)- get :: store a -> m a- put :: store a -> a -> m ()--instance Store IORef IO where-  new = newIORef-  get = readIORef-  put ioref a = modifyIORef ioref (const a)-
− tests/examples/GADTContext.hs
@@ -1,13 +0,0 @@-{-# LANGUAGE GADTs              #-}-{-# LANGUAGE RankNTypes         #-}-{-# LANGUAGE StandaloneDeriving #-}--data StackItem a where-  Snum :: forall a. Fractional a => a -> StackItem a-  Sop  :: OpDesc -> StackItem a-deriving instance Show a => Show (StackItem a)---- AZ added to test Trac #10399-data MaybeDefault v where-    SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v-    SetTo4 :: forall v a. (( Eq v, Show v ) => v -> MaybeDefault v -> a -> MaybeDefault [a])
− tests/examples/GADTRecords.hs
@@ -1,20 +0,0 @@-{-# LANGUAGE GADTs #-}-module GADTRecords (H1(..)) where---- | h1-data H1 a b where-  C1 :: H1 a b-  C2 :: Ord a => [a] -> H1 a a-  C3 :: { field :: Int -- ^ hello docs-        } -> H1 Int Int-  C4 :: { field2 :: a -- ^ hello2 docs-        } -> H1 Int a--  FwdDataflowAnalysis :: (Eq f, Monad m) => { analysisTop :: f-                                            , analysisMeet :: f -> f -> f-                                            , analysisTransfer :: f -> Instruction -> m f-                                            , analysisFwdEdgeTransfer :: Maybe (f -> Instruction -> m [(BasicBlock, f)])-                                            } -> DataflowAnalysis m f--data GADT :: * -> * where-      Ctor :: { gadtField :: A } -> GADT A
− tests/examples/GADTRecords2.hs
@@ -1,7 +0,0 @@-{-# LANGUAGE GADTs #-}-module GADTRecords2 (H1(..)) where---- | h1-data H1 a b where-  C3 :: (Num a) => { field :: a -- ^ hello docs-                   } -> H1 Int Int
− tests/examples/GHCOrig.hs
@@ -1,211 +0,0 @@-{-# LANGUAGE Trustworthy #-}-{-# LANGUAGE NoImplicitPrelude, DeriveGeneric #-}--------------------------------------------------------------------------------- |--- Module      :  GHC.Tuple--- Copyright   :  (c) The University of Glasgow 2001--- License     :  BSD-style (see the file libraries/ghc-prim/LICENSE)------ Maintainer  :  libraries@haskell.org--- Stability   :  experimental--- Portability :  non-portable (GHC extensions)------ The tuple data types-----------------------------------------------------------------------------------module GHC.Tuple where---default () -- Double and Integer aren't available yet---- | The unit datatype @()@ has one non-undefined member, the nullary--- constructor @()@.-data () = ()--data (,) a b = (,) a b-data (,,) a b c = (,,) a b c-data (,,,) a b c d = (,,,) a b c d-data (,,,,) a b c d e = (,,,,) a b c d e-data (,,,,,) a b c d e f = (,,,,,) a b c d e f-data (,,,,,,) a b c d e f g = (,,,,,,) a b c d e f g-data (,,,,,,,) a b c d e f g h = (,,,,,,,) a b c d e f g h-data (,,,,,,,,) a b c d e f g h i = (,,,,,,,,) a b c d e f g h i-data (,,,,,,,,,) a b c d e f g h i j = (,,,,,,,,,) a b c d e f g h i j-data (,,,,,,,,,,) a b c d e f g h i j k = (,,,,,,,,,,) a b c d e f g h i j k-data (,,,,,,,,,,,) a b c d e f g h i j k l = (,,,,,,,,,,,) a b c d e f g h i j k l-data (,,,,,,,,,,,,) a b c d e f g h i j k l m = (,,,,,,,,,,,,) a b c d e f g h i j k l m-data (,,,,,,,,,,,,,) a b c d e f g h i j k l m n = (,,,,,,,,,,,,,) a b c d e f g h i j k l m n-data (,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o = (,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o-data (,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p = (,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p-data (,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q- = (,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q-data (,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r- = (,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r-data (,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s- = (,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s-data (,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t- = (,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t-data (,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u- = (,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u-data (,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v- = (,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v-data (,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w- = (,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w-data (,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x- = (,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x-data (,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y- = (,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y-data (,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z- = (,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z-data (,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__--{- Manuel says: Including one more declaration gives a segmentation fault.-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___  u___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___ u___-data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___  u___ v___- = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___ u___ v___--}
− tests/examples/GenericDeriving.hs
@@ -1,41 +0,0 @@-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE FunctionalDependencies #-}-{-# LANGUAGE TypeOperators #-}-{-# LANGUAGE ViewPatterns #-}-import GHC.Generics---- from https://ocharles.org.uk/blog/posts/2014-12-16-derive-generic.html--data Valid e a = Error e | OK a-  deriving (Generic)--toEither :: Valid e a -> Either e a-toEither (Error e) = Left e-toEither (OK a) = Right a--fromEither :: Either e a -> Valid e a-fromEither (Left e) = Error e-fromEither (Right a) = OK a---- -----------------------------------------------------------------------class GetError rep e | rep -> e where-  getError' :: rep a -> Maybe e--instance GetError f e => GetError (M1 i c f) e where-  getError' (M1 m1) = getError' m1--instance GetError l e => GetError (l :+: r) e where-  getError' (L1 l) = getError' l-  getError' (R1 _) = Nothing--instance GetError (K1 i e) e where-  getError' (K1 e) = Just e--getError :: (Generic (errorLike e a), GetError (Rep (errorLike e a)) e) => errorLike e a -> Maybe e-getError = getError' . from-
− tests/examples/Guards.hs
@@ -1,6 +0,0 @@---f x | x > 0, x /= 10 = 1 / x-    | x == 0 = undefined-  where-    y = 4
− tests/examples/Hang.hs
@@ -1,1 +0,0 @@-(~>) = forall
− tests/examples/HangingRecord.hs
@@ -1,5 +0,0 @@--data Foo = Foo-  { r1 :: Int-  , r2 :: Int-  }
− tests/examples/HashQQ.hs
@@ -1,44 +0,0 @@-{-# LANGUAGE QuasiQuotes #-}-{-# LANGUAGE OverloadedStrings #-}--module Web.Maid.ApacheMimeTypes where---import qualified Data.Text as T-import Air.TH----apache_mime_types :: T.Text-apache_mime_types = [here|--# This file maps Internet media types to unique file extension(s).-# Although created for httpd, this file is used by many software systems-# and has been placed in the public domain for unlimited redisribution.-#-# The table below contains both registered and (common) unregistered types.-# A type that has no unique extension can be ignored -- they are listed-# here to guide configurations toward known types and to make it easier to-# identify "new" types.  File extensions are also commonly used to indicate-# content languages and encodings, so choose them carefully.-#-# Internet media types should be registered as described in RFC 4288.-# The registry is at .-#-# MIME type (lowercased)      Extensions-# ============================================  ==========-# application/1d-interleaved-parityfec-# application/3gpp-ims+xml-# application/activemessage-application/andrew-inset      ez |]---testComplex    = assertBool "" ([$istr|-        ok-#{Foo 4 "Great!" : [Foo 3 "Scott!"]}-        then-|] == ("\n" ++-    "        ok\n" ++-    "[Foo 4 \"Great!\",Foo 3 \"Scott!\"]\n" ++-    "        then\n"))-
− tests/examples/HsDo.hs
@@ -1,22 +0,0 @@-module HsDo where--import qualified Data.Map as Map--moduleGraphNodes drop_hs_boot_nodes summaries = (graphFromEdgedVertices nodes, lookup_node)-  where-    numbered_summaries = zip summaries [1..]--    node_map :: NodeMap SummaryNode-    node_map = Map.fromList [ ((moduleName (ms_mod s), ms_hsc_src s), node)-                            | node@(s, _, _) <- nodes ]---graphFromEdgedVertices = undefined-nodes = undefined-lookup_node = undefined-type NodeMap a = Map.Map (Int,Int) (Int,Int,Int)-data SummaryNode = SummaryNode-moduleName = undefined-ms_mod = undefined-ms_hsc_src = undefined-
− tests/examples/IfThenElse1.hs
@@ -1,7 +0,0 @@--- From http://lpaste.net/81623, courtesy of Albert Y. C. Lai-main = do-  cs <- if True-  then getLine-  else return "computer input"-  putStrLn cs-
− tests/examples/IfThenElse2.hs
@@ -1,5 +0,0 @@--- From http://lpaste.net/81623, courtesy of Albert Y. C. Lai-main = if True-then print 12-else print 42-
− tests/examples/IfThenElse3.hs
@@ -1,6 +0,0 @@--- From http://lpaste.net/81623, courtesy of Albert Y. C. Lai-main = do-  print 3-  if True then do-    print 5-    else print 7
− tests/examples/ImplicitParams.hs
@@ -1,41 +0,0 @@-{-# LANGUAGE ImplicitParams #-}---- From https://ocharles.org.uk/blog/posts/2014-12-11-implicit-params.html--import Data.Char---type LogFunction = String -> IO ()--type Present = String--queueNewChristmasPresents :: LogFunction -> [Present] -> IO ()-queueNewChristmasPresents logMessage presents = do-  mapM (logMessage . ("Queueing present for delivery: " ++)) presents-  return ()--queueNewChristmasPresents2 :: (?logMessage :: LogFunction) => [Present] -> IO ()-queueNewChristmasPresents2 presents = do-  mapM (?logMessage . ("Queueing present for delivery: " ++)) presents-  return ()---ex1 :: IO ()-ex1 =-  let ?logMessage = \t -> putStrLn ("[XMAS LOG]: " ++ t)-  in queueNewChristmasPresents2 ["Cuddly Lambda", "Gamma Christmas Pudding"]---ex2 :: IO ()-ex2 = do-  -- Specifies its own logger-  ex1--  -- We can locally define a new logging function-  let ?logMessage = \t -> putStrLn (zipWith (\i c -> if even i-                                                     then c-                                                     else toUpper c)-                                           [0..]-                                           t)-  queueNewChristmasPresents2 ["Category Theory Books"]-
− tests/examples/ImplicitSemi.hs
@@ -1,4 +0,0 @@-{-# LANGUAGE ImplicitParams #-}--explicit :: ((?above :: q, ?below :: a -> q) => b) -> q -> (a -> q) -> b-explicit x ab be = x where ?above = ab; ?below = be
− tests/examples/ImplicitTypeSyn.hs
@@ -1,17 +0,0 @@-{-# LANGUAGE ConstraintKinds #-}-{-# LANGUAGE EmptyDataDecls #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE ForeignFunctionInterface #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE ImplicitParams #-}-{-# LANGUAGE NamedFieldPuns #-}-{-# LANGUAGE RankNTypes #-}-{-# LANGUAGE RecordWildCards #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE TupleSections #-}-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE UnicodeSyntax #-}--type MPI = ?mpi_secret :: MPISecret
− tests/examples/Imports.hs
@@ -1,9 +0,0 @@-{-# LANGUAGE PatternSynonyms #-}-{-# LANGUAGE ExplicitNamespaces #-}-module Imports( f, type (+), pattern Single ) where--import GHC.TypeLits--pattern Single x = [x]--f = undefined
− tests/examples/ImportsSemi.hs
@@ -1,6 +0,0 @@-module ImportsSemi where-{-; ; ; ; ; ;-import Data.List-;;;-}
− tests/examples/IndentedDo.hs
@@ -1,12 +0,0 @@----foo =-  parseTestFile "gitlogo-double.ppm" "a multi-image file" $ do-      \res -> case res of-        Right ([ PPM { ppmHeader = h1 }-               , PPM { ppmHeader = h2 }], rest) -> do h1 `shouldBe` PPMHeader P6 220 92-                                                      h2 `shouldBe` PPMHeader P6 220 92-                                                      rest `shouldBe` Nothing-        Right r                                    -> assertFailure $ "parsed unexpected: " ++ show r-        Left e                                     -> assertFailure $ "did not parse: " ++ e
− tests/examples/Infix.hs
@@ -1,8 +0,0 @@--infix  3 &&&--(&&&) :: (Eq a) => [a] -> [a] -> [a]-(&&& ) [] [] =  []-xs  &&&   [] =  xs-(  &&&) [] ys =  ys-
− tests/examples/InfixOperator.hs
@@ -1,26 +0,0 @@-{-# LANGUAGE BangPatterns, CPP, OverloadedStrings #-}--#define BACKSLASH 92-#define CLOSE_CURLY 125-#define CLOSE_SQUARE 93-#define COMMA 44-#define DOUBLE_QUOTE 34-#define OPEN_CURLY 123-#define OPEN_SQUARE 91-#define C_0 48-#define C_9 57-#define C_A 65-#define C_F 70-#define C_a 97-#define C_f 102-#define C_n 110-#define C_t 116--json_ :: Parser Value -> Parser Value -> Parser Value-json_ obj ary = do-  w <- skipSpace *> A.satisfy (\w -> w == OPEN_CURLY || w == OPEN_SQUARE)-  if w == OPEN_CURLY-    then obj-    else ary-{-# INLINE json_ #-}-
− tests/examples/InfixOperator.hs.bad
@@ -1,26 +0,0 @@-{-# LANGUAGE BangPatterns, CPP, OverloadedStrings #-}------------------json_ :: Parser Value -> Parser Value -> Parser Value-json_ obj ary = do-  w <- skipSpace *> A.satisfy (\w -> w == 123 || w == 91)-  if w == 123-    then obj-    else ary-{-# INLINE json_ #-}-
− tests/examples/InfixPatternSynonyms.hs
@@ -1,18 +0,0 @@-{-# LANGUAGE PatternSynonyms #-}---- | The pattern synonym equivalent of 'destIff'.-pattern l :<=> r <- Comb (Comb (Const "=" (TyBool :-> TyBool :-> TyBool)) l) r---- | Destructor for boolean conjunctions.-destConj :: HOLTerm -> Maybe (HOLTerm, HOLTerm)-destConj = destBinary "/\\"---- | The pattern synonym equivalent of 'destConj'.-pattern l :/\ r <- Binary "/\\" l r---- | Destructor for boolean implications.-destImp :: HOLTerm -> Maybe (HOLTerm, HOLTerm)-destImp = destBinary "==>"---- | The pattern synonym equivalent of 'destImp'.-pattern l :==> r <- Binary "==>" l r
− tests/examples/InlineSemi.hs
@@ -1,1 +0,0 @@-{-# INLINE (|.) #-}; (|.)::Storable a=>Ptr a -> Int -> IO a         ; (|.) a i   = peekElemOff a i
− tests/examples/Internals.hs
@@ -1,427 +0,0 @@-{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses,-             CPP #-}-#if __GLASGOW_HASKELL__ >= 708-{-# LANGUAGE RoleAnnotations #-}-#endif--{-# OPTIONS_HADDOCK hide #-}--------------------------------------------------------------------------------- |--- Module      :  Data.Array.IO.Internal--- Copyright   :  (c) The University of Glasgow 2001-2012--- License     :  BSD-style (see the file libraries/base/LICENSE)------ Maintainer  :  libraries@haskell.org--- Stability   :  experimental--- Portability :  non-portable (uses Data.Array.Base)------ Mutable boxed and unboxed arrays in the IO monad.-----------------------------------------------------------------------------------module Data.Array.IO.Internals (-    IOArray(..),         -- instance of: Eq, Typeable-    IOUArray(..),        -- instance of: Eq, Typeable-    castIOUArray,        -- :: IOUArray ix a -> IO (IOUArray ix b)-    unsafeThawIOUArray,-  ) where--import Data.Int-import Data.Word-import Data.Typeable--import Control.Monad.ST         ( RealWorld, stToIO )-import Foreign.Ptr              ( Ptr, FunPtr )-import Foreign.StablePtr        ( StablePtr )--#if __GLASGOW_HASKELL__ < 711-import Data.Ix-#endif-import Data.Array.Base--import GHC.IOArray (IOArray(..))---------------------------------------------------------------------------------- Flat unboxed mutable arrays (IO monad)---- | Mutable, unboxed, strict arrays in the 'IO' monad.  The type--- arguments are as follows:------  * @i@: the index type of the array (should be an instance of 'Ix')------  * @e@: the element type of the array.  Only certain element types---    are supported: see "Data.Array.MArray" for a list of instances.----newtype IOUArray i e = IOUArray (STUArray RealWorld i e)-                       deriving Typeable-#if __GLASGOW_HASKELL__ >= 708--- Both parameters have class-based invariants. See also #9220.-type role IOUArray nominal nominal-#endif--instance Eq (IOUArray i e) where-    IOUArray s1 == IOUArray s2  =  s1 == s2--instance MArray IOUArray Bool IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Char IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Int IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Word IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray (Ptr a) IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray (FunPtr a) IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Float IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Double IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray (StablePtr a) IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Int8 IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Int16 IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Int32 IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Int64 IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Word8 IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Word16 IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Word32 IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)--instance MArray IOUArray Word64 IO where-    {-# INLINE getBounds #-}-    getBounds (IOUArray arr) = stToIO $ getBounds arr-    {-# INLINE getNumElements #-}-    getNumElements (IOUArray arr) = stToIO $ getNumElements arr-    {-# INLINE newArray #-}-    newArray lu initialValue = stToIO $ do-        marr <- newArray lu initialValue; return (IOUArray marr)-    {-# INLINE unsafeNewArray_ #-}-    unsafeNewArray_ lu = stToIO $ do-        marr <- unsafeNewArray_ lu; return (IOUArray marr)-    {-# INLINE newArray_ #-}-    newArray_ = unsafeNewArray_-    {-# INLINE unsafeRead #-}-    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)-    {-# INLINE unsafeWrite #-}-    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)---- | Casts an 'IOUArray' with one element type into one with a--- different element type.  All the elements of the resulting array--- are undefined (unless you know what you\'re doing...).-castIOUArray :: IOUArray ix a -> IO (IOUArray ix b)-castIOUArray (IOUArray marr) = stToIO $ do-    marr' <- castSTUArray marr-    return (IOUArray marr')--{-# INLINE unsafeThawIOUArray #-}-#if __GLASGOW_HASKELL__ >= 711-unsafeThawIOUArray :: UArray ix e -> IO (IOUArray ix e)-#else-unsafeThawIOUArray :: Ix ix => UArray ix e -> IO (IOUArray ix e)-#endif-unsafeThawIOUArray arr = stToIO $ do-    marr <- unsafeThawSTUArray arr-    return (IOUArray marr)--{-# RULES-"unsafeThaw/IOUArray" unsafeThaw = unsafeThawIOUArray-    #-}--#if __GLASGOW_HASKELL__ >= 711-thawIOUArray :: UArray ix e -> IO (IOUArray ix e)-#else-thawIOUArray :: Ix ix => UArray ix e -> IO (IOUArray ix e)-#endif-thawIOUArray arr = stToIO $ do-    marr <- thawSTUArray arr-    return (IOUArray marr)--{-# RULES-"thaw/IOUArray" thaw = thawIOUArray-    #-}--{-# INLINE unsafeFreezeIOUArray #-}-#if __GLASGOW_HASKELL__ >= 711-unsafeFreezeIOUArray :: IOUArray ix e -> IO (UArray ix e)-#else-unsafeFreezeIOUArray :: Ix ix => IOUArray ix e -> IO (UArray ix e)-#endif-unsafeFreezeIOUArray (IOUArray marr) = stToIO (unsafeFreezeSTUArray marr)--{-# RULES-"unsafeFreeze/IOUArray" unsafeFreeze = unsafeFreezeIOUArray-    #-}--#if __GLASGOW_HASKELL__ >= 711-freezeIOUArray :: IOUArray ix e -> IO (UArray ix e)-#else-freezeIOUArray :: Ix ix => IOUArray ix e -> IO (UArray ix e)-#endif-freezeIOUArray (IOUArray marr) = stToIO (freezeSTUArray marr)--{-# RULES-"freeze/IOUArray" freeze = freezeIOUArray-    #-}
− tests/examples/Jon.hs
@@ -1,4 +0,0 @@-{- ___ -}import Data.Char;main=putStr$do{c<-"/1 AA A A;9+ )11929 )1191A 2C9A ";e-{-  |  -}    .(`divMod`8).(+(-32)).ord$c};e(0,0)="\n";e(m,n)=m?"  "++n?"_/"-{-  |  -}n?x=do{[1..n];x}                                    --- obfuscated-{-\_/ on Fairbairn, with apologies to Chris Brown. Above is / Haskell 98 -}
− tests/examples/LambdaCase.hs
@@ -1,10 +0,0 @@-{-# LANGUAGE LambdaCase #-}--foo = f >>= \case-        Just h -> loadTestDB (h ++ "/.testdb")-        Nothing -> fmap S.Right initTestDB--{-| Is the alarm set - i.e. will it go off at some point in the future even if `setAlarm` is not called? -}-isAlarmSetSTM :: AlarmClock -> STM Bool-isAlarmSetSTM AlarmClock{..} = readTVar acNewSetting-  >>= \case { AlarmNotSet -> readTVar acIsSet; _ -> return True }
− tests/examples/LayoutIn1.hs
@@ -1,9 +0,0 @@-module LayoutIn1 where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'sq' to 'square'.--sumSquares x y= sq x + sq y where sq x= x^pow-  --There is a comment.-                                  pow=2
− tests/examples/LayoutIn1.hs.expected
@@ -1,9 +0,0 @@-module LayoutIn1 where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'sq' to 'square'.--sumSquares x y= square x + square y where sq x= x^pow-          --There is a comment.-                                          pow=2
− tests/examples/LayoutIn3.hs
@@ -1,13 +0,0 @@-module LayoutIn3 where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'x' after 'let'  to 'anotherX'.--foo x = let x = 12 in (let y = 3-                           z = 2 in x * y * z * w) where   y = 2-                                                           --there is a comment.-                                                           w = x-                                                             where-                                                               x = let y = 5 in y + 3-
− tests/examples/LayoutIn3.hs.expected
@@ -1,13 +0,0 @@-module LayoutIn3 where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'x' after 'let'  to 'anotherX'.--foo x = let anotherX = 12 in (let y = 3-                                  z = 2 in anotherX * y * z * w) where   y = 2-                                                                         --there is a comment.-                                                                         w = x-                                                                           where-                                                                             x = let y = 5 in y + 3-
− tests/examples/LayoutIn3a.hs
@@ -1,13 +0,0 @@-module LayoutIn3a where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'x' after 'let'  to 'anotherX'.--foo x = let x = 12 in (-                                    x            ) where   y = 2-                                                           --there is a comment.-                                                           w = x-                                                             where-                                                               x = let y = 5 in y + 3-
− tests/examples/LayoutIn3a.hs.expected
@@ -1,13 +0,0 @@-module LayoutIn3a where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'x' after 'let'  to 'anotherX'.--foo x = let anotherX = 12 in (-                                    anotherX            ) where   y = 2-                                                                  --there is a comment.-                                                                  w = x-                                                                    where-                                                                      x = let y = 5 in y + 3-
− tests/examples/LayoutIn3b.hs
@@ -1,12 +0,0 @@-module LayoutIn3b where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'x' after 'let'  to 'anotherX'.--foo x = let x = 12 in (             x            ) where   y = 2-                                                           --there is a comment.-                                                           w = x-                                                             where-                                                               x = let y = 5 in y + 3-
− tests/examples/LayoutIn3b.hs.expected
@@ -1,12 +0,0 @@-module LayoutIn3b where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'x' after 'let'  to 'anotherX'.--foo x = let anotherX = 12 in (             anotherX            ) where   y = 2-                                                                         --there is a comment.-                                                                         w = x-                                                                           where-                                                                             x = let y = 5 in y + 3-
− tests/examples/LayoutIn4.hs
@@ -1,13 +0,0 @@-module LayoutIn4 where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'ioFun' to  'io'--main = ioFun "hello" where ioFun s= do  let  k = reverse s- --There is a comment-                                        s <- getLine-                                        let  q = (k ++ s)-                                        putStr q-                                        putStr "foo"-
− tests/examples/LayoutIn4.hs.expected
@@ -1,13 +0,0 @@-module LayoutIn4 where----Layout rule applies after 'where','let','do' and 'of'----In this Example: rename 'ioFun' to  'io'--main = io "hello" where io s= do  let  k = reverse s---There is a comment-                                  s <- getLine-                                  let  q = (k ++ s)-                                  putStr q-                                  putStr "foo"-
− tests/examples/LayoutLet.hs
@@ -1,7 +0,0 @@--foo x =-  let-    a = 1-    b = 2-  in x + a + b-
− tests/examples/LayoutLet2.hs
@@ -1,9 +0,0 @@-module LayoutLet2 where---- Simple let expression, rename xxx to something longer or shorter--- and the let/in layout should adjust accordingly--- In this case the tokens for xxx + a + b should also shift out--foo xxx = let a = 1-              b = 2 in xxx + a + b-
− tests/examples/LayoutLet2.hs.expected
@@ -1,9 +0,0 @@-module LayoutLet2 where---- Simple let expression, rename xxx to something longer or shorter--- and the let/in layout should adjust accordingly--- In this case the tokens for xxx + a + b should also shift out--foo xxxlonger = let a = 1-                    b = 2 in xxxlonger + a + b-
− tests/examples/LayoutLet3.hs
@@ -1,10 +0,0 @@-module LayoutLet3 where---- Simple let expression, rename xxx to something longer or shorter--- and the let/in layout should adjust accordingly--- In this case the tokens for xxx + a + b should also shift out--foo xxx = let a = 1-              b = 2-          in xxx + a + b-
− tests/examples/LayoutLet3.hs.expected
@@ -1,10 +0,0 @@-module LayoutLet3 where---- Simple let expression, rename xxx to something longer or shorter--- and the let/in layout should adjust accordingly--- In this case the tokens for xxx + a + b should also shift out--foo xxxlonger = let a = 1-                    b = 2-                in xxxlonger + a + b-
− tests/examples/LayoutLet4.hs
@@ -1,11 +0,0 @@-module LayoutLet4 where---- Simple let expression, rename xxx to something longer or shorter--- and the let/in layout should adjust accordingly--- In this case the tokens for xxx + a + b should also shift out--foo xxx = let a = 1-              b = 2-          in xxx + a + b--bar = 3
− tests/examples/LayoutLet4.hs.expected
@@ -1,11 +0,0 @@-module LayoutLet4 where---- Simple let expression, rename xxx to something longer or shorter--- and the let/in layout should adjust accordingly--- In this case the tokens for xxx + a + b should also shift out--foo xxxlonger = let a = 1-                    b = 2-                in xxxlonger + a + b--bar = 3
− tests/examples/LayoutLet5.hs
@@ -1,11 +0,0 @@-module LayoutLet5 where---- Simple let expression, rename xxx to something longer or shorter--- and the let/in layout should adjust accordingly--- In this case the tokens for xxx + a + b should also shift out--foo xxx = let a = 1-              b = 2-          in xxx + a + b--bar = 3
− tests/examples/LayoutLet5.hs.expected
@@ -1,11 +0,0 @@-module LayoutLet5 where---- Simple let expression, rename xxx to something longer or shorter--- and the let/in layout should adjust accordingly--- In this case the tokens for xxx + a + b should also shift out--foo x = let a = 1-            b = 2-        in x + a + b--bar = 3
− tests/examples/LayoutWhere.hs
@@ -1,6 +0,0 @@--foo x = r-  where-    a = 3-    b = 4-    r = a + a + b
− tests/examples/LetExpr.hs
@@ -1,63 +0,0 @@-{-# LANGUAGE PatternSynonyms #-}-{-# Language DeriveFoldable #-}-{-# LANGUAGE Safe #-}-{-# options_ghc -w #-}---- | A simple let expression, to ensure the layout is detected--- With some haddock in the top-{- And a normal-   multiline comment too -}-  module {- brah -}  LetExpr        ( foo -- foo does ..-                                    , bar -- bar does ..-                                    , Baz () -- baz does ..-                                 , Ba   ( ..),Ca(Cc,Cd)   ,-                                     bbb ,  aaa-                                  , module  Data.List-                                    , pattern  Bar-                                    )-    where--import Data.List--- A comment in the middle-import {-# SOURCE #-} BootImport ( Foo(..) )-import {-# SoURCE  #-} safe   qualified  BootImport   as    BI-import qualified Data.Map as {- blah -}  Foo.Map--import Control.Monad  (   )-import Data.Word (Word8)-import Data.Tree hiding  (  drawTree   )--import qualified Data.Maybe as M hiding    ( maybe  , isJust  )----- comment-foo = let x = 1-          y = 2-      in x + y--bar = 3-bbb x- | x == 1 = ()- | otherwise = ()---aaa [ ] _   = 0-aaa x  _unk = 1--aba () = 0--x `ccc` 1 = x + 1-x `ccc` y = x + y--x !@# y = x + y--data Baz = Baz1 | Baz2--data Ba = Ba | Bb--data Ca = Cc | Cd--pattern Foo a <- RealFoo a-pattern Bar a <- RealBar a--data Thing = RealFoo Thing | RealBar Int
− tests/examples/LetExpr2.hs
@@ -1,4 +0,0 @@-l z =-  let-    ll = 34-  in ll + z
− tests/examples/LetExprSemi.hs
@@ -1,64 +0,0 @@-{-# LANGUAGE PatternSynonyms #-}-{-# Language DeriveFoldable #-}-{-# LANGUAGE Safe #-}-{-# options_ghc -w #-}---- | A simple let expression, to ensure the layout is detected--- With some haddock in the top-{- And a normal-   multiline comment too -}-  module {- brah -}  LetExprSemi    ( foo -- foo does ..-                                    , bar -- bar does ..-                                    , Baz () -- baz does ..-                                 , Ba   ( ..),Ca(Cc,Cd)   ,-                                     bbb ,  aaa-                                  , module  Data.List-                                    , pattern  Bar-                                    )-    where-{-import Data.List--- A comment in the middle-; import {-# SOURCE #-} BootImport ( Foo(..) ) ;-import {-# SOURCE  #-} safe   qualified  BootImport   as    BI-;;; import qualified Data.Map as {- blah -}  Foo.Map;--import Control.Monad  (   )  ;-import Data.Word (Word8);-import Data.Tree hiding  (  drawTree   ) ;--  ; import qualified Data.Maybe as M hiding    ( maybe  , isJust  )-;---- comment-foo = let x = 1-          y = 2-      in x + y-;-bar = 3;-bbb x- | x == 1 = ()- | otherwise = ()--;-aaa [] _    = 0;-aaa x  _unk = 1-;-x `ccc` 1 = x + 1;-x `ccc` y = x + y-;-x !@# y = x + y-;-data Baz = Baz1 | Baz2-;-data Ba = Ba | Bb-;-data Ca = Cc | Cd-;-pattern Foo a <- RealFoo a ;-pattern Bar a <- RealBar a-;-data Thing = RealFoo Thing | RealBar Int-}--
− tests/examples/LetIn1.hs
@@ -1,19 +0,0 @@-module LetIn1 where----A definition can be demoted to the local 'where' binding of a friend declaration,---if it is only used by this friend declaration.----Demoting a definition narrows down the scope of the definition.---In this example, demote the local  'pow' to 'sq'---This example also aims to test the demoting a local declaration in 'let'.--sumSquares x y = let sq 0=0-                     sq z=z^pow-                     pow=2-                 in sq x + sq y---anotherFun 0 y = sq y-     where  sq x = x^2--
− tests/examples/LetIn1.hs.expected
@@ -1,18 +0,0 @@-module LetIn1 where----A definition can be demoted to the local 'where' binding of a friend declaration,---if it is only used by this friend declaration.----Demoting a definition narrows down the scope of the definition.---In this example, demote the local  'pow' to 'sq'---This example also aims to test the demoting a local declaration in 'let'.--sumSquares x y = let sq 0=0-                     sq z=z^pow-                 in sq x + sq y---anotherFun 0 y = sq y-     where  sq x = x^2--
− tests/examples/LetStmt.hs
@@ -1,9 +0,0 @@--- A simple let statement, to ensure the layout is detected--module Layout.LetStmt where--foo = do-{- ffo -}let x = 1-             y = 2 -- baz-         x+y-
− tests/examples/LiftedConstructors.hs
@@ -1,25 +0,0 @@-{-# LANGUAGE DataKinds, TypeOperators, GADTs #-}--give :: b -> Pattern '[b] a-give b = Pattern (const (Just $ oneT b))---pfail :: Pattern '[] a-pfail = is (const False)--(/\) :: Pattern vs1 a -> Pattern vs2 a -> Pattern (vs1 :++: vs2) a-(/\) = mk2 (\a -> Just (a,a))--data Pattern :: [*] -> * where-  Nil :: Pattern '[]-  Cons :: Maybe h -> Pattern t -> Pattern (h ': t)--type Pos = '("vpos", V3 GLfloat)-type Tag = '("tagByte", V1 Word8)---- | Alias for the 'In' type from the 'Direction' kind, allows users to write--- the 'BroadcastChan In a' type without enabling DataKinds.-type In = 'In--- | Alias for the 'Out' type from the 'Direction' kind, allows users to write--- the 'BroadcastChan Out a' type without enabling DataKinds.-type Out = 'Out
− tests/examples/LiftedInfixConstructor.hs
@@ -1,12 +0,0 @@-{-# LANGUAGE DataKinds, TemplateHaskell #-}--applicate :: Bool -> [Stmt] -> ExpQ-applicate rawPatterns stmt = do-    return $ foldl (\g e -> VarE '(<**>) `AppE` e `AppE` g)-                    (VarE 'pure `AppE` f')-                    es--tuple :: Int -> ExpQ-tuple n = do-    ns <- replicateM n (newName "x")-    lamE [foldr (\x y -> conP '(:) [varP x,y]) wildP ns] (tupE $ map varE ns)
− tests/examples/LinePragma.hs
@@ -1,36 +0,0 @@-module UHC.Light.Compiler.Core.SysF.AsTy-( Ty-, ty2TySysfWithEnv, ty2TyC-, ty2TyCforFFI )-where-import UHC.Light.Compiler.Base.Common-import UHC.Light.Compiler.Opts.Base-import UHC.Light.Compiler.Error-import qualified UHC.Light.Compiler.Core as C-import qualified UHC.Light.Compiler.Ty as T-import UHC.Light.Compiler.FinalEnv--{-# LINE 50 "src/ehc/Core/SysF/AsTy.chs" #-}--- | The type, represented by a term CExpr-type Ty             = C.SysfTy          -- base ty---- | Binding the bound-type TyBind         = C.SysfTyBind-type TyBound        = C.SysfTyBound---- | A sequence of parameters (for now just a single type)-type TySeq          = C.SysfTySeq---{-# LINE 67 "src/ehc/Core/SysF/AsTy.chs" #-}-ty2TySysfWithEnv :: ToSysfEnv -> T.Ty -> Ty-ty2TySysfWithEnv _   t =                                                     t---- | Construct a type for use by AbstractCore-ty2TyC :: EHCOpts -> ToSysfEnv -> T.Ty -> C.CTy-ty2TyC o env t = C.mkCTy o t (ty2TySysfWithEnv env t)--{-# LINE 93 "src/ehc/Core/SysF/AsTy.chs" #-}--- | Construct a type for use by AbstractCore, specifically for use by FFI-ty2TyCforFFI :: EHCOpts -> T.Ty -> C.CTy-ty2TyCforFFI o t = C.mkCTy o t                                t
− tests/examples/ListComprehensions.hs
@@ -1,99 +0,0 @@-{-# LANGUAGE ParallelListComp,-             TransformListComp,-             RecordWildCards #-}---             MonadComprehensions,---- From https://ocharles.org.uk/blog/guest-posts/2014-12-07-list-comprehensions.html--import GHC.Exts-import qualified Data.Map as M-import Data.Ord (comparing)-import Data.List (sortBy)---- Let’s look at a simple, normal list comprehension to start:--regularListComp :: [Int]-regularListComp = [ x + y * z-                  | x <- [0..10]-                  , y <- [10..20]-                  , z <- [20..30]-                  ]--parallelListComp :: [Int]-parallelListComp = [ x + y * z-                   | x <- [0..10]-                   | y <- [10..20]-                   | z <- [20..30]-                   ]---- fibs :: [Int]--- fibs = 0 : 1 : zipWith (+) fibs (tail fibs)--fibs :: [Int]-fibs = 0 : 1 : [ x + y-               | x <- fibs-               | y <- tail fibs-               ]--fiblikes :: [Int]-fiblikes = 0 : 1 : [ x + y + z-                   | x <- fibs-                   | y <- tail fibs-                   | z <- tail (tail fibs)-                   ]---- TransformListComp-data Character = Character-  { firstName :: String-  , lastName :: String-  , birthYear :: Int-  } deriving (Show, Eq)--friends :: [Character]-friends = [ Character "Phoebe" "Buffay" 1963-          , Character "Chandler" "Bing" 1969-          , Character "Rachel" "Green" 1969-          , Character "Joey" "Tribbiani" 1967-          , Character "Monica" "Geller" 1964-          , Character "Ross" "Geller" 1966-          ]--oldest :: Int -> [Character] -> [String]-oldest k tbl = [ firstName ++ " " ++ lastName-               | Character{..} <- tbl-               , then sortWith by birthYear-               , then take k-               ]--groupByLargest :: Ord b => (a -> b) -> [a] -> [[a]]-groupByLargest f = sortBy (comparing (negate . length)) . groupWith f--bestBirthYears :: [Character] -> [(Int, [String])]-bestBirthYears tbl = [ (the birthYear, firstName)-                     | Character{..} <- tbl-                     , then group by birthYear using groupByLargest-                     ]--uniq_fs = [ (n, the p, the d') | (n, Fixity p d) <- fs-                                   , let d' = ppDir d-                                   , then group by Down (p,d') using groupWith ]--legendres :: [Poly Rational]-legendres = one : x :-    [ multPoly-        (poly LE [recip (n' + 1)])-        (addPoly (poly LE [0, 2 * n' + 1] `multPoly` p_n)-                 (poly LE           [-n'] `multPoly` p_nm1)-        )-    | n     <- [1..], let n' = fromInteger n-    | p_n   <- tail legendres-    | p_nm1 <- legendres-    ]--fromGroups' :: (Ord k) => a -> [a] -> Maybe (W.Stack k) -> Groups k -> [a]-                    -> [(Bool,(a, W.Stack k))]-fromGroups' defl defls st gs sls =-    [ (isNew,fromMaybe2 (dl, single w) (l, M.lookup w gs))-        | l <- map Just sls ++ repeat Nothing, let isNew = isNothing l-        | dl <- defls ++ repeat defl-        | w <- W.integrate' $ W.filter (`notElem` unfocs) =<< st ]
− tests/examples/LocToName.hs
@@ -1,24 +0,0 @@-module LocToName where--{-----------}--------sumSquares (x:xs) = x ^2 + sumSquares xs-    -- where sq x = x ^pow -    --       pow = 2--sumSquares [] = 0
− tests/examples/LocToName.hs.expected
@@ -1,24 +0,0 @@-module LocToName where--{-----------}--------LocToName.newPoint (x:xs) = x ^2 + LocToName.newPoint xs-    -- where sq x = x ^pow -    --       pow = 2--LocToName.newPoint [] = 0
− tests/examples/LocalDecls.hs
@@ -1,8 +0,0 @@-module LocalDecls where--foo a = bar a-  where-    bar :: Int -> Int-    bar x = x + 2--    baz = 4
− tests/examples/LocalDecls.hs.expected
@@ -1,11 +0,0 @@-module LocalDecls where--foo a = bar a-  where-    nn :: Int-    nn = 2--    bar :: Int -> Int-    bar x = x + 2--    baz = 4
− tests/examples/LocalDecls2.hs
@@ -1,3 +0,0 @@-module LocalDecls2 where--foo a = bar a
− tests/examples/LocalDecls2.hs.expected
@@ -1,6 +0,0 @@-module LocalDecls2 where--foo a = bar a-  where-    nn :: Int-    nn = 2
− tests/examples/LocalDecls2Expected.hs
@@ -1,6 +0,0 @@-module LocalDecls2Expected where--foo a = bar a-  where-    nn :: Int-    nn = 2
− tests/examples/MagicHash.hs
@@ -1,29 +0,0 @@-{-# LANGUAGE MagicHash #-}--module Data.Text.Internal.Builder.Functions-    (-      (<>)-    , i2d-    ) where--import Data.Monoid (mappend)-import Data.Text.Lazy.Builder (Builder)-import GHC.Base---- | Unsafe conversion for decimal digits.-{-# INLINE i2d #-}-i2d :: Int -> Char-i2d (I# i#) = C# (chr# (ord# '0'# +# i#))--main =-  print (F# (expFloat# 3.45#))---- | The normal 'mappend' function with right associativity instead of--- left.-(<>) :: Builder -> Builder -> Builder-(<>) = mappend-{-# INLINE (<>) #-}--infixr 4 <>--
− tests/examples/MangledSemiLet.hs
@@ -1,10 +0,0 @@-{-# LANGUAGE-    BangPatterns-  #-}---mtGamma a b =-  let !x_2 = x*x; !x_4 = x_2*x_2-      v3 = v*v*v-      dv = d * v3-  in 5
− tests/examples/Minimal.hs
@@ -1,37 +0,0 @@-class AwsType a where-    toText :: a -> b---    {-# MINIMAL toText #-}--class Minimal a where-  toText :: a -> b-  {-# MINIMAL decimal, hexadecimal, realFloat, scientific #-}--class Minimal a where-  toText :: a -> b-  {-# MINIMAL shape, (maskedIndex | maskedLinearIndex) #-}--class Minimal a where-  toText :: a -> b-  {-# MINIMAL (toSample | toSamples) #-}--class ManyOps a where-    aOp :: a -> a -> Bool-    bOp :: a -> a -> Bool-    cOp :: a -> a -> Bool-    dOp :: a -> a -> Bool-    eOp :: a -> a -> Bool-    fOp :: a -> a -> Bool-    {-# MINIMAL  ( aOp)-               | ( bOp   , cOp)-               | ((dOp  |  eOp) , fOp)-      #-}--class Foo a where-    bar :: a -> a -> Bool-    foo :: a -> a -> Bool-    baq :: a -> a -> Bool-    baz :: a -> a -> Bool-    quux :: a -> a -> Bool-    {-# MINIMAL bar, (foo, baq | foo, quux) #-}
− tests/examples/Mixed.hs
@@ -1,48 +0,0 @@--import Data.List  ()-import Data.List  hiding ()--infixl 1 `f`--- infixr 2 `\\\`-infix  3 :==>-infix  4 `MkFoo`--data Foo = MkFoo Int | Float :==> Double--x `f` y = x--(\\\) :: (Eq a) => [a] -> [a] -> [a]-(\\\) xs ys =  xs--g x = x + if True then 1 else 2-h x = x + 1::Int--{-# SPECIALISe j :: Int -> Int #-}-j n = n + 1--test = let k x y = x+y in 1 `k` 2 `k` 3--data Rec = (:<-:) { a :: Int, b :: Float }--ng1 x y = negate y--instance (Num a, Num b) => Num (a,b)-  where-   negate (a,b) = (ng 'c' a, ng1 'c' b)   where  ng x y = negate y----class Foo1 a where--class Foz a--x = 2 where-y = 3--instance Foo1 Int where--ff = ff where g = g where-type T = Int---
− tests/examples/MonadComprehensions.hs
@@ -1,33 +0,0 @@-{-# LANGUAGE ParallelListComp,-             TransformListComp,-             RecordWildCards #-}-{-# LANGUAGE MonadComprehensions #-}---- From https://ocharles.org.uk/blog/guest-posts/2014-12-07-list-comprehensions.html--import GHC.Exts-import qualified Data.Map as M-import Data.Ord (comparing)-import Data.List (sortBy)----- Monad Comprehensions--sqrts :: M.Map Int Int-sqrts = M.fromList $ [ (x, sx)-                     | x  <- map (^2) [1..100]-                     | sx <- [1..100]-                     ]--sumIntSqrts :: Int -> Int -> Maybe Int-sumIntSqrts a b = [ x + y-                  | x <- M.lookup a sqrts-                  , y <- M.lookup b sqrts-                  ]--greet :: IO String-greet = [ name-        | name <- getLine-        , _ <- putStrLn $ unwords ["Hello, ", name, "!"]-        ]-
− tests/examples/Move1.hs
@@ -1,53 +0,0 @@-module Move1 where--data Located a = L Int a-type Name = String-hsBinds = undefined-divideDecls = undefined-definingDeclsNames = undefined-nub = undefined-definedPNs :: a -> [b]-definedPNs = undefined-logm = undefined-showGhc = undefined-pnsNeedRenaming = undefined-concatMap1 = undefined---- liftToTopLevel' :: ModuleName -- -> (ParseResult,[PosToken]) -> FilePath---                 -> Located Name---                 -> RefactGhc [a]-liftToTopLevel' :: Int -> Located Name -> IO [a]-liftToTopLevel' modName pn@(L _ n) = do-  liftToMod-  return []-    where-          {-step1: divide the module's top level declaration list into three parts:-            'parent' is the top level declaration containing the lifted declaration,-            'before' and `after` are those declarations before and after 'parent'.-            step2: get the declarations to be lifted from parent, bind it to liftedDecls -            step3: remove the lifted declarations from parent and extra arguments may be introduce.-            step4. test whether there are any names need to be renamed.-          -}-       liftToMod :: IO ()-       liftToMod = do-                      -- renamed <- getRefactRenamed-                      let renamed = undefined-                      let declsr = hsBinds renamed-                      let (before,parent,after) = divideDecls declsr pn-                      -- error ("liftToMod:(before,parent,after)=" ++ (showGhc (before,parent,after))) -- ++AZ++-                      {- ++AZ++ : hsBinds does not return class or instance definitions-                      when (isClassDecl $ ghead "liftToMod" parent)-                            $ error "Sorry, the refactorer cannot lift a definition from a class declaration!"-                      when (isInstDecl $ ghead "liftToMod" parent)-                            $ error "Sorry, the refactorer cannot lift a definition from an instance declaration!"-                      -}-                      let liftedDecls = definingDeclsNames [n] parent True True-                          declaredPns = nub $ concatMap1 definedPNs liftedDecls--                      -- TODO: what about declarations between this-                      -- one and the top level that are used in this one?--                      logm $ "liftToMod:(liftedDecls,declaredPns)=" ++ (showGhc (liftedDecls,declaredPns))-                      -- original : pns<-pnsNeedRenaming inscps mod parent liftedDecls declaredPns-                      -- pns <- pnsNeedRenaming renamed parent liftedDecls declaredPns-                      return ()
− tests/examples/MultiImplicitParams.hs
@@ -1,7 +0,0 @@-{-# LANGUAGE ImplicitParams #-}--foo = do-  ev <- let ?mousePosition = relative<$>Reactive (Size 1 1) _size<|*>_mousePos-            ?buttonChanges = _button-        in sink-  return baz
− tests/examples/MultiLineCommentWithPragmas.hs
@@ -1,18 +0,0 @@--{---- this is ugly too: can't use Data.Complex because the qd bindings do--- not implement some low-level functions properly, leading to obscure--- crashes inside various Data.Complex functions...-data Complex c = {-# UNPACK #-} !c :+ {-# UNPACK #-} !c deriving (Read, Show, Eq)---- complex number arithmetic, with extra strictness and cost-centres-instance Num c => Num (Complex c) where-  (!(a :+ b)) + (!(c :+ d)) = {-# SCC "C+" #-} ((a + c) :+ (b + d))-  (!(a :+ b)) - (!(c :+ d)) = {-# SCC "C-" #-} ((a - c) :+ (b - d))-  (!(a :+ b)) * (!(c :+ d)) = {-# SCC "C*" #-} ((a * c - b * d) :+ (a * d + b * c))-  negate !(a :+ b) = (-a) :+ (-b)-  abs x = error $ "Complex.abs: " ++ show x-  signum x = error $ "Complex.signum: " ++ show x-  fromInteger !x = fromInteger x :+ 0--}-
− tests/examples/MultiLineWarningPragma.hs
@@ -1,18 +0,0 @@--{-# WARNING Logic-          , mkSolver-          , mkSimpleSolver-          , mkSolverForLogic-          , solverSetParams-          , solverPush-          , solverPop-          , solverReset-          , solverGetNumScopes-          , solverAssertCnstr-          , solverAssertAndTrack-          , solverCheck-          , solverCheckAndGetModel-          , solverGetReasonUnknown-          "New Z3 API support is still incomplete and fragile: \-          \you may experience segmentation faults!"-  #-}
− tests/examples/MultiLineWarningPragma.hs.bad
@@ -1,17 +0,0 @@--{-# WARNING Logic-          , mkSolver-          , mkSimpleSolver-          , mkSolverForLogic-          , solverSetParams-          , solverPush-          , solverPop-          , solverReset-          , solverGetNumScopes-          , solverAssertCnstr-          , solverAssertAndTrack-          , solverCheck-          , solverCheckAndGetModel-          , solverGetReasonUnknown-          "New Z3 API support is still incomplete and fragile: you may experience segmentation faults!"-  #-}
− tests/examples/MultiParamTypeClasses.hs
@@ -1,32 +0,0 @@-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}---- From https://ocharles.org.uk/blog/posts/2014-12-13-multi-param-type-classes.html--import Control.Monad.Trans.Class (lift)-import Control.Monad.Trans.Reader (ReaderT)-import Data.Foldable (forM_)-import Data.IORef--class Store store m where- new :: a -> m (store a)- get :: store a -> m a- put :: store a -> a -> m ()--type Present = String-storePresents :: (Store store m, Monad m) => [Present] -> m (store [Present])-storePresents xs = do-  store <- new []-  forM_ xs $ \x -> do-    old <- get store-    put store (x : old)-  return store--instance Store IORef IO where-  new = newIORef-  get = readIORef-  put ioref a = modifyIORef ioref (const a)---- ex ps = do---   store <- storePresents ps---   get (store :: IORef [Present])
− tests/examples/MultiWayIf.hs
@@ -1,11 +0,0 @@-{-# LANGUAGE MultiWayIf #-}---instance Animatable Double where-    interpolate ease from to t =-        if | t <= 0 -> from-           | t >= 1 -> to-           | otherwise -> from + easeDouble ease t * (to - from)-    animAdd = (+)-    animSub = (-)-    animZero = 0
− tests/examples/MultipleInferredContexts.hs
@@ -1,4 +0,0 @@-{-# LANGUAGE PartialTypeSignatures #-}--f :: (Eq a, _, _) => a -> a -> Bool-f x y = x == y
− tests/examples/NestedDoLambda.hs
@@ -1,31 +0,0 @@-{-# LANGUAGE Arrows #-}--operator = describe "Operators on ProcessA"$-  do-    describe "feedback" $-      do-        it "acts like local variable with hold." $-          do-            let-                pa = proc evx ->-                  do-                    (\evy -> hold 10 -< evy)-                      `feedback` \y ->-                      do-                        returnA -< ((+y) <$> evx, (y+1) <$ evx)-            run pa [1, 2, 3] `shouldBe` [11, 13, 15]--        it "correctly handles stream end." $-          do-            let-                pa = proc x ->-                    (\asx -> returnA -< asx)-                  `feedback`-                    (\asy -> returnA -< (asy::Event Int, x))-                comp = mkProc (PgPush PgStop) >>> pa-            stateProc comp [0, 0] `shouldBe` ([], [0])--        it "correctly handles stream end.(2)" $-          do-            pendingWith "now many utilities behave incorrectly at the end of stream."-
− tests/examples/NestedLambda.hs
@@ -1,8 +0,0 @@----getPath :: [String] -> Filter-getPath names elms =-  let follow = foldl (\f n -> \els-> subElems n $ f els) id' names :: Filter-      id' = id :: Filter-  in  follow elms
− tests/examples/NullaryTypeClasses.hs
@@ -1,16 +0,0 @@-{-# LANGUAGE NullaryTypeClasses #-}---- From https://ocharles.org.uk/blog/posts/2014-12-10-nullary-type-classes.html--class Logger where-  logMessage :: String -> IO ()--type Present = String-queueNewChristmasPresents :: Logger => [Present] -> IO ()-queueNewChristmasPresents presents = do-  mapM (logMessage . ("Queueing present for delivery: " ++)) presents-  return ()--instance Logger where-  logMessage t = putStrLn ("[XMAS LOG]: " ++ t)-
− tests/examples/Obscure.hs
@@ -1,29 +0,0 @@-type A = Integer-data B = B { u :: !B, j :: B, r :: !A, i :: [A] } | Y-c=head-k=tail-b x y=x(y)y-n=map(snd)h-m=2:3:5:[7]-f=s(flip(a))t-s x y z=x(y(z))-e=filter(v)[2..221]-z=s(s(s((s)b)(s(s)flip)))s-main=mapM_(print)(m++map(fst)h)-v=s(flip(all)m)(s((.)(/=0))mod)-t=(s(s(s(b))flip)((s)s))(s(B(Y)Y)c)k-g=z(:)(z(,)c(b(s((s)map(*))c)))(s(g)k)-h=c(q):c(k(q)):d(p(t((c)n))(k(n)))(k((k)q))-q=g(scanl1(+)(11:cycle(zipWith(-)((k)e)e)))-a x Y = x-a Y x = x-a x y = case compare((r)x)(r(y)) of-  GT -> a(y)x-  _  -> B(a((j)x)y)(u(x))((r)x)(i(x))-p x y = case compare((r)x)(c(c(y))) of-  GT -> p(f((c)y)x)(k(y))-  _  -> r(x):p(f((i)x)(a(u(x))(j(x))))y-d x y = case compare((c)x)(fst(c(y))) of-  GT -> c(y):(d)x((k)y)-  LT -> d(k(x))y-  EQ -> d((k)x)(k(y))
− tests/examples/OptSig.hs
@@ -1,18 +0,0 @@-{-# LANGUAGE ScopedTypeVariables #-}--errors= do-  let ls :: [[String ]]= runR  readp $ pack "[" `append` (B.tail log) `append` pack "]"-  return ()---- This can be seen as the definition of accumFilter-accumFilter2 :: (c -> a -> (c, Maybe b)) -> c -> SF (Event a) (Event b)-accumFilter2 f c_init =-    switch (never &&& attach c_init) afAux-    where-    afAux (c, a) =-            case f c a of-            (c', Nothing) -> switch (never &&& (notYet>>>attach c')) afAux-            (c', Just b)  -> switch (now b &&& (notYet>>>attach c')) afAux--    attach :: b -> SF (Event a) (Event (b, a))-        attach c = arr (fmap (\a -> (c, a)))
− tests/examples/OptSig2.hs
@@ -1,5 +0,0 @@-{-# LANGUAGE ScopedTypeVariables #-}--errors= do-  let ls :: Int = undefined-  return ()
− tests/examples/OveridingPrimitives.hs
@@ -1,6 +0,0 @@-{-# LANGUAGE DataKinds              #-}-{-# LANGUAGE TypeOperators          #-}--(~#) :: Comonad w => CascadeW w (t ': ts) -> w t -> Last (t ': ts)-(~#) = cascadeW-infixr 0 ~#
− tests/examples/OverloadedStrings.hs
@@ -1,15 +0,0 @@-{-# Language OverloadedStrings #-}--- from https://ocharles.org.uk/blog/posts/2014-12-17-overloaded-strings.html--import Data.String--n :: Num a => a-n = 43--f  :: Fractional a => a-f = 03.1420---- foo :: Text-foo :: Data.String.IsString a => a-foo = "hello\n there"-
− tests/examples/PArr.hs
@@ -1,23 +0,0 @@-{-# LANGUAGE ParallelListComp #-}--module PArr where--blah xs ys = [ (x, y) | x <- xs | y <- ys ]---- bar = [: 1, 2 .. 3 :]----- entry point for desugaring a parallel array comprehension---- parr = [:e | qss:] = <<[:e | qss:]>> () [:():]--{--ary = let arr1 = toP [1..10]-          arr2 = toP [1..10]-          f = [: i1 + i2 | i1 <- arr1 | i2 <- arr2 :]-          in f !: 1--}---foo = 'a'-
− tests/examples/ParensAroundContext.hs
@@ -1,5 +0,0 @@-{-# LANGUAGE PartialTypeSignatures #-}-module ParensAroundContext where--f :: ((Eq a, _)) => a -> a -> Bool-f x y = x == y
− tests/examples/PatBind.hs
@@ -1,34 +0,0 @@-module   Layout.PatBind where--a,b :: Int-a = 1-b = 2--c :: Maybe (a -> b)-c = Nothing--f :: (Num a1, Num a) => a -> a1 -> ( a, a1 )-f x y = ( x+1, y-1 )---- Chris done comment attachment problem-foo = x-  where -- do stuff-        doStuff = do stuff-x = 1-stuff = 4-- -- Pattern bind-tup :: (Int, Int)-h :: Int-t :: Int-tup@(h,t) = head $ zip [1..10] [3..ff]-  where-    ff :: Int-    ff = 15--blah = do {- ; print "a"- ; print "b"- }--
− tests/examples/PatSigBind.hs
@@ -1,15 +0,0 @@-{-# LANGUAGE ScopedTypeVariables #-}--runCoreRunIO-  :: EHCOpts        -- ^ options, e.g. for turning on tracing (if supported by runner)-     -> Mod         -- ^ the module to run-     -> IO (Either Err RVal)-runCoreRunIO opts mod = do-    catch-      (runCoreRun opts [] mod $ cmodRun opts mod)-      (\(e :: SomeException) -> hFlush stdout >> (return $ Left $ strMsg $ "runCoreRunIO: " ++ show e))---foo = do-  (a :: Int) <- baz-  return grue
− tests/examples/PatSynBind.hs
@@ -1,99 +0,0 @@-{-# LANGUAGE DeriveFunctor #-}-{-# LANGUAGE ViewPatterns #-}-{-# LANGUAGE PatternSynonyms #-}-{-# LANGUAGE ScopedTypeVariables #-}---- From https://ocharles.org.uk/blog/posts/2014-12-03-pattern-synonyms.html--import Foreign.C--{---data BlendMode = NoBlending -- | AlphaBlending | AdditiveBlending | ColourModulatedBlending--toBlendMode :: BlendMode -> CInt-toBlendMode NoBlending = 0 -- #{const SDL_BLENDMODE_NONE}--- toBlendMode AlphaBlending = #{const SDL_BLENDMODE_BLEND}--fromBlendMode :: CInt -> Maybe BlendMode-fromBlendMode 0 = Just NoBlending---}--{---pattern AlphaBlending = (1) :: CInt -- #{const SDL_BLENDMODE_BLEND} :: CInt--setUpBlendMode :: CInt -> IO ()-setUpBlendMode AlphaBlending = do-  putStrLn "Enabling Alpha Blending"-  activateAlphaBlendingForAllTextures-  activateRenderAlphaBlending---}--newtype BlendMode = MkBlendMode { unBlendMode :: CInt }--pattern NoBlending = MkBlendMode 0 -- #{const SDL_BLENDMODE_NONE}-pattern AlphaBlending = MkBlendMode 1 -- #{const SDL_BLENDMODE_BLEND}--setUpBlendMode :: BlendMode -> IO ()-setUpBlendMode AlphaBlending = do-  putStrLn "Enabling Alpha Blending"-  activateAlphaBlendingForAllTextures-  activateRenderAlphaBlending--data Renderer--setRenderAlphaBlending :: Renderer -> IO ()-setRenderAlphaBlending r =-  sdlSetRenderDrawBlendMode r (unBlendMode AlphaBlending)--activateAlphaBlendingForAllTextures = return ()-activateRenderAlphaBlending = return ()--sdlSetRenderDrawBlendMode _ _ = return ()---- And from https://www.fpcomplete.com/user/icelandj/Pattern%20synonyms--data Date = Date { month :: Int, day :: Int } deriving Show---- Months-pattern January  day = Date { month = 1,  day = day }-pattern February day = Date { month = 2,  day = day }-pattern March    day = Date { month = 3,  day = day }--- elided-pattern December day = Date { month = 12, day = day }---- Holidays-pattern Christmas    = Date { month = 12, day = 25  }--describe :: Date -> String-describe (January 1)  = "First day of year"-describe (February n) = show n ++ "th of February"-describe Christmas    = "Presents!"-describe _            = "meh"--pattern Christmas2 = December 25--pattern BeforeChristmas <- December (compare 25 -> GT)-pattern Christmas3      <- December (compare 25 -> EQ)-pattern AfterChristmas  <- December (compare 25 -> LT)--react :: Date -> String-react BeforeChristmas = "Waiting :("-react Christmas       = "Presents!"-react AfterChristmas  = "Have to wait a whole year :("-react _               = "It's not even December..."--isItNow :: Int -> (Ordering, Int)-isItNow day = (compare 25 day, day)--pattern BeforeChristmas4 day <- December (isItNow -> (GT, day))-pattern Christmas4           <- December (isItNow -> (EQ, _))-pattern AfterChristmas4  day <- December (isItNow -> (LT, day))--days'tilChristmas :: Date -> Int-days'tilChristmas (BeforeChristmas4 n) = 25 - n-days'tilChristmas Christmas4           = 0-days'tilChristmas (AfterChristmas4 n)  = 365 + 25 - n
− tests/examples/PatternGuards.hs
@@ -1,7 +0,0 @@-{-# LANGUAGE PatternGuards #-}--match n-      | Just 5 <- Just n-      , Just 6 <- Nothing-      , Just 7 <- Just 9-      = Just 8
− tests/examples/ProcNotation.hs
@@ -1,12 +0,0 @@-{-#LANGUAGE Arrows, RankNTypes, ScopedTypeVariables, FlexibleContexts,-  TypeSynonymInstances, NoMonomorphismRestriction, FlexibleInstances #-}--valForm initVal vtor label = withInput $-    proc ((),nm,fi) -> do-      s_curr <- keepState initVal -< fi-      valid <- vtor -< s_curr-      case valid of-         Left err -> returnA -< (textField label (Just err) s_curr nm,-                                                   Nothing)-         Right x -> returnA -< (textField label Nothing s_curr nm,-                                Just x)
− tests/examples/Pseudonym.hs
@@ -1,41 +0,0 @@-default(Int);q s=s++ss s;ss ""=" \"\"";ss s=" "++show(take 50 s)++"++\n"++- ss(dd 50 s);t3="   ";z n=t3++" xo"!!n:t3;zl n = z(l n);j=head$[m|- (m,0)<-zip[0..]p]++[-1];l s = if j==s then 2 else p!!s;m=- "default(Int);q s=s++ss s;ss \"\"=\" \\\"\\\"\";ss s=\" \"++s"++- "how(take 50 s)++\"++\\n\"++\n ss(dd 50 s);t3=\"   \";z n"++- "=t3++\" xo\"!!n:t3;zl n = z(l n);j=head$[m|\n (m,0)<-"++- "zip[0..]p]++[-1];l s = if j==s then 2 else p!!s;m=\n"-vv="\n "++z0++";z0=z"++z0++"0 ;a=\n "++zl 4++"-0;b="++zl 7++"-0;c="++zl 1++- "\n "++z0++"-0;ms"++z0++"=[[4,\n 7,1],[6,0,5],[2,8,3],[4,6,2],[7\n ,0,8],[1, 5,3],[4,0,3],[1,0,2]]\n ;main=putStr(unlines[q m,q y,vv\n "++z0++"]);x="- ++z0++"1; d=\n "++zl 6++"-0;e="++zl 0++"-0;f="++zl 5++"\n "++z0++"-0"- ++";o="++z0++"2;p=[\n e,c,g,i,a,f,d,b,h];r=[\"\",\"You \"\n ++\"win\",\"I win\"]!!head([w|w<-[1\n ,2],x<-ms,all(\\x->w==l x)x]++[0\n "++z0++"]);n="++z0++"1"- ++"9;g=\n "++zl 2++"-0;h="++zl 8++"-0;i="++zl 3++"\n "++z0++"-0;dd"++z0++- "=drop\n\n"++r-;y= "vv=\"\\n \"++z0++\";z0=z\"++z0++\"0 ;a=\\n \"++zl 4++\"-0;b"++- "=\"++zl 7++\"-0;c=\"++zl 1++\n \"\\n \"++z0++\"-0;ms\"++z0+"++- "+\"=[[4,\\n 7,1],[6,0,5],[2,8,3],[4,6,2],[7\\n ,0,8],"++- "[1, 5,3],[4,0,3],[1,0,2]]\\n ;main=putStr(unlines[q"++- " m,q y,vv\\n \"++z0++\"]);x=\"\n ++z0++\"1; d=\\n \"++zl 6"++- "++\"-0;e=\"++zl 0++\"-0;f=\"++zl 5++\"\\n \"++z0++\"-0\"\n +"++- "+\";o=\"++z0++\"2;p=[\\n e,c,g,i,a,f,d,b,h];r=[\\\"\\\",\\\""++- "You \\\"\\n ++\\\"win\\\",\\\"I win\\\"]!!head([w|w<-[1\\n ,2]"++- ",x<-ms,all(\\\\x->w==l x)x]++[0\\n \"++z0++\"]);n=\"++z0"++- "++\"1\"\n ++\"9;g=\\n \"++zl 2++\"-0;h=\"++zl 8++\"-0;i=\"++"++- "zl 3++\"\\n \"++z0++\"-0;dd\"++z0++\n \"=drop\\n\\n\"++r\n;y="--        ;z0=z       0 ;a=-        -0;b=       -0;c=-        -0;ms       =[[4,- 7,1],[6,0,5],[2,8,3],[4,6,2],[7- ,0,8],[1, 5,3],[4,0,3],[1,0,2]]- ;main=putStr(unlines[q m,q y,vv-        ]);x=       1; d=-        -0;e=       -0;f=-        -0;o=       2;p=[- e,c,g,i,a,f,d,b,h];r=["","You "- ++"win","I win"]!!head([w|w<-[1- ,2],x<-ms,all(\x->w==l x)x]++[0-        ]);n=       19;g=-        -0;h=       -0;i=-        -0;dd       =drop-
− tests/examples/PuncFunctions.hs
@@ -1,25 +0,0 @@--- | Compares two functions taking one container-(=*=) :: (Eq' a b) => (f -> a) -> (g -> b)-      -> SameAs f g r -> r -> Property-(f =*= g) sa i = f (toF sa i) =^= g (toG sa i)---- | Compares two functions taking one scalar and one container-(=?*=) :: (Eq' a b) => (t -> f -> a) -> (t -> g -> b)-       -> SameAs f g r -> r -> t -> Property-(f =?*= g) sa i t = (f t =*= g t) sa i---- | Compares functions taking two scalars and one container-(=??*=) :: (Eq' a b) => (t -> s -> f -> a) -> (t -> s -> g -> b)-        -> SameAs f g r -> r -> t -> s -> Property-(f =??*= g) sa i t s = (f t s =*= g t s) sa i---- | Compares two functions taking two containers-(=**=) :: (Eq' a b) => (f -> f -> a) -> (g -> g -> b)-       -> SameAs f g r -> r -> r -> Property-(f =**= g) sa i = (f (toF sa i) =*= g (toG sa i)) sa---- | Compares two functions taking one container with preprocessing-(=*==) :: (Eq' f g) => (z -> f) -> (z -> g) -> (p -> z)-       -> SameAs f g r -> p -> Property-(f =*== g) p _ i = f i' =^= g i'-  where i' = p i
− tests/examples/QuasiQuote.hs
@@ -1,31 +0,0 @@-{-# LANGUAGE QuasiQuotes #-}-module QuasiQuote where--import T7918A--ex1 = [qq|e1|]-ex2 = [qq|e2|]-ex3 = [qq|e3|]-ex4 = [qq|e4|]--tx1 = undefined :: [qq|t1|]-tx2 = undefined :: [qq|t2|]-tx3 = undefined :: [qq|t3|]-tx4 = undefined :: [qq|t4|]--px1 [qq|p1|] = undefined-px2 [qq|p2|] = undefined-px3 [qq|p3|] = undefined-px4 [qq|p4|] = undefined--{-# LANGUAGE QuasiQuotes #-}--testComplex    = assertBool "" ([$istr|-        ok-#{Foo 4 "Great!" : [Foo 3 "Scott!"]}-        then-|] == ("\n" ++-    "        ok\n" ++-    "[Foo 4 \"Great!\",Foo 3 \"Scott!\"]\n" ++-    "        then\n"))-
− tests/examples/RSA.hs
@@ -1,19 +0,0 @@-import Data.Char-e=181021504832735228091659724090293195791121747536890433--u(f,m)x=i(m(x),       [],let(a,b)=f(x)       in(a:u(f,m)b))-(v,h)=(foldr(\x(y    )->00+128*y+x)0,u(     sp(25),((==)"")))-p::(Integer,Integer )->Integer      ->     Integer    --NotInt-p(n,m)x     =i(n==0 ,1,i(z n             ,q(n,m)x,    r(n,m)x))-i(n,e,d     )=if(n) then(e)              else  (d)    --23+3d4f-(g,main     ,s,un)= (\x->x,             y(j),\x->x*x,unlines)--)-j(o)=i(take(2)o==   "e=","e="++t        (drop(4-2)o),i(d>e,k,l)o)-l=un.map (show.p      (e,n).v.map(      fromIntegral{-g-}.ord)).h-k=co.map(map(chr       .fromIntegral    ).w.p(d,n).   read).lines-(t,y)=(\ (o:q)->              i(o=='-'  ,'1','-' ):   q,interact)-q(n,m)x=   mod(s(    p(        div(n)2, m{-jl-})x)    )m--hd&&gdb-(r,z,co)    =(\(n,   m)x->mod(x*p(n-1,  m)x)m,even    ,concat)--6-(w,sp)=(    u(\x->(   mod(x)128,div(x   )128),(==0    )),splitAt)--d=563347325936+1197371806136556985877790097-563347325936-n=351189532146914946493104395525009571831256157560461451
− tests/examples/RankNTypes.hs
@@ -1,159 +0,0 @@-{-# LANGUAGE RankNTypes #-}-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE KindSignatures #-}---- from https://ocharles.org.uk/blog/guest-posts/2014-12-18-rank-n-types.html--import System.Random-import Control.Monad.State-import Data.Char---id' :: forall a. a -> a-id' x = x--f = print (id' (3 :: Integer),-           id' "blah")---- rank 2 polymorphism-type IdFunc = forall a. a -> a--id'' :: IdFunc-id'' x = x--someInt :: IdFunc -> Integer-someInt id' = id' 3---- rank 3 polymorphism-type SomeInt = IdFunc -> Integer--someOtherInt :: SomeInt -> Integer-someOtherInt someInt' =-    someInt' id + someInt' id---- random numbers--data Player =-    Player {-      playerName :: String,-      playerPos  :: (Double, Double)-    }-    deriving (Eq, Ord, Show)---{--randomPlayer-    :: (MonadIO m, MonadState g m, RandomGen g)-    => m Player--}--type GenAction m = forall a. (Random a) => m a--type GenActionR m = forall a. (Random a) => (a, a) -> m a---- genRandom :: (RandomGen g) => GenAction (State g)--- genRandom = state random--genRandomR :: (RandomGen g) => GenActionR (State g)-genRandomR range = state (randomR range)--genRandom :: (Random a, RandomGen g) => State g a-genRandom = state random---randomPlayer :: (MonadIO m) => GenActionR m -> m Player-randomPlayer genR = do-    liftIO (putStrLn "Generating random player...")--    len <- genR (8, 12)-    name <- replicateM len (genR ('a', 'z'))-    x <- genR (-100, 100)-    y <- genR (-100, 100)--    liftIO (putStrLn "Done.")-    return (Player name (x, y))--main :: IO ()-main = randomPlayer randomRIO >>= print---- scott encoding--data List a-    = Cons a (List a)-    | Nil--uncons :: (a -> List a -> r) -> r -> List a -> r-uncons co ni (Cons x xs) = co x xs-uncons co ni Nil         = ni--listNull :: List a -> Bool-listNull = uncons (\_ _ -> False) True--listMap :: (a -> b) -> List a -> List b-listMap f =-    uncons (\x xs -> Cons (f x) (listMap f xs))-           Nil--newtype ListS a =-    ListS {-      unconsS :: forall r. (a -> ListS a -> r) -> r -> r-    }--nilS :: ListS a-nilS = ListS (\co ni -> ni)--consS :: a -> ListS a -> ListS a-consS x xs = ListS (\co ni -> co x xs)--unconsS' :: (a -> ListS a -> r) -> r -> ListS a -> r-unconsS' co ni (ListS f) = f co ni--instance Functor ListS where-    fmap f =-        unconsS' (\x xs -> consS (f x) (fmap f xs))-                 nilS---- Church Encoding-newtype ListC a =-    ListC {-      foldC :: forall r. (a -> r -> r) -> r -> r-    }--foldC' :: (a -> r -> r) -> r -> ListC a -> r-foldC' co ni (ListC f) = f co ni--instance Functor ListC where-    fmap f = foldC' (\x xs -> consC (f x) xs) nilC--consC = undefined-nilC = undefined---- GADTs and continuation passing style-data Some :: * -> * where-    SomeInt  :: Int -> Some Int-    SomeChar :: Char -> Some Char-    Anything :: a -> Some a---unSome :: Some a -> a-unSome (SomeInt x) = x + 3-unSome (SomeChar c) = toLower c-unSome (Anything x) = x---newtype SomeC a =-    SomeC {-      runSomeC ::-          forall r.-          ((a ~ Int) => Int -> r) ->-          ((a ~ Char) => Char -> r) ->-          (a -> r) ->-          r-      }---- dependent types--idk :: forall (a :: *). a -> a-idk x = x-
− tests/examples/RdrNames.hs
@@ -1,144 +0,0 @@-{-# LANGUAGE ParallelListComp #-}-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE MagicHash, NoImplicitPrelude, TypeFamilies, UnboxedTuples #-}-module RdrNames where--import Data.Monoid---- -------------------------------------------------------------------------        |  'type' qcname            {% amms (mkTypeImpExp (sLL $1 $> (unLoc $2)))---                                            [mj AnnType $1,mj AnnVal $2] }---- Tested in DataFamilies.hs---- -------------------------------------------------------------------------        | '(' qconsym ')'       {% ams (sLL $1 $> (unLoc $2))---                                       [mo $1,mj AnnVal $2,mc $3] }-ff = (RdrNames.:::) 0 1----- -------------------------------------------------------------------------        | '(' consym ')'        {% ams (sLL $1 $> (unLoc $2))---                                       [mo $1,mj AnnVal $2,mc $3] }-data FF = ( :::  ) Int Int---- -------------------------------------------------------------------------        | '`' conid '`'         {% ams (sLL $1 $> (unLoc $2))---                                       [mj AnnBackquote $1,mj AnnVal $2---                                       ,mj AnnBackquote $3] }-data GG = GG Int Int-gg = 0 `  GG ` 1---- -------------------------------------------------------------------------        | '`' varid '`'         {% ams (sLL $1 $> (unLoc $2))---                                       [mj AnnBackquote $1,mj AnnVal $2---                                       ,mj AnnBackquote $3] }-vv = "a" ` mappend  ` "b"---- -------------------------------------------------------------------------        | '`' qvarid '`'        {% ams (sLL $1 $> (unLoc $2))---                                       [mj AnnBackquote $1,mj AnnVal $2---                                       ,mj AnnBackquote $3] }-vvq = "a" `  Data.Monoid.mappend ` "b"---- -------------------------------------------------------------------------        | '(' ')'                      {% ams (sLL $1 $> $ getRdrName unitTyCon)---                                              [mo $1,mc $2] }--- Tested in Vect.hs---- -------------------------------------------------------------------------        | '(#' '#)'                    {% ams (sLL $1 $> $ getRdrName unboxedUnitTyCon)---                                              [mo $1,mc $2] }--- Tested in Vect.hs---- -------------------------------------------------------------------------        | '(' commas ')'        {% ams (sLL $1 $> $ getRdrName (tupleTyCon BoxedTuple---                                                        (snd $2 + 1)))---                                       (mo $1:mc $3:(mcommas (fst $2))) }-ng :: (, , ,) Int Int Int Int-ng = undefined---- -------------------------------------------------------------------------        | '(#' commas '#)'      {% ams (sLL $1 $> $ getRdrName (tupleTyCon UnboxedTuple---                                                        (snd $2 + 1)))---                                       (mo $1:mc $3:(mcommas (fst $2))) }--- Tested in Unboxed.hs---- -------------------------------------------------------------------------        | '(' '->' ')'          {% ams (sLL $1 $> $ getRdrName funTyCon)---                                       [mo $1,mj AnnRarrow $2,mc $3] }--ft :: (->) a b-ft = undefined--fp :: (   ->    ) a b-fp = undefined--type family F a :: * -> * -> *-type instance F Int = (->)-type instance F Char = ( ,  )---- -------------------------------------------------------------------------        | '[' ']'               {% ams (sLL $1 $> $ listTyCon_RDR) [mo $1,mc $2] }-lt :: [] a-lt = undefined---- -------------------------------------------------------------------------        | '[:' ':]'             {% ams (sLL $1 $> $ parrTyCon_RDR) [mo $1,mc $2] }---- GHC source indicates this constuctor is only available in PrelPArr--- ltp :: [::] a--- ltp = undefined---- -------------------------------------------------------------------------        | '(' '~#' ')'          {% ams (sLL $1 $> $ getRdrName eqPrimTyCon)---                                        [mo $1,mj AnnTildehsh $2,mc $3] }---- primitive type?--- Refl Int :: ~# * Int Int--- Refl Maybe :: ~# (* -> *) Maybe Maybe---- | A data constructor used to box up all unlifted equalities------ The type constructor is special in that GHC pretends that it--- has kind (? -> ? -> Fact) rather than (* -> * -> *)-data (~) a b = Eq# ((~#) a b)--data Coercible a b = MkCoercible ((~#) a b)----- -------------------------------------------------------------------------        | '(' qtyconsym ')'             {% ams (sLL $1 $> (unLoc $2))---                                               [mo $1,mj AnnVal $2,mc $3] }--- TBD---- -------------------------------------------------------------------------        | '(' '~' ')'                   {% ams (sLL $1 $> $ eqTyCon_RDR)---                                               [mo $1,mj AnnTilde $2,mc $3] }---- ------------------------------------------------------------------------- tyvarop : '`' tyvarid '`'       {% ams (sLL $1 $> (unLoc $2))---                                        [mj AnnBackquote $1,mj AnnVal $2---                                        ,mj AnnBackquote $3] }---- ------------------------------------------------------------------------
− tests/examples/RebindableSyntax.hs
@@ -1,60 +0,0 @@-{-# LANGUAGE RebindableSyntax, NoMonomorphismRestriction #-}---- From https://ocharles.org.uk/blog/guest-posts/2014-12-06-rebindable-syntax.html--import Prelude hiding ((>>), (>>=), return)-import Data.Monoid-import Control.Monad ((<=<))-import Data.Map as M--addNumbers = do-  80-  60-  10-  where (>>) = (+)-        return = return--(>>) = mappend-return = mempty---- We can perform the same computation as above using the Sum wrapper:--someSum :: Sum Int-someSum = do-    Sum 80-    Sum 60-    Sum 10-    return--someProduct :: Product Int-someProduct = do-    Product 10-    Product 30---- Why not try something non-numeric?--tummyMuscle :: String-tummyMuscle = do-    "a"-    "b"---ff = let-  (>>)    = flip (.)-  return  = id--  arithmetic = do-      (+1)-      (*100)-      (/300)-      return--  -- Here, the input is numeric and all functions operate on a number.-  -- What if we want to take a list and output a string? No problem:--  check = do-      sum-      sqrt-      floor-      show-  in 4
− tests/examples/RecordSemi.hs
@@ -1,15 +0,0 @@--- | Generate a generate statement for the builtin function "fst"-genFst :: BuiltinBuilder-genFst = genNoInsts genFst'-genFst' :: (Either CoreSyn.CoreBndr AST.VHDLName) -> CoreSyn.CoreBndr -> [(Either CoreSyn.CoreExpr AST.Expr, Type.Type)] -> TranslatorSession [AST.ConcSm]-genFst' res f args@[(arg,argType)] = do {-  ; arg_htype <- MonadState.lift tsType $ mkHType "\nGenerate.genFst: Invalid argument type" argType-  ; [AST.PrimName argExpr] <- argsToVHDLExprs [arg]-  ; let {-        ; labels      = getFieldLabels arg_htype 0-        ; argexprA    = vhdlNameToVHDLExpr $ mkSelectedName argExpr (labels!!0)-        ; assign      = mkUncondAssign res argexprA-        } ;-    -- Return the generate functions-  ; return [assign]-  }
− tests/examples/RecordUpdate.hs
@@ -1,6 +0,0 @@--data Foo = F { f1 :: Int, f2 :: String }--foo :: Int -> Foo -> Foo-foo v f = f { f1 = v }-
− tests/examples/RecordWildcard.hs
@@ -1,8 +0,0 @@-{-# LANGUAGE RecordWildCards #-}---parseArgs =-  Args-        { equalProb = E `elem` opts-        , ..-        }
− tests/examples/RecursiveDo.hs
@@ -1,57 +0,0 @@-{-# LANGUAGE RecursiveDo #-}--- From https://ocharles.org.uk/blog/posts/2014-12-09-recursive-do.html--import Control.Monad.Fix--data RoseTree a = RoseTree a [RoseTree a]-  deriving (Show)--exampleTree :: RoseTree Int-exampleTree = RoseTree 5 [RoseTree 4 [], RoseTree 6 []]--pureMax :: Ord a => RoseTree a -> RoseTree (a, a)-pureMax tree =-  let (t, largest) = go largest tree-  in t- where-  go :: Ord a => a -> RoseTree a -> (RoseTree (a, a), a)-  go biggest (RoseTree x []) = (RoseTree (x, biggest) [], x)-  go biggest (RoseTree x xs) =-      let sub = map (go biggest) xs-          (xs', largests) = unzip sub-      in (RoseTree (x, biggest) xs', max x (maximum largests))--t = pureMax exampleTree---- -----------------------------------------------------------------------impureMin :: (MonadFix m, Ord b) => (a -> m b) -> RoseTree a -> m (RoseTree (a, b))-impureMin f tree = do-  rec (t, largest) <- go largest tree-  return t- where-  go smallest (RoseTree x []) = do-    b <- f x-    return (RoseTree (x, smallest) [], b)--  go smallest (RoseTree x xs) = do-    sub <- mapM (go smallest) xs-    b <- f x-    let (xs', bs) = unzip sub-    return (RoseTree (x, smallest) xs', min b (minimum bs))--budget :: String -> IO Int-budget "Ada"      = return 10 -- A struggling startup programmer-budget "Curry"    = return 50 -- A big-earner in finance-budget "Dijkstra" = return 20 -- Teaching is the real reward-budget "Howard"   = return 5  -- An frugile undergraduate!--inviteTree = RoseTree "Ada" [ RoseTree "Dijkstra" []-                            , RoseTree "Curry" [ RoseTree "Howard" []]-                            ]--ti = impureMin budget inviteTree--simplemdo = mdo-  return 5-
− tests/examples/RedundantDo.hs
@@ -1,4 +0,0 @@-foo =-  case x of-    True -> foo-    False -> foo
− tests/examples/Remorse.hs
@@ -1,88 +0,0 @@-import Prelude as P;import Data.Char as C;import Data.List;import System.Environment as S;-main = do- (.--.)<-(--.|.--.+);(.-)<-(--.|.-+)- case (.-) of ["+",(.-)]->(-|---|--+) (.-);["-",(.-)]->(..-.|.-.|--+) (.-);_->(.|.-.)("Usage: "++(.--.)++" (+/-) F.hs")- where- (-|---|--+) (.-)=do (..-.)<-(.-.|..-.+) (.-);(.--.|...+)(((-.-.|--+) (.--).(--.).(-..-))(..-.))- (..-.|.-.|--+) (.-)=do (..-.)<-(.-.|..-.+) (.-);(.--.|...+)(((-.-.|--+) (.--|=).(--.|=).(-..-))(..-.))---- | (--| ): (-.-.|---|-.|...-|.|.-.|-) (-.-.|....|.-|.-.) -> (--|---|.-.|...|.)-_--| 'a'=".-";_--| 'b'="-...";_--| 'c'="-.-.";_--| 'd'= "-..";_--| 'e'=".";-_--| 'f'="..-.";_--| 'g'="--.";_--| 'h'="....";_--| 'i'="..";_--| 'j'=".---";-_--| 'k'="-.-";_--| 'l'=".-..";_--| 'm'="--";_--| 'n'="-.";_--| 'o'="---";-_--| 'p'=".--.";_--| 'q'="--.-";_--| 'r'=".-.";_--| 's'="...";_--| 't'="-";-_--| 'u'="..-";_--| 'v'="...-";_--| 'w'=".--";_--| 'x'="-..-";_--| 'y'="-.--";-_--| 'z'="--..";_--| '0'="-----";_--| '1'=".----";_--| '2'="..---";-_--| '3'="...--";_--| '4'="....-";_--| '5'=".....";_--| '6'="-....";-_--| '7'="--...";_--| '8'="---..";_--| '9'="----.";_--| '_'="!";_--| '\''="=";-_--| (-.-.)- |'A'<=(-.-.)&&(-.-.)<='Z'=(()--| (-|.-..+) (-.-.))++"+"- |(-..|.|..-.)=[(-.-.)]---- | (--|=): (..|-.|...-) of (--| )-(--|=) (...)=(..-.)[(-.-.)|(-.-.)<-['a'..'z']++['0'..'9']++['A'..'Z']++['_','\''],()--| (-.-.)==(...)]- where (..-.)[]=(....|-..) (...);(..-.) (-.-.|...)=(....|-..) (-.-.|...)---- | (.--): (-.-.|---|-.|...-|.|.-.|-) (.--|---|.-.|-..)-(.--) (...)- |(...).|.-..["e","i","m","o","t"]=(.--)((...)++" ") -- (...|---|--|.) (..-|-.|-|..|-..|-.--) (.|-..-|-.-.|.|.--.|-|..|---|-.|...):- -- .=(-.-.|---|--|.--.|---|...|..|-|..|---|-.), ..=(-.|..-|--|.|.-.|..|-.-.) (.-.|.-|-.|--.|.), --/---=(.|-.|-..)-of-(.-..|..|-.|.) (-.-.|---|--|--|.|-.|-), -=(...|..-|-...|-|.-.|.-|-.-.|-|..|---|-.)- |(...).|.-..(-.-|.|-.--|...)=(...)- |(..|-..) (...)=(('(':).(++")").(-.-.|-.-.).(..|.--.) "|".(--|.--.)((--| )()))(...)- |(..|-.|..-.|-..-) (...)=((-|.-..).(..|-).(.--).(-|.-..).(..|-))(...)- |(-..|.|..-.)=(...)- where- (..|-..)((-..-):_)=(..|.-..+) (-..-)||(-..-)=='_'- (..|-.|..-.|-..-)((-..-):_)=(-..-)=='`'---- | (.--|=): do (..|-.|...-) of (.--)-(.--|=) (...)- |(...)=="|"="|"- |(..|-..) (...)=((--|.--.) (--|=).(-.-.|....|.-.|...).(-|.-..).(..|-))(...)- |(---|-.|.) (...)='`':((--|=).(..|-))(...):"`"- |(..|-.|..-.|-..-) (...)='`':((--|.--.) (--|=).(-.-.|....|.-.|...))(...)++"`"- |(-..|.|..-.)=(...)- where- (..|-..)('(':(....):(-| ))=(.--.|.-.|.) (....)&&(.-..|.-) (-| )==')'&&(.-|.-..)(??)((..|-) (-| ))- (..|-..) _=False- (.--.|.-.|.) (-.-.)=(-.-.).|.-..".-"- (..|-.|..-.|-..-) (...)=(.--.|.-.|.) ((....|-..) (...))&&(.-|.-..)(??)((-|.-..) (...))&&(.-|-.)(=='|')(...)- (---|-.|.) (...)=(.-|.-..) (.--.|.-.|.) ((..|-) (...))&&(.-..|.-) (...)=='|'- (-.-.|....|.-.|...) (...)=case (-..|.--+)(=='|')(...) of []->[];(...)->let ((.--),(...|...))=(-...|.-.)(=='|')(...) in (.--):(-.-.|....|.-.|...) (...|...)---- | (.--.|.-.|.|-..) (---|-.) (-.-.|....|.-|.-.|...)-(??)(-.-.)=(-.-.).|.-..".-+/=!|"---- | (.-..|.|-..-) (...|.-.|-.-.) -> (-|---|-.-) (...|-|.-.|.|.-|--)-(-..-)[]=[]-(-..-)((-.-.):(...))|(..|...+) (-.-.)=((-.-.):(...|...)):(-..-) (.-.|--) where ((...|...),(.-.|--))=(...|.--.) (..|...+) (...)-(-..-) (...)=(-|---|-.-):(-..-) (.-.|--) where ((-|---|-.-),(.-.|--))=(....|-..)((.--.|.-..|.|-..-) (...))---- | (--.): (--.|.-..|..-|.) (...|.|--.-) (-|---|-.-|...) -> (...|..|-.|--.|.-..|.) (-|---|-.-)-(--.)((--.-):".":(-.):(.-.|--))|(..|..-+)((....|-..) (--.-))=(--.)(((--.-)++"."++(-.)):(.-.|--))-(--.)("`":(.-.|--))=case (--.) (.-.|--) of ((--.-|-.):"`":(.-.|--))->("`"++(--.-|-.)++"`"):(--.) (.-.|--);_->("`":(.-.|--))-(--.)((...):(...|...))=(...):(--.) (...|...)-(--.)[]=[]---- | (--.|=): (.-..|..|-.-|.) (--.) in (.-.|.|...-)-(--.|=)("(":(-.):")":(.-.|--))|(.-|.-..)(??)(-.)=("("++(-.)++")"):(--.|=) (.-.|--)-(--.|=)("(":(-.):" ":")":(.-.|--))|(.-|.-..)(??)(-.)=("("++(-.)++")"):(--.|=) (.-.|--)-(--.|=)("|":(.-.|--))="|":(--.|=) (.-.|--)-(--.|=)((-.):(...|...):(.-.|--))|(.-|.-..)(.|.-..".-")((..|-) (-.))&&(.-..|.-) (-.)=='|'&&(.-|.-..) (..|...+) (...|...)=(-.):(--.|=) (.-.|--)-(--.|=)((-.):(.-.|--))=(-.):(--.|=) (.-.|--)-(--.|=)[]=[]---- | (....|.-|...|-.-|.|.-..|.-..) (-.-|.|-.--|.--|---|.-.|-..|...)-(-.-|.|-.--|...)=- ["case","class","data","default","deriving","do","else"- ,"if","import","in","infix","infixl","infixr","instance","let","module"- ,"newtype","of","then","type","where","_","main","foreign","ccall","as"]---- | (.-|-...|-...|.-.|.|...-) (.-..|..|-...) (..-.|-.|...)-(-.-.|-.-.)=P.concat;(.|.-..) (-..-)=P.elem (-..-);(--|.--.)=P.map;(-.-.|--+)=P.concatMap;-(...|.--.)=P.span;(-...|.-.)=P.break;(..|.--.)=intersperse;(-..|.--+)=P.dropWhile;-(....|-..)=P.head;(-|.-..)=P.tail;(..|-)=P.init;(.-..|.-)=P.last;-(-|.-..+)=C.toLower;(..|.-..+)=C.isLower;(..|...+)=C.isSpace;(..|..-+)=C.isUpper;-(.-.|..-.+)=P.readFile;(.--.|...+)=P.putStr;(.|.-.)=P.error;-(--.|.-+)=S.getArgs;(--.|.--.+)=S.getProgName;-(.-|.-..)=P.all;(.-|-.)=P.any;(-..|.|..-.)=P.otherwise;(.--.|.-..|.|-..-)=P.lex;
− tests/examples/Rename1.hs
@@ -1,6 +0,0 @@---foo x y =-   do c <- getChar-      return c-
− tests/examples/Rename1.hs.expected
@@ -1,6 +0,0 @@---bar2 x y =-   do c <- getChar-      return c-
− tests/examples/Rename2.hs
@@ -1,4 +0,0 @@--foo' x = case (odd x) of-  True -> "Odd"-  False -> "Even"
− tests/examples/Rename2.hs.expected
@@ -1,4 +0,0 @@--joe x = case (odd x) of-  True -> "Odd"-  False -> "Even"
− tests/examples/RmDecl1.hs
@@ -1,12 +0,0 @@-module RmDecl1 where--sumSquares x = x * p-         where p=2  {-There is a comment-}--sq :: Int -> Int -> Int-sq pow 0 = 0-sq pow z = z^pow  --there is a comment--{- foo bar -}-anotherFun 0 y = sq y-     where  sq x = x^2
− tests/examples/RmDecl1.hs.expected
@@ -1,8 +0,0 @@-module RmDecl1 where--sumSquares x = x * p-         where p=2  {-There is a comment-}--{- foo bar -}-anotherFun 0 y = sq y-     where  sq x = x^2
− tests/examples/RmDecl2.hs
@@ -1,10 +0,0 @@-module RmDecl2 where--sumSquares x y = let sq 0=0-                     sq z=z^pow-                     pow=2-                 in sq x + sq y--anotherFun 0 y = sq y-     where  sq x = x^2-
− tests/examples/RmDecl2.hs.expected
@@ -1,9 +0,0 @@-module RmDecl2 where--sumSquares x y = let sq 0=0-                     sq z=z^pow-                 in sq x + sq y--anotherFun 0 y = sq y-     where  sq x = x^2-
− tests/examples/RmDecl3.hs
@@ -1,9 +0,0 @@-module RmDecl3 where---- Remove last declaration from a where clause, where should disappear too-ff y = y + zz-  where-    zz = 1--foo = 3--- EOF
− tests/examples/RmDecl3.hs.expected
@@ -1,9 +0,0 @@-module RmDecl3 where---- Remove last declaration from a where clause, where should disappear too-ff y = y + zz--zz = 1--foo = 3--- EOF
− tests/examples/RmDecl4.hs
@@ -1,9 +0,0 @@-module RmDecl4 where---- Remove first declaration from a where clause, last should still be indented-ff y = y + zz + xx-  where-    zz = 1-    xx = 2---- EOF
− tests/examples/RmDecl4.hs.expected
@@ -1,10 +0,0 @@-module RmDecl4 where---- Remove first declaration from a where clause, last should still be indented-ff y = y + zz + xx-  where-    xx = 2--zz = 1---- EOF
− tests/examples/RmDecl5.hs
@@ -1,6 +0,0 @@-module RmDecl5 where--sumSquares x y = let sq 0=0-                     sq z=z^pow-                     pow=2-                 in sq x + sq y
− tests/examples/RmDecl5.hs.expected
@@ -1,4 +0,0 @@-module RmDecl5 where--sumSquares x y = let pow=2-                 in sq x + sq y
− tests/examples/RmDecl6.hs
@@ -1,11 +0,0 @@-module RmDecl6 where--foo a = baz-  where-    baz :: Int-    baz = x  + a--    x = 1--    y :: Int -> Int -> Int-    y a b = undefined
− tests/examples/RmDecl6.hs.expected
@@ -1,8 +0,0 @@-module RmDecl6 where--foo a = baz-  where-    x = 1--    y :: Int -> Int -> Int-    y a b = undefined
− tests/examples/RmDecl7.hs
@@ -1,8 +0,0 @@-module RmDecl7 where--toplevel :: Integer -> Integer-toplevel x = c * x---- c,d :: Integer-c = 7-d = 9
− tests/examples/RmDecl7.hs.expected
@@ -1,6 +0,0 @@-module RmDecl7 where--toplevel :: Integer -> Integer-toplevel x = c * x--d = 9
− tests/examples/RmTypeSig1.hs
@@ -1,7 +0,0 @@-module RmTypeSig1 where--sq,anotherFun :: Int -> Int-sq 0 = 0-sq z = z^2--anotherFun x = x^2
− tests/examples/RmTypeSig1.hs.expected
@@ -1,7 +0,0 @@-module RmTypeSig1 where--anotherFun :: Int -> Int-sq 0 = 0-sq z = z^2--anotherFun x = x^2
− tests/examples/RmTypeSig2.hs
@@ -1,7 +0,0 @@-module RmTypeSig2 where---- Pattern bind-tup@(h,t) = (1,ff)-  where-    ff :: Int-    ff = 15
− tests/examples/RmTypeSig2.hs.expected
@@ -1,6 +0,0 @@-module RmTypeSig2 where---- Pattern bind-tup@(h,t) = (1,ff)-  where-    ff = 15
− tests/examples/Roles.hs
@@ -1,18 +0,0 @@-{-# LANGUAGE RoleAnnotations, PolyKinds #-}--module Roles where--data T1 a = K1 a-data T2 a = K2 a-data T3 (a :: k) = K3-data T4 (a :: * -> *) b = K4 (a b)--data T5 a = K5 a-data T6 a = K6-data T7 a b = K7 b--type role T1 nominal-type role T2 representational-type role T3 phantom-type role T4 nominal _-type role T5 _
− tests/examples/Rules.hs
@@ -1,39 +0,0 @@-module Rules where--import Data.Char--{-# RULES "map-loop" [ ~  ]  forall f . map' f = map' (id . f) #-}--{-# NOINLINE map' #-}-map' f [] = []-map' f (x:xs) = f x : map' f xs--main = print (map' toUpper "Hello, World")---- Should warn-foo1 x = x-{-# RULES "foo1" [ 1] forall x. foo1 x = x #-}---- Should warn-foo2 x = x-{-# INLINE foo2 #-}-{-# RULES "foo2" [~ 1 ] forall x. foo2 x = x #-}---- Should not warn-foo3 x = x-{-# NOINLINE foo3 #-}-{-# RULES "foo3" forall x. foo3 x = x #-}--{-# NOINLINE f #-}-f :: Int -> String-f x = "NOT FIRED"--{-# NOINLINE neg #-}-neg :: Int -> Int-neg = negate--{-# RULES-     "f" forall (c::Char->Int) (x::Char). f (c x) = "RULE FIRED"- #-}--
− tests/examples/RulesSemi.hs
@@ -1,9 +0,0 @@--{-# RULES-  "cFloatConv/Float->Float"    forall (x::Float).  cFloatConv x = x;-  "cFloatConv/Double->Double"  forall (x::Double). cFloatConv x = x;-  "cFloatConv/Float->CFloat"   forall (x::Float).  cFloatConv x = CFloat x;-  "cFloatConv/CFloat->Float"   forall (x::Float).  cFloatConv CFloat x = x;-  "cFloatConv/Double->CDouble" forall (x::Double). cFloatConv x = CDouble x;-  "cFloatConv/CDouble->Double" forall (x::Double). cFloatConv CDouble x = x- #-};
− tests/examples/ScopedTypeVariables.hs
@@ -1,10 +0,0 @@-{-# LANGUAGE ScopedTypeVariables #-}--- from https://ocharles.org.uk/blog/guest-posts/2014-12-20-scoped-type-variables.html--import qualified Data.Map as Map--insertMany ::  forall k v . Ord k => (v -> v -> v) -> [(k,v)] -> Map.Map k v -> Map.Map k v-insertMany f vs m = foldr f1 m vs-  where-    f1 :: (k, v) -> Map.Map k v -> Map.Map k v-    f1 (k,v) m = Map.insertWith f k v m
− tests/examples/SemiInstance.hs
@@ -1,11 +0,0 @@--instance ArrowTransformer (AbortT v) where {-  lift = AbortT . (>>> arr Right);-  tmap f = AbortT . f . unwrapAbortT;-};--instance MakeValueTuple Float  where type ValueTuple Float  = Value Float  ; valueTupleOf = valueOf--instance Foo where {-  type ListElement Zero (a,r) = a;-}
− tests/examples/SemiWorkout.hs
@@ -1,60 +0,0 @@-{-# LANGUAGE KindSignatures-           , GADTs-           , ScopedTypeVariables-           , PatternSignatures-           , MultiParamTypeClasses-           , FunctionalDependencies-           , FlexibleInstances-           , UndecidableInstances-           , TypeFamilies-           , FlexibleContexts-           #-}--instance forall init prog prog' fromO fromI progOut progIn-                sessionsToIdxMe sessionsToIdxThem idxsToPairStructsMe idxsToPairStructsThem-                keyToIdxMe idxToValueMe keyToIdxMe' idxToValueMe' idxOfThem current current' invertedSessionsMe invertedSessionsThem .-    ( ProgramToMVarsOutgoingT prog prog ~ progOut-    , ProgramToMVarsOutgoingT prog' prog' ~ progIn-    , SWellFormedConfig init (D0 E) prog-    , SWellFormedConfig init (D0 E) prog'-    , TyListIndex progOut init (MVar (ProgramCell (Cell fromO)))-    , TyListIndex progIn init (MVar (ProgramCell (Cell fromI)))-    , TyListIndex prog init current'-    , Expand prog current' current-    , MapLookup (TyMap sessionsToIdxMe idxsToPairStructsMe) init-                    (MVar (Map (RawPid, RawPid) (MVar (PairStruct init prog prog' ((Cons (Jump init) Nil), (Cons (Jump init) Nil), (Cons (Jump init) Nil))))))-    , TyListMember invertedSessionsThem init True-    , MapSize (TyMap keyToIdxMe idxToValueMe) idxOfThem-    , MapInsert (TyMap keyToIdxMe idxToValueMe) idxOfThem-                    (SessionState prog prog' (current, fromO, fromI)) (TyMap keyToIdxMe' idxToValueMe')-    ) =>-    CreateSession False init prog prog'-                  sessionsToIdxMe sessionsToIdxThem idxsToPairStructsMe idxsToPairStructsThem-                  keyToIdxMe idxToValueMe keyToIdxMe' idxToValueMe' idxOfThem invertedSessionsMe invertedSessionsThem where-                      createSession init FF (Pid remotePid _) =-                          InterleavedChain $-                              \ipid@(IPid (Pid localPid localSTMap) _) mp ->-                                  do { let pidFuncMapMVar :: MVar (Map (RawPid, RawPid)-                                                                       (MVar (PairStruct init prog prog'-                                                                              ((Cons (Jump init) Nil), (Cons (Jump init) Nil), (Cons (Jump init) Nil)))))-                                               = mapLookup localSTMap init-                                     ; pidFuncMap <- takeMVar pidFuncMapMVar-                                     ; emptyMVar :: MVar (TyMap keyToIdxMe' idxToValueMe') <- newEmptyMVar-                                     ; psMVar :: MVar (PairStruct init prog prog' ((Cons (Jump init) Nil), (Cons (Jump init) Nil), (Cons (Jump init) Nil)))-                                              <- case Map.lookup (localPid, remotePid) pidFuncMap of-                                                   Nothing-                                                       -> do { empty <- newEmptyMVar-                                                             ; putMVar pidFuncMapMVar (Map.insert (localPid, remotePid) empty pidFuncMap)-                                                             ; return empty-                                                             }-                                                   (Just mv)-                                                       -> do { putMVar pidFuncMapMVar pidFuncMap-                                                             ; return mv-                                                             }-                                     ; let idxOfThem :: idxOfThem = mapSize mp-                                           ps :: PairStruct init prog prog' ((Cons (Jump init) Nil), (Cons (Jump init) Nil), (Cons (Jump init) Nil))-                                              = PS localPid (f idxOfThem mp emptyMVar)-                                     ; putMVar psMVar ps-                                     ; mp' <- takeMVar emptyMVar-                                     ; return (idxOfThem, mp', ipid)-                                     }
− tests/examples/Shebang.hs
@@ -1,5 +0,0 @@-#!/usr/bin/env runhaskell-{-# LANGUAGE OverloadedStrings #-}-import Aws.SSSP.App--main = web
− tests/examples/ShiftingLambda.hs
@@ -1,22 +0,0 @@-{-# LANGUAGE ImplicitParams, NamedFieldPuns, ParallelListComp, PatternGuards #-}-spec :: Spec-spec = do-  describe "split4'8" $ do-    it "0xabc" $ do-      split4'8 0xabc `shouldBe` (0x0a, 0xbc)-    it "0xfff" $ do-      split4'8 0xfff `shouldBe` (0x0f, 0xff)--    describe "(x, y) = split4'8 z" $ do-      prop "x <= 0x0f" $-        \z -> let (x, _) =  split4'8 z in x <= 0x0f-      prop "x << 8 | y == z" $ do-        \z -> let (x, y) = split4'8 z in-          fromIntegral x `shiftL` 8 .|. fromIntegral y == z--match s@Status{ pos, flips, captureAt, captureLen }-  | isOne ?pat = ite (pos .>= strLen) __FAIL__ one-  | otherwise = ite (pos + (toEnum $ minLen ?pat) .> strLen) __FAIL__ $ case ?pat of-    POr ps -> choice flips $ map (\p -> \b -> let ?pat = p in match s{ flips = b }) ps--foo = 1
− tests/examples/Sigs.hs
@@ -1,40 +0,0 @@-{-# LANGUAGE PatternSynonyms #-}--module Sigs where---- TypeSig-f :: Num a => a -> a-f = undefined--pattern Single :: () => (Show a) => a -> [a]-pattern Single x = [x]--g :: (Show a) => [a] -> a-g (Single x) = x---- Fixities--infixr  6 +++-infixr  7 ***,///--(+++) :: Int -> Int -> Int-a +++ b = a + 2*b--(***) :: Int -> Int -> Int-a *** b = a - 4*b--(///) :: Int -> Int -> Int-a /// b = 2*a - 3*b---- Inline signatures--{-# Inline g #-}-{-# INLINE [~34] f #-}---- Specialise signature---- Multiple sigs-x,y,z :: Int-x = 0-y = 0-z = 0
− tests/examples/Simple.hs
@@ -1,4 +0,0 @@---- blah-x = 1-
− tests/examples/SimpleComplexTuple.hs
@@ -1,3 +0,0 @@---foo ((-),(.))= (5,6)
− tests/examples/SimpleDo.hs
@@ -1,4 +0,0 @@--foo = do-  let    x = 1 -- a comment-  return x
− tests/examples/SlidingDataClassDecl.hs
@@ -1,14 +0,0 @@-{-# LANGUAGE FlexibleInstances          #-}-{-# LANGUAGE MultiParamTypeClasses      #-}-{-# LANGUAGE RankNTypes                 #-}-{-# LANGUAGE TypeFamilies               #-}-{-# LANGUAGE TypeOperators              #-}-{-# LANGUAGE TypeSynonymInstances       #-}---instance HasTrie R2Basis where-    data R2Basis :->: x = R2Trie x x-    trie f = R2Trie (f XB) (f YB)-    untrie (R2Trie x _y) XB = x-    untrie (R2Trie _x y) YB = y-    enumerate (R2Trie x y)  = [(XB,x),(YB,y)]
− tests/examples/SlidingDoClause.hs
@@ -1,13 +0,0 @@----- :bounds narrowing 35-bndCom tenv args =-  do { (bound,size) <- getBounds fail args-     ; let get (s,m,ref) = do { n <- readRef ref; return(s++" = "++show n++ m)}-     ; if bound == ""-          then do { xs <- mapM get boundRef; warnM [Dl xs "\n"]}-          else case find (\ (nm,info,ref) -> nm==bound) boundRef of-                Just (_,_,ref) -> writeRef ref size-                Nothing -> fail ("Unknown bound '"++bound++"'")-     ; return tenv-     }
− tests/examples/SlidingLambda.hs
@@ -1,3 +0,0 @@-{-# LANGUAGE ImplicitParams #-}--foo = choice flips $ map (\p -> \b -> let ?pat = p in match s{ flips = b }) ps
− tests/examples/SlidingListComp.hs
@@ -1,8 +0,0 @@---foo =-  [concatMap (\(n, f) -> [findPath copts v >>= f (listArg "ghc" as) | v <- listArg n as]) [-                    ("project", Update.scanProject),-                    ("file", Update.scanFile),-                    ("path", Update.scanDirectory)],-                map (Update.scanCabal (listArg "ghc" as)) cabals]
− tests/examples/SlidingRecordSetter.hs
@@ -1,4 +0,0 @@--selfQualify mod rsets = let defs = Set.fromList (map rs_name rsets)-                        in map (descend (f defs))-                               (map (\RS{..} -> RS{rs_name = qualify mod rs_name, ..}) rsets)
− tests/examples/SlidingTypeSyn.hs
@@ -1,14 +0,0 @@-{-# LANGUAGE FlexibleContexts    #-}-{-# LANGUAGE RankNTypes          #-}-{-# LANGUAGE TypeOperators       #-}-{-# LANGUAGE KindSignatures      #-}-{-# LANGUAGE LiberalTypeSynonyms #-}-{-# LANGUAGE GADTs               #-}-{-# LANGUAGE TypeFamilies        #-}---type ( f :->   g) (r :: * -> *) ix = f r ix -> g r ix--type ( f :-->  g)  b ix = f b ix -> g b ix--type ((f :---> g)) b ix = f b ix -> g b ix
− tests/examples/SpacesSplice.hs
@@ -1,3 +0,0 @@-{-# LANGUAGE TemplateHaskell            #-}--makeLenses '' PostscriptFont
− tests/examples/Splice.hs
@@ -1,47 +0,0 @@-{-# LANGUAGE TemplateHaskell, FlexibleInstances,-          MultiParamTypeClasses, TypeSynonymInstances #-}--module Splice where--import Language.Haskell.TH.Syntax-import Language.Haskell.TH--foo $( return $ VarP $ mkName "x" ) = x-bar $( [p| x |] ) = x--baz = [| \ $( return $ VarP $ mkName "x" ) -> $(dyn "x") |]---class Eq a => MyClass a-data Foo = Foo deriving Eq--instance MyClass Foo--data Bar = Bar-  deriving Eq--type Baz = Bar-instance MyClass Baz--data Quux a  = Quux a   deriving Eq-data Quux2 a = Quux2 a  deriving Eq-instance Eq a  => MyClass (Quux a)-instance Ord a => MyClass (Quux2 a)--class MyClass2 a b-instance MyClass2 Int Bool--$(return [])--main = do-    putStrLn $(do { info <- reify ''MyClass; lift (pprint info) })-    print $(isInstance ''Eq [ConT ''Foo] >>= lift)-    print $(isInstance ''MyClass [ConT ''Foo] >>= lift)-    print $ not $(isInstance ''Show [ConT ''Foo] >>= lift)-    print $(isInstance ''MyClass [ConT ''Bar] >>= lift) -- this one-    print $(isInstance ''MyClass [ConT ''Baz] >>= lift)-    print $(isInstance ''MyClass [AppT (ConT ''Quux) (ConT ''Int)] >>= lift) --this one-    print $(isInstance ''MyClass [AppT (ConT ''Quux2) (ConT ''Int)] >>= lift) -- this one-    print $(isInstance ''MyClass2 [ConT ''Int, ConT ''Bool] >>= lift)-    print $(isInstance ''MyClass2 [ConT ''Bool, ConT ''Bool] >>= lift)-
− tests/examples/SpliceSemi.hs
@@ -1,4 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}---$(makePredicates ''TheType) ; $(makePredicatesNot ''TheType)
− tests/examples/StaticPointers.hs
@@ -1,35 +0,0 @@-{-# LANGUAGE StaticPointers #-}-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE DeriveDataTypeable #-}--module Main where--import GHC.StaticPtr-import GHC.Word-import GHC.Generics-import Data.Data-import Data.Binary-import Data.ByteString--fact :: Int -> Int-fact 0 = 1-fact n = n * fact (n - 1)--main = do-  let sptr :: StaticPtr (Int -> Int)-      sptr = static fact-  print $ staticPtrInfo sptr-  print $ deRefStaticPtr sptr 10---- -----------------------------------------------------------------------type StaticKey1 = Fingerprint---- Defined in GHC.Fingerprint.-data Fingerprint = Fingerprint {-# UNPACK #-} !Word64 {-# UNPACK #-} !Word64-  deriving (Generic, Typeable)--staticKey :: StaticPtr a -> StaticKey1-staticKey = undefined--
− tests/examples/Stmts.hs
@@ -1,22 +0,0 @@-module Stmts where---- Make sure we get all the semicolons in statements--foo :: IO ()-foo = do-  do { ;;;; a }-  a--bar :: IO ()-bar = do-  { ;-    a ;;-    b-  }--baz :: IO ()-baz = do { ;; s ; s ; ; s ;; }--a = undefined-b = undefined-s = undefined
− tests/examples/StrangeTypeClass.hs
@@ -1,18 +0,0 @@----instance-  (-  ) => Elms Z ix where-  data Elm Z ix = ElmZ !ix-  type Arg Z = Z-  getArg !(ElmZ _) = Z-  getIdx !(ElmZ ix) = ix-  {-# INLINE getArg #-}-  {-# INLINE getIdx #-}--foo :: (Eq a) => a-> Bool-foo = undefined--bar :: (   ) => a-> Bool-bar = undefined
− tests/examples/Stream.hs
@@ -1,156 +0,0 @@-module Stream (Stream, carry, addStream, rationalToStream,-                streamToFloat, addFiniteStream, negate', average) where--import Data.Ratio---type Digit = Integer-type Stream = [Integer]------ Convert from a Rational fraction to its stream representation-rationalToStream :: Rational -> Stream-rationalToStream x-        |t<1            = 0:rationalToStream t-        |otherwise      = 1:rationalToStream (t-1)-        where t = 2*x------- Convert from a stream to the Float value-streamToFloat :: Stream -> Float-streamToFloat x =  f x (1)--f :: Stream -> Integer -> Float-f [] n = 0-f (y:ys) n = (fromIntegral)y/(fromIntegral(2^n)) + f ys (n+1)-------- Add two stream-addStream :: Stream -> Stream -> Stream-addStream (x1:x2:x3:xs) (y1:y2:y3:ys) = (u+c):(addStream (x2:x3:xs) (y2:y3:ys))-                                where u = interim x1 x2 y1 y2-                                      c = carry x2 x3 y2 y3------ Compute carry, the C(i) value, given x(i) and y(i)-carry :: Digit -> Digit -> Digit -> Digit -> Digit-carry x1 x2 y1 y2-        |t>1                    =  1-        |t<(-1)                 = -1-        |t==1 && (minus1 x2 y2) =  0-        |t==1 && not (minus1 x2 y2) = 1-        |t==(-1) && (minus1 x2 y2) = -1-        |t==(-1) && not (minus1 x2 y2) = 0-        |t==0                           = 0-        where t = x1+y1------ Computer the interim sum, the U(i) value, given x(i), y(i) and c(i)-interim :: Digit -> Digit -> Digit -> Digit -> Digit-interim x1 x2 y1 y2-                |t>1                    =  0-                |t<(-1)                 = 0-                |t==1 && (minus1 x2 y2) =  1-                |t==1 && not (minus1 x2 y2) = -1-                |t==(-1) && (minus1 x2 y2) = 1-                |t==(-1) && not (minus1 x2 y2) = -1-                |t==0                           = 0-                where t = x1+y1------ Check if at least one of 2 digits is -1-minus1 :: Digit -> Digit -> Bool-minus1 x y = (x==(-1))|| (y==(-1))--------- Algin two stream so that they have the same length-align :: Stream -> Stream -> (Stream, Stream)-align xs ys-        |x>y            = (xs, (copy 0 (x-y)) ++ys)-        |otherwise      = ((copy 0 (y-x)) ++ xs, ys)-        where x = toInteger(length xs)-              y = toInteger(length ys)------ Generate a list of x-copy :: Integer -> Integer -> [Integer]-copy x n = [x| i<- [1..n]]---------- Add two finite stream (to add the integral part)-addFiniteStream :: Stream -> Stream -> Stream-addFiniteStream xs ys = add' u v-                        where (u,v) = align xs ys------ Utility function for addFinitieStream-add' :: Stream -> Stream -> Stream-add' u v = normalise (f u v)-       where f [] [] = []-             f (x:xs) (y:ys) = (x+y):f xs ys----- Normalise the sum-normalise :: Stream -> Stream-normalise = foldr f [0]-            where f x (y:ys) = (u:v:ys)-                              where u = (x+y) `div` 2-                                    v = (x+y) `mod` 2----- Negate a stream-negate' :: Stream -> Stream-negate' = map (*(-1))------ Compute average of two stream--- Using [-2,-1,0,1,2] to add, and then divide by 2-average :: Stream -> Stream -> Stream-average xs ys = div2 (add xs ys)----- Addition of two streams, using [-2,-1,0,1,2]-add :: Stream -> Stream -> Stream-add (x:xs) (y:ys) = (x+y):(add xs ys)----- Then divided by 2, [-2,-1,0,1,2] -> [-1,0,1]-div2 :: Stream -> Stream-div2 (2:xs)             = 1:div2 xs-div2 ((-2):xs)          = (-1):div2 xs-div2 (0:xs)             = 0:div2 xs-div2 (1:(-2):xs)        = div2 (0:0:xs)-div2 (1:(-1):xs)        = div2 (0:1:xs)-div2 (1:0:xs)           = div2 (0:2:xs)-div2 (1:1:xs)           = div2 (2:(-1):xs)-div2 (1:2:xs)           = div2 (2:0:xs)-div2 ((-1):(-2):xs)     = div2 ((-2):0:xs)-div2 ((-1):(-1):xs)     = div2 ((-2):1:xs)-div2 ((-1):0:xs)        = div2 (0:(-2):xs)-div2 ((-1):1:xs)        = div2 (0:(-1):xs)-div2 ((-1):2:xs)        = div2 (0:0:xs)----test = take 100 (average (rationalToStream (1%2)) (rationalToStream (1%3)))
− tests/examples/StrictLet.hs
@@ -1,32 +0,0 @@-{-# LANGUAGE MagicHash #-}--{--If the (unboxed, hence strict) "let thunk =" would survive to the CallArity-stage, it might yield wrong results (eta-expanding thunk and hence "cond" would-be called multiple times).--It does not actually happen (CallArity sees a "case"), so this test just-safe-guards against future changes here.--}--import Debug.Trace-import GHC.Exts-import System.Environment--cond :: Int# -> Bool-cond x = trace ("cond called with " ++ show (I# x)) True-{-# NOINLINE cond #-}---bar (I# x) =-    let go n = let x = thunk n-               in case n of-                    100# -> I# x-                    _    -> go (n +# 1#)-    in go x-  where thunk = if cond x then \x -> (x +# 1#) else \x -> (x -# 1#)---main = do-    args <- getArgs-    bar (length args) `seq` return ()
− tests/examples/StringGap.hs
@@ -1,8 +0,0 @@-module StringGap where---- based on https://www.reddit.com/r/haskelltil/comments/3duhdf/haskell_ignores_all_whitespace_enclosed_in/--foo = "lorem ipsum \-      \dolor sit amet"--bar = "lorem ipsum \     \dolor sit amet"
− tests/examples/T10196.hs
@@ -1,13 +0,0 @@-module T10196 where--data X = Xᵦ | Xᵤ | Xᵩ | Xᵢ | Xᵪ | Xᵣ--f :: Int-f =-  let xᵦ = 1-      xᵤ = xᵦ-      xᵩ = xᵤ-      xᵢ = xᵩ-      xᵪ = xᵢ-      xᵣ = xᵪ-  in xᵣ
− tests/examples/T2388.hs
@@ -1,14 +0,0 @@-module T2388 where--import Data.Bits-import Data.Word-import Data.Int--test1 :: Word32 -> Char-test1 w | w .&. 0x80000000 /= 0 = 'a'-test1 _ = 'b'---- this should use a testq instruction on x86_64-test2 :: Int64 -> Char-test2 w | w .&. (-3) /= 0 = 'a'-test2 _ = 'b'
− tests/examples/T3132.hs
@@ -1,6 +0,0 @@-module T3132 where--import Data.Array.Unboxed--step :: UArray Int Double -> [Double]-step y = [y!1 + y!0]
− tests/examples/T5951.hs
@@ -1,11 +0,0 @@-module T5951 where--class A a-class B b-class C c--instance-       A =>-       B =>-       C where-         foo = undefined
− tests/examples/T7918A.hs
@@ -1,26 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}-module T7918A where--import Language.Haskell.TH-import Language.Haskell.TH.Quote--qq = QuasiQuoter {-         quoteExp  = \str -> case str of-                                "e1" -> [| True |]-                                "e2" -> [| id True |]-                                "e3" -> [| True || False |]-                                "e4" -> [| False |]-       , quoteType = \str -> case str of-                                "t1" -> [t| Bool |]-                                "t2" -> [t| Maybe Bool |]-                                "t3" -> [t| Either Bool Int |]-                                "t4" -> [t| Int |]-       , quotePat  = let x = VarP (mkName "x")-                         y = VarP (mkName "y")-                     in \str -> case str of-                                  "p1" -> return $ x-                                  "p2" -> return $ ConP 'Just [x]-                                  "p3" -> return $ TupP [x, y]-                                  "p4" -> return $ y-       , quoteDec  = undefined-       }
− tests/examples/TH.hs
@@ -1,71 +0,0 @@-{-# Language TemplateHaskell #-}---- from https://ocharles.org.uk/blog/guest-posts/2014-12-22-template-haskell.html--import Language.Haskell.TH--e1 :: IO Exp-e1 = runQ [| 1 + 2 |]--e2 :: Integer-e2 = $( return (InfixE (Just (LitE (IntegerL 1)))-                       (VarE (mkName "+"))-                       (Just (LitE (IntegerL 2)))-               )-      )--fibs :: [Integer]-fibs = 0 : 1 : zipWith (+) fibs (tail fibs)--fibQ :: Int -> Q Exp-fibQ n = [| fibs !! n |]---- e3 gives stage restriction, need to import this module to get it--- e3 = $(fibQ 22)--e4 = $(runQ [| fibs !! $( [| 8 |]) |])--e5 :: IO Exp-e5 = runQ [| 1 + 2 |]--e6 :: IO [Dec]-e6 = runQ [d|x = 5|]--e7 :: IO Type-e7 = runQ [t|Int|]--e8 :: IO Pat-e8 = runQ [p|(x,y)|]--myExp :: Q Exp; myExp = runQ [| 1 + 2 |]--e9 = runQ(myExp) >>= putStrLn.pprint---- -----------------------------------------------------------------------isPrime :: (Integral a) => a -> Bool-isPrime k | k <=1 = False | otherwise = not $ elem 0 (map (mod k)[2..k-1])--nextPrime :: (Integral a) => a -> a-nextPrime n | isPrime n = n | otherwise = nextPrime (n+1)---- returns a list of all primes between n and m, using the nextPrime function-doPrime :: (Integral a) => a -> a -> [a]-doPrime n m-        | curr > m = []-        | otherwise = curr:doPrime (curr+1) m-        where curr = nextPrime n---- and our Q expression-primeQ :: Int -> Int -> Q Exp-primeQ n m = [| doPrime n m |]---- stage restriction on e10--- e10 = $(primeQ 0 67)---- -----------------------------------------------------------------------e11 = $(stringE . show =<< reify ''Bool)---- stage restriction e12--- e12 = $(stringE . show =<< reify 'primeQ)
− tests/examples/THMonadInstance.hs
@@ -1,22 +0,0 @@-{-# LANGUAGE-  TemplateHaskell,-  MultiParamTypeClasses,-  FunctionalDependencies,-  UndecidableInstances-  #-}---genCodingInstance :: (Data c, Data h) => TypeQ -> Name -> [(c, h)] -> Q [Dec]-genCodingInstance ht ctn chs = do-  let n = const Nothing-  [d|-    instance Monad m => EncodeM m $(ht) $(conT ctn) where-      encodeM h = return $ $(-        caseE [| h |] [ match (dataToPatQ n h) (normalB (dataToExpQ n c)) [] | (c,h) <- chs ]-       )--    instance Monad m => DecodeM m $(ht) $(conT ctn) where-      decodeM c = return $ $(-        caseE [| c |] [ match (dataToPatQ n c) (normalB (dataToExpQ n h)) [] | (c,h) <- chs ]-       )-   |]
− tests/examples/TemplateHaskell.hs
@@ -1,40 +0,0 @@-{-# LANGUAGE TemplateHaskell #-}-{-# LANGUAGE QuasiQuotes #-}--foo = $footemplate--makeSplices ''Foo--old = $(old)--bar = $$bartemplate--bar = [e| quasi |]--bar = [| quasi |]--baz = [quoter| quasi |]--[t| Map.Map T.Text $tc |]--{-# ANN module $([| 1 :: Int |]) #-}--foo = [t| HT.HashTable $(varT s) Int-                   (Result $(varT str) $tt) |]--objc_emit--objc_import [""]---$(do-    return $ foreignDecl cName ("build" ++ a) ([[t| Ptr Builder |]] ++ ats ++ [[t| CString |]]) [t| Ptr $(rt) |]- )--foo = do-  let elemSize = [|sizeOf (undefined :: $(elemType))|]-      alignment _ = alignment (undefined :: $(elemType))-  return bar--class QQExp a b where-  qqExp x = [||fst $ runState $$(qqExpM x) ((0,M.empty) :: (Int,M.Map L.Name [L.Operand]))||]
− tests/examples/TooManyAnnVal.hs
@@ -1,518 +0,0 @@----- UUAGC 0.9.38.6 (./src/SistemaL.ag)-module SistemaL where-{-# LINE 3 "./src/SistemaL.ag" #-}--import Data.List-{-# LINE 9 "./src/SistemaL.hs" #-}--{-# LINE 69 "./src/SistemaL.ag" #-}--addIdentProds prods alfa-    = let prods' = map (\(Simbolo e,_) -> e) prods-          resto  = alfa \\ prods'-          iprods = map (\e -> (Simbolo e, [Simbolo e])) resto-      in prods ++ iprods--myElem _ [] = False-myElem e1 ((Simbolo e2,_):xs) = if e1 == e2-                                then True-                                else myElem e1 xs-{-# LINE 23 "./src/SistemaL.hs" #-}--{-# LINE 125 "./src/SistemaL.ag" #-}--ejemplo1 = SistemaL "Koch" alfaK initK prodK-alfaK = [Simbolo "F", Simbolo "f", Simbolo "+", Simbolo "-"]-initK = [Simbolo "F", Simbolo "a"]-prodK = [ (Simbolo "F", [Simbolo "F", Simbolo "g"])-        , (Simbolo "F", [])-        ]--ejemplo2 = SistemaL "Koch" alfaK2 initK2 prodK2-alfaK2 = [Simbolo "F", Simbolo "f", Simbolo "+", Simbolo "-"]-initK2 = [Simbolo "F", Simbolo "f"]-prodK2 = [ (Simbolo "F", [Simbolo "F", Simbolo "+"])-        , (Simbolo "f", [])-        ]--getNombre (SistemaL nm _ _ _) = nm--testSistemaL :: SistemaL -> Either [String] SistemaL-testSistemaL = sem_SistemaL-{-# LINE 45 "./src/SistemaL.hs" #-}--- Alfabeto -----------------------------------------------------type Alfabeto  = [Simbolo ]--- cata-sem_Alfabeto :: Alfabeto  ->-                T_Alfabeto-sem_Alfabeto list  =-    (Prelude.foldr sem_Alfabeto_Cons sem_Alfabeto_Nil (Prelude.map sem_Simbolo list) )--- semantic domain-type T_Alfabeto  = ([String]) ->-                   ( ([String]),([String]),Alfabeto )-sem_Alfabeto_Cons :: T_Simbolo  ->-                     T_Alfabeto  ->-                     T_Alfabeto-sem_Alfabeto_Cons hd_ tl_  =-    (\ _lhsIalf ->-         (let _tlOalf :: ([String])-              _lhsOalf :: ([String])-              _lhsOerrores :: ([String])-              _lhsOself :: Alfabeto-              _hdIself :: Simbolo-              _hdIsimb :: String-              _tlIalf :: ([String])-              _tlIerrores :: ([String])-              _tlIself :: Alfabeto-              _verificar =-                  ({-# LINE 31 "./src/SistemaL.ag" #-}-                   elem _hdIsimb _lhsIalf-                   {-# LINE 73 "./src/SistemaL.hs" #-}-                   )-              _tlOalf =-                  ({-# LINE 32 "./src/SistemaL.ag" #-}-                   if _verificar-                   then _lhsIalf-                   else _hdIsimb : _lhsIalf-                   {-# LINE 80 "./src/SistemaL.hs" #-}-                   )-              _lhsOalf =-                  ({-# LINE 35 "./src/SistemaL.ag" #-}-                   _tlIalf-                   {-# LINE 85 "./src/SistemaL.hs" #-}-                   )-              _lhsOerrores =-                  ({-# LINE 93 "./src/SistemaL.ag" #-}-                   if _verificar-                   then ("El simbolo: '" ++ _hdIsimb ++ "' esta repetido mas de una ves en el alfabeto.") : _tlIerrores-                   else _tlIerrores-                   {-# LINE 92 "./src/SistemaL.hs" #-}-                   )-              _self =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   (:) _hdIself _tlIself-                   {-# LINE 97 "./src/SistemaL.hs" #-}-                   )-              _lhsOself =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   _self-                   {-# LINE 102 "./src/SistemaL.hs" #-}-                   )-              ( _hdIself,_hdIsimb) =-                  hd_-              ( _tlIalf,_tlIerrores,_tlIself) =-                  tl_ _tlOalf-          in  ( _lhsOalf,_lhsOerrores,_lhsOself)))-sem_Alfabeto_Nil :: T_Alfabeto-sem_Alfabeto_Nil  =-    (\ _lhsIalf ->-         (let _lhsOalf :: ([String])-              _lhsOerrores :: ([String])-              _lhsOself :: Alfabeto-              _lhsOalf =-                  ({-# LINE 36 "./src/SistemaL.ag" #-}-                   _lhsIalf-                   {-# LINE 118 "./src/SistemaL.hs" #-}-                   )-              _lhsOerrores =-                  ({-# LINE 96 "./src/SistemaL.ag" #-}-                   []-                   {-# LINE 123 "./src/SistemaL.hs" #-}-                   )-              _self =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   []-                   {-# LINE 128 "./src/SistemaL.hs" #-}-                   )-              _lhsOself =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   _self-                   {-# LINE 133 "./src/SistemaL.hs" #-}-                   )-          in  ( _lhsOalf,_lhsOerrores,_lhsOself)))--- Inicio -------------------------------------------------------type Inicio  = [Simbolo ]--- cata-sem_Inicio :: Inicio  ->-              T_Inicio-sem_Inicio list  =-    (Prelude.foldr sem_Inicio_Cons sem_Inicio_Nil (Prelude.map sem_Simbolo list) )--- semantic domain-type T_Inicio  = ([String]) ->-                 ( ([String]),Inicio )-sem_Inicio_Cons :: T_Simbolo  ->-                   T_Inicio  ->-                   T_Inicio-sem_Inicio_Cons hd_ tl_  =-    (\ _lhsIalfabeto ->-         (let _lhsOerrores :: ([String])-              _lhsOself :: Inicio-              _tlOalfabeto :: ([String])-              _hdIself :: Simbolo-              _hdIsimb :: String-              _tlIerrores :: ([String])-              _tlIself :: Inicio-              _lhsOerrores =-                  ({-# LINE 99 "./src/SistemaL.ag" #-}-                   if elem _hdIsimb _lhsIalfabeto-                   then _tlIerrores-                   else ("El simbolo de inicio: '" ++ _hdIsimb ++ "' no se encuentra en el alfabeto.") : _tlIerrores-                   {-# LINE 163 "./src/SistemaL.hs" #-}-                   )-              _self =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   (:) _hdIself _tlIself-                   {-# LINE 168 "./src/SistemaL.hs" #-}-                   )-              _lhsOself =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   _self-                   {-# LINE 173 "./src/SistemaL.hs" #-}-                   )-              _tlOalfabeto =-                  ({-# LINE 39 "./src/SistemaL.ag" #-}-                   _lhsIalfabeto-                   {-# LINE 178 "./src/SistemaL.hs" #-}-                   )-              ( _hdIself,_hdIsimb) =-                  hd_-              ( _tlIerrores,_tlIself) =-                  tl_ _tlOalfabeto-          in  ( _lhsOerrores,_lhsOself)))-sem_Inicio_Nil :: T_Inicio-sem_Inicio_Nil  =-    (\ _lhsIalfabeto ->-         (let _lhsOerrores :: ([String])-              _lhsOself :: Inicio-              _lhsOerrores =-                  ({-# LINE 102 "./src/SistemaL.ag" #-}-                   []-                   {-# LINE 193 "./src/SistemaL.hs" #-}-                   )-              _self =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   []-                   {-# LINE 198 "./src/SistemaL.hs" #-}-                   )-              _lhsOself =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   _self-                   {-# LINE 203 "./src/SistemaL.hs" #-}-                   )-          in  ( _lhsOerrores,_lhsOself)))--- Produccion ---------------------------------------------------type Produccion  = ( Simbolo ,Succesor )--- cata-sem_Produccion :: Produccion  ->-                  T_Produccion-sem_Produccion ( x1,x2)  =-    (sem_Produccion_Tuple (sem_Simbolo x1 ) (sem_Succesor x2 ) )--- semantic domain-type T_Produccion  = ([String]) ->-                     ( ([String]),Produccion ,String)-sem_Produccion_Tuple :: T_Simbolo  ->-                        T_Succesor  ->-                        T_Produccion-sem_Produccion_Tuple x1_ x2_  =-    (\ _lhsIalfabeto ->-         (let _lhsOerrores :: ([String])-              _lhsOself :: Produccion-              _lhsOsimb :: String-              _x2Oalfabeto :: ([String])-              _x1Iself :: Simbolo-              _x1Isimb :: String-              _x2Ierrores :: ([String])-              _x2Iself :: Succesor-              _lhsOerrores =-                  ({-# LINE 114 "./src/SistemaL.ag" #-}-                   if elem _x1Isimb _lhsIalfabeto-                   then _x2Ierrores-                   else ("El simbolo de la produccion (izq): '" ++ _x1Isimb ++ "' no se encuentra en el alfabeto.") : _x2Ierrores-                   {-# LINE 234 "./src/SistemaL.hs" #-}-                   )-              _self =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   (_x1Iself,_x2Iself)-                   {-# LINE 239 "./src/SistemaL.hs" #-}-                   )-              _lhsOself =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   _self-                   {-# LINE 244 "./src/SistemaL.hs" #-}-                   )-              _lhsOsimb =-                  ({-# LINE 45 "./src/SistemaL.ag" #-}-                   _x1Isimb-                   {-# LINE 249 "./src/SistemaL.hs" #-}-                   )-              _x2Oalfabeto =-                  ({-# LINE 39 "./src/SistemaL.ag" #-}-                   _lhsIalfabeto-                   {-# LINE 254 "./src/SistemaL.hs" #-}-                   )-              ( _x1Iself,_x1Isimb) =-                  x1_-              ( _x2Ierrores,_x2Iself) =-                  x2_ _x2Oalfabeto-          in  ( _lhsOerrores,_lhsOself,_lhsOsimb)))--- Producciones -------------------------------------------------type Producciones  = [Produccion ]--- cata-sem_Producciones :: Producciones  ->-                    T_Producciones-sem_Producciones list  =-    (Prelude.foldr sem_Producciones_Cons sem_Producciones_Nil (Prelude.map sem_Produccion list) )--- semantic domain-type T_Producciones  = ([String]) ->-                       Producciones ->-                       ( ([String]),Producciones)-sem_Producciones_Cons :: T_Produccion  ->-                         T_Producciones  ->-                         T_Producciones-sem_Producciones_Cons hd_ tl_  =-    (\ _lhsIalfabeto-       _lhsIprods ->-         (let _tlOprods :: Producciones-              _lhsOprods :: Producciones-              _lhsOerrores :: ([String])-              _hdOalfabeto :: ([String])-              _tlOalfabeto :: ([String])-              _hdIerrores :: ([String])-              _hdIself :: Produccion-              _hdIsimb :: String-              _tlIerrores :: ([String])-              _tlIprods :: Producciones-              _verificar =-                  ({-# LINE 60 "./src/SistemaL.ag" #-}-                   myElem _hdIsimb _lhsIprods-                   {-# LINE 291 "./src/SistemaL.hs" #-}-                   )-              _tlOprods =-                  ({-# LINE 61 "./src/SistemaL.ag" #-}-                   if _verificar-                   then _lhsIprods-                   else _hdIself : _lhsIprods-                   {-# LINE 298 "./src/SistemaL.hs" #-}-                   )-              _lhsOprods =-                  ({-# LINE 64 "./src/SistemaL.ag" #-}-                   _tlIprods-                   {-# LINE 303 "./src/SistemaL.hs" #-}-                   )-              _lhsOerrores =-                  ({-# LINE 105 "./src/SistemaL.ag" #-}-                   if _verificar-                   then let error = "La produccion con el simb. izq.:'"-                                 ++ _hdIsimb-                                 ++ "' esta repetida mas de una ves en la lista de producciones."-                        in (error : _hdIerrores) ++ _tlIerrores-                   else _hdIerrores ++ _tlIerrores-                   {-# LINE 313 "./src/SistemaL.hs" #-}-                   )-              _hdOalfabeto =-                  ({-# LINE 39 "./src/SistemaL.ag" #-}-                   _lhsIalfabeto-                   {-# LINE 318 "./src/SistemaL.hs" #-}-                   )-              _tlOalfabeto =-                  ({-# LINE 39 "./src/SistemaL.ag" #-}-                   _lhsIalfabeto-                   {-# LINE 323 "./src/SistemaL.hs" #-}-                   )-              ( _hdIerrores,_hdIself,_hdIsimb) =-                  hd_ _hdOalfabeto-              ( _tlIerrores,_tlIprods) =-                  tl_ _tlOalfabeto _tlOprods-          in  ( _lhsOerrores,_lhsOprods)))-sem_Producciones_Nil :: T_Producciones-sem_Producciones_Nil  =-    (\ _lhsIalfabeto-       _lhsIprods ->-         (let _lhsOerrores :: ([String])-              _lhsOprods :: Producciones-              _lhsOerrores =-                  ({-# LINE 111 "./src/SistemaL.ag" #-}-                   []-                   {-# LINE 339 "./src/SistemaL.hs" #-}-                   )-              _lhsOprods =-                  ({-# LINE 58 "./src/SistemaL.ag" #-}-                   _lhsIprods-                   {-# LINE 344 "./src/SistemaL.hs" #-}-                   )-          in  ( _lhsOerrores,_lhsOprods)))--- Simbolo ------------------------------------------------------data Simbolo  = Simbolo (String)-              deriving ( Eq,Show)--- cata-sem_Simbolo :: Simbolo  ->-               T_Simbolo-sem_Simbolo (Simbolo _string )  =-    (sem_Simbolo_Simbolo _string )--- semantic domain-type T_Simbolo  = ( Simbolo ,String)-sem_Simbolo_Simbolo :: String ->-                       T_Simbolo-sem_Simbolo_Simbolo string_  =-    (let _lhsOsimb :: String-         _lhsOself :: Simbolo-         _lhsOsimb =-             ({-# LINE 47 "./src/SistemaL.ag" #-}-              string_-              {-# LINE 365 "./src/SistemaL.hs" #-}-              )-         _self =-             ({-# LINE 57 "./src/SistemaL.ag" #-}-              Simbolo string_-              {-# LINE 370 "./src/SistemaL.hs" #-}-              )-         _lhsOself =-             ({-# LINE 57 "./src/SistemaL.ag" #-}-              _self-              {-# LINE 375 "./src/SistemaL.hs" #-}-              )-     in  ( _lhsOself,_lhsOsimb))--- SistemaL -----------------------------------------------------data SistemaL  = SistemaL (String) (Alfabeto ) (Inicio ) (Producciones )-               deriving ( Show)--- cata-sem_SistemaL :: SistemaL  ->-                T_SistemaL-sem_SistemaL (SistemaL _nombre _alfabeto _inicio _producciones )  =-    (sem_SistemaL_SistemaL _nombre (sem_Alfabeto _alfabeto ) (sem_Inicio _inicio ) (sem_Producciones _producciones ) )--- semantic domain-type T_SistemaL  = ( (Either [String] SistemaL))-sem_SistemaL_SistemaL :: String ->-                         T_Alfabeto  ->-                         T_Inicio  ->-                         T_Producciones  ->-                         T_SistemaL-sem_SistemaL_SistemaL nombre_ alfabeto_ inicio_ producciones_  =-    (let _alfabetoOalf :: ([String])-         _inicioOalfabeto :: ([String])-         _produccionesOalfabeto :: ([String])-         _lhsOresultado :: (Either [String] SistemaL)-         _produccionesOprods :: Producciones-         _alfabetoIalf :: ([String])-         _alfabetoIerrores :: ([String])-         _alfabetoIself :: Alfabeto-         _inicioIerrores :: ([String])-         _inicioIself :: Inicio-         _produccionesIerrores :: ([String])-         _produccionesIprods :: Producciones-         _alfabetoOalf =-             ({-# LINE 28 "./src/SistemaL.ag" #-}-              []-              {-# LINE 409 "./src/SistemaL.hs" #-}-              )-         _inicioOalfabeto =-             ({-# LINE 41 "./src/SistemaL.ag" #-}-              _alfabetoIalf-              {-# LINE 414 "./src/SistemaL.hs" #-}-              )-         _produccionesOalfabeto =-             ({-# LINE 42 "./src/SistemaL.ag" #-}-              _alfabetoIalf-              {-# LINE 419 "./src/SistemaL.hs" #-}-              )-         _lhsOresultado =-             ({-# LINE 52 "./src/SistemaL.ag" #-}-              if null _errores-              then let producciones = addIdentProds _produccionesIprods _alfabetoIalf-                   in Right (SistemaL nombre_ _alfabetoIself _inicioIself producciones)-              else Left _errores-              {-# LINE 427 "./src/SistemaL.hs" #-}-              )-         _produccionesOprods =-             ({-# LINE 67 "./src/SistemaL.ag" #-}-              []-              {-# LINE 432 "./src/SistemaL.hs" #-}-              )-         _errores =-             ({-# LINE 85 "./src/SistemaL.ag" #-}-              let inicioErr = if null _inicioIself-                              then "La lista de simbolos de inicio no puede ser vacia" : _inicioIerrores-                              else _inicioIerrores-                  errores   = map (\err -> nombre_ ++ ": " ++ err) (_alfabetoIerrores ++ inicioErr ++ _produccionesIerrores)-              in errores-              {-# LINE 441 "./src/SistemaL.hs" #-}-              )-         ( _alfabetoIalf,_alfabetoIerrores,_alfabetoIself) =-             alfabeto_ _alfabetoOalf-         ( _inicioIerrores,_inicioIself) =-             inicio_ _inicioOalfabeto-         ( _produccionesIerrores,_produccionesIprods) =-             producciones_ _produccionesOalfabeto _produccionesOprods-     in  ( _lhsOresultado))--- Succesor -----------------------------------------------------type Succesor  = [Simbolo ]--- cata-sem_Succesor :: Succesor  ->-                T_Succesor-sem_Succesor list  =-    (Prelude.foldr sem_Succesor_Cons sem_Succesor_Nil (Prelude.map sem_Simbolo list) )--- semantic domain-type T_Succesor  = ([String]) ->-                   ( ([String]),Succesor )-sem_Succesor_Cons :: T_Simbolo  ->-                     T_Succesor  ->-                     T_Succesor-sem_Succesor_Cons hd_ tl_  =-    (\ _lhsIalfabeto ->-         (let _lhsOerrores :: ([String])-              _lhsOself :: Succesor-              _tlOalfabeto :: ([String])-              _hdIself :: Simbolo-              _hdIsimb :: String-              _tlIerrores :: ([String])-              _tlIself :: Succesor-              _lhsOerrores =-                  ({-# LINE 119 "./src/SistemaL.ag" #-}-                   if elem _hdIsimb _lhsIalfabeto-                   then _tlIerrores-                   else ("El simbolo de la produccion (der): '" ++ _hdIsimb ++ "' no se encuentra en el alfabeto.") : _tlIerrores-                   {-# LINE 477 "./src/SistemaL.hs" #-}-                   )-              _self =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   (:) _hdIself _tlIself-                   {-# LINE 482 "./src/SistemaL.hs" #-}-                   )-              _lhsOself =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   _self-                   {-# LINE 487 "./src/SistemaL.hs" #-}-                   )-              _tlOalfabeto =-                  ({-# LINE 39 "./src/SistemaL.ag" #-}-                   _lhsIalfabeto-                   {-# LINE 492 "./src/SistemaL.hs" #-}-                   )-              ( _hdIself,_hdIsimb) =-                  hd_-              ( _tlIerrores,_tlIself) =-                  tl_ _tlOalfabeto-          in  ( _lhsOerrores,_lhsOself)))-sem_Succesor_Nil :: T_Succesor-sem_Succesor_Nil  =-    (\ _lhsIalfabeto ->-         (let _lhsOerrores :: ([String])-              _lhsOself :: Succesor-              _lhsOerrores =-                  ({-# LINE 122 "./src/SistemaL.ag" #-}-                   []-                   {-# LINE 507 "./src/SistemaL.hs" #-}-                   )-              _self =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   []-                   {-# LINE 512 "./src/SistemaL.hs" #-}-                   )-              _lhsOself =-                  ({-# LINE 57 "./src/SistemaL.ag" #-}-                   _self-                   {-# LINE 517 "./src/SistemaL.hs" #-}-                   )-          in  ( _lhsOerrores,_lhsOself)))
− tests/examples/TransformListComp.hs
@@ -1,7 +0,0 @@-{-# LANGUAGE TransformListComp #-}--oldest :: [Int] -> [String]-oldest tbl = [ "str"-             | n <- tbl-             , then id-             ]
− tests/examples/Trit.hs
@@ -1,112 +0,0 @@-module Trit (Trit, rationalToTrit, getIntegral, getFraction, getFraction',-                neg, addTrits, subTrits, shiftLeft, shiftRight, multiply-                ) where--import Stream-import Utilities-import Data.Ratio--type Mantissa = Stream-type Fraction = Stream-type Trit     = (Mantissa, Fraction)----- Convert from a Rational number to its Trit representation (Integral, Fraction)-rationalToTrit :: Rational -> Trit-rationalToTrit x-                |x<1            = ([0], rationalToStream x)-                |otherwise      = (u', rationalToStream v)-                where   u = n `div` d-                        u' = toBinary u-                        v = x - (toRational u)-                        n = numerator x-                        d = denominator x----- Get the integral part of Trit-getIntegral :: Trit -> Mantissa-getIntegral = fst------ Get the fraction part of Trit, with n digit of the stream-getFraction :: Int -> Trit -> Stream-getFraction n = take n. snd----- Get the fraction part of Trit-getFraction' :: Trit -> Stream-getFraction' = snd------ Negate a Trit-neg :: Trit -> Trit-neg (a, b) = (negate' a, negate' b)------ Add two Trits-addTrits :: Trit -> Trit -> Trit-addTrits (m1, (x1:x2:xs)) (m2, (y1:y2:ys)) = (u,addStream (x1:x2:xs) (y1:y2:ys))-                                           where u' = addFiniteStream m1 m2-                                                 c = [carry x1 x2 y1 y2]-                                                 u = addFiniteStream u' c------ Substraction of 2 Trits-subTrits :: Trit -> Trit -> Trit-subTrits x y = addTrits x (neg y)------ Shift left = *2 opertaion with Trit-shiftLeft :: Trit -> Trit-shiftLeft (x, (y:ys)) = (x++ [y], ys)----- Shift right = /2 operation with Trit-shiftRight :: Trit -> Integer -> Trit-shiftRight (x, xs) 1 = (init x, (u:xs))-                    where u = last x-shiftRight (x, xs) n = shiftRight (init x, (u:xs)) (n-1)-                    where u = last x------ Multiply a Trit stream by 1,0 or -1, simply return the stream-mulOneDigit :: Integer -> Stream -> Stream-mulOneDigit x xs-              |x==1      = xs-              |x==0      = zero'-              |otherwise = negate' xs-              where zero' = (0:zero')--------- Multiplication of two streams-multiply :: Stream -> Stream -> Stream-multiply (a0:a1:x) (b0:b1:y) = average p q-                               where p = average (a1*b0: (average (mulOneDigit b1 x)-                                                                 (mulOneDigit a1 y)))-                                                 (average (mulOneDigit b0 x)-                                                          (mulOneDigit a0 y))-                                     q = (a0*b0:a0*b1:a1*b1:(multiply x y))-----start0 = take 30 (multiply (rationalToStream (1%2)) zo)--zo :: Stream-zo = 1:(-1):zero-     where zero = 0:zero--start1 = take 30 (average (rationalToStream (1%2)) (negate' (rationalToStream (1%4))))---
− tests/examples/Tuple.hs
@@ -1,4 +0,0 @@-{-# LANGUAGE TupleSections #-}--baz = (1, "hello", 6.5,,) 'a' (Just ())-
− tests/examples/TupleSections.hs
@@ -1,21 +0,0 @@-{-# LANGUAGE TupleSections #-}--foo = do-  liftIO $ atomicModifyIORef ciTokens ((,()) . f)-  liftIO $ atomicModifyIORef ciTokens (((),) . f)-  liftIO $ atomicModifyIORef ciTokens ((,) . f)---- | Make bilateral dictionary from PoliMorf.-mkPoli :: [P.Entry] -> Poli-mkPoli = mkBila . map ((,,(),,()) <$> P.base <*> P.pos <*> P.form)--foo = baz-  where-    _1 = ((,Nothing,Nothing,Nothing,Nothing,Nothing) . Just <$>)-    _2 = ((Nothing,,Nothing,Nothing,Nothing,Nothing) . Just <$>)-    _3 = ((Nothing,Nothing,,Nothing,Nothing,Nothing) . Just <$>)-    _4 = ((Nothing,Nothing,Nothing,,Nothing,Nothing) . Just <$>)-    _5 = ((Nothing,Nothing,Nothing,Nothing,,Nothing) . Just <$>)-    _6 = ((Nothing,Nothing,Nothing,Nothing,Nothing,) . Just <$>)--foo = (,,(),,,())
− tests/examples/TypeBrackets.hs
@@ -1,11 +0,0 @@-{-# LANGUAGE ScopedTypeVariables #-}--foo (f :: (Maybe t -> Int)) =-     undefined--type (((f `ObjectsFUnder` a))) = ConstF f a :/\: f-type   (f `ObjectsFOver`  a)   = f :/\: ConstF f a--type (c `ObjectsUnder` a) = Id c `ObjectsFUnder` a-type (c `ObjectsOver`  a) = Id c `ObjectsFOver`  a-
− tests/examples/TypeBrackets2.hs
@@ -1,23 +0,0 @@-{-# LANGUAGE StandaloneDeriving #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE RankNTypes #-}-{-# LANGUAGE FlexibleInstances #-}----- | The style and color attributes can either be the terminal defaults. Or be equivalent to the--- previously applied style. Or be a specific value.-data MaybeDefault v where-    Default :: MaybeDefault v-    KeepCurrent :: MaybeDefault v-    SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v-    SetTo2 :: (Eq a) => forall v . ( Eq v, Show v ) => !v -> a -> MaybeDefault v--bar :: forall v . (( Eq v, Show v ) => v -> MaybeDefault v -> a -> [a])-baz :: (Eq a) => forall v . ( Eq v, Show v ) => !v -> a -> MaybeDefault v--instance Dsp (S n) where-  data (ASig (S n)) = S_A CVar-  data (KSig (S n)) = S_K CVar-  data (INum (S n)) = S_I CVar-  getSr    = fst <$> ask-  getKsmps = snd <$> ask
− tests/examples/TypeBrackets3.hs
@@ -1,15 +0,0 @@-{-# LANGUAGE KindSignatures #-}-{-# LANGUAGE TypeOperators #-}-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE ExplicitNamespaces #-}--module Network.Routing.Dict-    ( -- * store-      Store-    , emptyStore-    , type ( Members ["foo" := Int, "bar" := Double] prms == (Member "foo" Int prms, Member "bar" Double prms)----type family   Members (kvs :: [KV *]) (prms :: [KV *]) :: Constraint-type instance Members '[] prms = ()-type instance Members (k := v ': kvs) prms = (Member k v prms, Members kvs prms)
− tests/examples/TypeBrackets4.hs
@@ -1,8 +0,0 @@-{-# LANGUAGE DataKinds, PolyKinds, TypeOperators, TypeFamilies #-}---type family ((a :: Bool) || (b :: Bool)) :: Bool-type instance 'True  || a = 'True-type instance a || 'True  = 'True-type instance 'False || a = a-type instance a || 'False = a
− tests/examples/TypeFamilies.hs
@@ -1,77 +0,0 @@-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE TypeFamilies #-}---- From https://ocharles.org.uk/blog/posts/2014-12-12-type-families.html--import Control.Concurrent.STM-import Control.Concurrent.MVar-import Data.Foldable (forM_)-import Data.IORef--class IOStore store where-  newIO :: a -> IO (store a)-  getIO :: store a -> IO a-  putIO :: store a -> a -> IO ()--instance IOStore MVar where-  newIO = newMVar-  getIO = readMVar-  putIO mvar a = modifyMVar_ mvar (return . const a)--instance IOStore IORef where-  newIO = newIORef-  getIO = readIORef-  putIO ioref a = modifyIORef ioref (const a)--type Present = String-storePresentsIO :: IOStore store => [Present] -> IO (store [Present])-storePresentsIO xs = do-  store <- newIO []-  forM_ xs $ \x -> do-    old <- getIO store-    putIO store (x : old)-  return store---- Type family version--class Store store where-  type StoreMonad store :: * -> *-  new :: a -> (StoreMonad store) (store a)-  get :: store a -> (StoreMonad store) a-  put :: store a -> a -> (StoreMonad store) ()--instance Store IORef where-  type StoreMonad IORef = IO-  new = newIORef-  get = readIORef-  put ioref a = modifyIORef ioref (const a)--instance Store TVar where-  type StoreMonad TVar = STM-  new = newTVar-  get = readTVar-  put ioref a = modifyTVar ioref (const a)--storePresents :: (Store store, Monad (StoreMonad store))-              => [Present] -> (StoreMonad store) (store [Present])-storePresents xs = do-  store <- new []-  forM_ xs $ \x -> do-    old <- get store-    put store (x : old)-  return store--type family (++) (a :: [k]) (b :: [k]) :: [k] where-    '[]       ++ b = b-    (a ': as) ++ b = a ': (as ++ b)--type family (f :: * -> *) |> (s :: * -> *) :: * -> *--type instance f |> Union s = Union (f :> s)--type family Compare (a :: k) (b :: k') :: Ordering where-  Compare '() '() = EQ--type family (r1 :++: r2); infixr 5 :++:-type instance r :++: Nil = r-type instance r1 :++: r2 :> a = (r1 :++: r2) :> a
− tests/examples/TypeFamilies2.hs
@@ -1,10 +0,0 @@-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE TypeFamilies #-}--type family (++) (a :: [k]) (b :: [k]) :: [k] where-    '[]       ++ b = b-    (a ': as) ++ b = a ': (as ++ b)--type family F a :: * -> * -> *-type instance F Int = (->)-type instance F Char = ( ,  )
− tests/examples/TypeInstance.hs
@@ -1,11 +0,0 @@-{-# LANGUAGE TypeOperators #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE DefaultSignatures #-}-{-# LANGUAGE UndecidableInstances #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE Trustworthy #-}--class TrieKey k where-  type instance TrieRep k = TrieRepDefault k
− tests/examples/TypeOperators.hs
@@ -1,72 +0,0 @@-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE OverlappingInstances #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE TypeOperators #-}---- From https://ocharles.org.uk/blog/posts/2014-12-08-type-operators.html--import Data.String--data I a = I { unI :: a }-data Var a x = Var { unK :: a }--infixr 8 +-data ((f + g)) a = InL (f a) | InR (g a)--- data (f + g) a = InL (f a) | InR (g a)--class sub :<: sup where-  inj :: sub a -> sup a--instance (sym :<: sym) where-  inj = id--instance (sym1 :<: (sym1 + sym2)) where inj = InL--instance (sym1 :<: sym3) => (sym1 :<: (sym2 + sym3)) where-  inj = InR . inj--instance (I :<: g, IsString s) => IsString ((f + g) s) where-  fromString = inj . I . fromString--var :: (Var a :<: f) => a -> f e-var = inj . Var--elim :: (I :<: f) => (a -> b) -> (Var a + f) b -> f b-elim eval f =-  case f of-    InL (Var xs) -> inj (I (eval xs))-    InR g        -> g------------------------------------------------------------------------------------data UserVar = UserName--data ChristmasVar = ChristmasPresent--email :: [(Var UserVar + Var ChristmasVar + I) String]-email = [ "Dear "-        , var UserName-        , ", thank you for your recent email to Santa & Santa Inc."-        , "You have asked for a: "-        , var ChristmasPresent-        ]--main :: IO ()-main =-  do name <- getLine-     present <- getLine-     putStrLn (concatMap (unI .-                          (elim (\ChristmasPresent -> present) .-                           elim (\UserName -> name)))-                         email)--{---*Main> main-Ollie-Lambda Necklace-Dear Ollie, thank you for your recent email to Santa & Santa Inc.You have asked for a: Lambda Necklace---}
− tests/examples/TypeSignature.hs
@@ -1,12 +0,0 @@-module TypeSignature where--{- Lifting baz to the top level should bring in xx and a as parameters,-   and update the signature to include these--}-foo a = (baz xx a)-  where-    xx :: Int -> Int -> Int-    xx p1 p2 = p1 + p2--baz :: (Int -> Int -> Int) -> Int ->Int-baz xx a = xx 1 a
− tests/examples/TypeSignatureParens.hs
@@ -1,7 +0,0 @@-{-# LANGUAGE ScopedTypeVariables #-}--pTokenCost :: forall loc state a .((Show a, Eq a,  loc `IsLocationUpdatedBy` a, LL.ListLike state a) => [a] -> Int -> P (Str  a state loc) [a])-pTokenCost as cost = 5--pTokenCostStr :: forall a .((Show a) => [a] -> Int -> String)-pTokenCostStr as cost = "5"
− tests/examples/TypeSynOperator.hs
@@ -1,3 +0,0 @@-{-# LANGUAGE TypeOperators #-}--type a :-> t = a
− tests/examples/TypeSynParens.hs
@@ -1,19 +0,0 @@-{-# LANGUAGE TypeFamilies #-}--class Compilable a where-   type CompileResult a :: *--instance Compilable a => Compilable [a] where-   type CompileResult [a] = [CompileResult a]--instance Compilable a => Compilable (Maybe a) where-   type CompileResult (Maybe a) = Maybe (CompileResult a)--instance Compilable InterpreterStmt where-   type CompileResult InterpreterStmt = [Hask.Stmt]--instance Compilable ModuleSpan where-   type CompileResult ModuleSpan = Hask.Module--instance Compilable StatementSpan where-   type (CompileResult StatementSpan) = [Stmt]
− tests/examples/Unboxed.hs
@@ -1,30 +0,0 @@-{-# LANGUAGE UnboxedTuples #-}-module Layout.Unboxed where--a,b :: Int-a = 1-b = 2--c :: Maybe (a -> b)-c = Nothing--f :: (Num a1, Num a) => a -> a1 -> (# a, a1 #)-f x y = (# x+1, y-1 #)--f1 :: (Num a1, Num a) => a -> a1 -> (# , #) a a1-f1 x y = (# , #) x+1 y-1--g :: Num a => a -> a-g x = case f x x of { (# a, b #) -> a + b }--- -- Pattern bind-tup :: (Int, Int)-h :: Int-t :: Int-tup@(h,t) = head $ zip [1..10] [3..ff]-  where-    ff :: Int-    ff = 15--
− tests/examples/Undefined10.hs
@@ -1,643 +0,0 @@-{--    Copyright 2013-2015 Mario Blazevic--    License: BSD3 (see BSD3-LICENSE.txt file)--}---- | This module defines the 'FactorialMonoid' class and some of its instances.-----{-# LANGUAGE Haskell2010, Trustworthy #-}--module Data.Monoid.Factorial (-   -- * Classes-   FactorialMonoid(..), StableFactorialMonoid,-   -- * Monad function equivalents-   mapM, mapM_-   )-where--import Prelude hiding (break, drop, dropWhile, foldl, foldMap, foldr, last, length, map, mapM, mapM_, max, min,-                       null, reverse, span, splitAt, take, takeWhile)--import Control.Arrow (first)-import qualified Control.Monad as Monad-import Data.Monoid (Monoid (..), Dual(..), Sum(..), Product(..), Endo(Endo, appEndo))-import qualified Data.Foldable as Foldable-import qualified Data.List as List-import qualified Data.ByteString as ByteString-import qualified Data.ByteString.Lazy as LazyByteString-import qualified Data.Text as Text-import qualified Data.Text.Lazy as LazyText-import qualified Data.IntMap as IntMap-import qualified Data.IntSet as IntSet-import qualified Data.Map as Map-import qualified Data.Sequence as Sequence-import qualified Data.Set as Set-import qualified Data.Vector as Vector-import Data.Int (Int64)-import Data.Numbers.Primes (primeFactors)--import Data.Monoid.Null (MonoidNull(null), PositiveMonoid)---- | Class of monoids that can be split into irreducible (/i.e./, atomic or prime) 'factors' in a unique way. Factors of--- a 'Product' are literally its prime factors:------ prop> factors (Product 12) == [Product 2, Product 2, Product 3]------ Factors of a list are /not/ its elements but all its single-item sublists:------ prop> factors "abc" == ["a", "b", "c"]------ The methods of this class satisfy the following laws:------ > mconcat . factors == id--- > null == List.null . factors--- > List.all (\prime-> factors prime == [prime]) . factors--- > factors == unfoldr splitPrimePrefix == List.reverse . unfoldr (fmap swap . splitPrimeSuffix)--- > reverse == mconcat . List.reverse . factors--- > primePrefix == maybe mempty fst . splitPrimePrefix--- > primeSuffix == maybe mempty snd . splitPrimeSuffix--- > inits == List.map mconcat . List.tails . factors--- > tails == List.map mconcat . List.tails . factors--- > foldl f a == List.foldl f a . factors--- > foldl' f a == List.foldl' f a . factors--- > foldr f a == List.foldr f a . factors--- > span p m == (mconcat l, mconcat r) where (l, r) = List.span p (factors m)--- > List.all (List.all (not . pred) . factors) . split pred--- > mconcat . intersperse prime . split (== prime) == id--- > splitAt i m == (mconcat l, mconcat r) where (l, r) = List.splitAt i (factors m)--- > spanMaybe () (const $ bool Nothing (Maybe ()) . p) m == (takeWhile p m, dropWhile p m, ())--- > spanMaybe s0 (\s m-> Just $ f s m) m0 == (m0, mempty, foldl f s0 m0)--- > let (prefix, suffix, s') = spanMaybe s f m--- >     foldMaybe = foldl g (Just s)--- >     g s m = s >>= flip f m--- > in all ((Nothing ==) . foldMaybe) (inits prefix)--- >    && prefix == last (filter (isJust . foldMaybe) $ inits m)--- >    && Just s' == foldMaybe prefix--- >    && m == prefix <> suffix------ A minimal instance definition must implement 'factors' or 'splitPrimePrefix'. Other methods are provided and should--- be implemented only for performance reasons.-class MonoidNull m => FactorialMonoid m where-   -- | Returns a list of all prime factors; inverse of mconcat.-   factors :: m -> [m]-   -- | The prime prefix, 'mempty' if none.-   primePrefix :: m -> m-   -- | The prime suffix, 'mempty' if none.-   primeSuffix :: m -> m-   -- | Splits the argument into its prime prefix and the remaining suffix. Returns 'Nothing' for 'mempty'.-   splitPrimePrefix :: m -> Maybe (m, m)-   -- | Splits the argument into its prime suffix and the remaining prefix. Returns 'Nothing' for 'mempty'.-   splitPrimeSuffix :: m -> Maybe (m, m)-   -- | Returns the list of all prefixes of the argument, 'mempty' first.-   inits :: m -> [m]-   -- | Returns the list of all suffixes of the argument, 'mempty' last.-   tails :: m -> [m]-   -- | Like 'List.foldl' from "Data.List" on the list of 'primes'.-   foldl :: (a -> m -> a) -> a -> m -> a-   -- | Like 'List.foldl'' from "Data.List" on the list of 'primes'.-   foldl' :: (a -> m -> a) -> a -> m -> a-   -- | Like 'List.foldr' from "Data.List" on the list of 'primes'.-   foldr :: (m -> a -> a) -> a -> m -> a-   -- | The 'length' of the list of 'primes'.-   length :: m -> Int-   -- | Generalizes 'foldMap' from "Data.Foldable", except the function arguments are prime factors rather than the-   -- structure elements.-   foldMap :: Monoid n => (m -> n) -> m -> n-   -- | Like 'List.span' from "Data.List" on the list of 'primes'.-   span :: (m -> Bool) -> m -> (m, m)-   -- | Equivalent to 'List.break' from "Data.List".-   break :: (m -> Bool) -> m -> (m, m)-   -- | Splits the monoid into components delimited by prime separators satisfying the given predicate. The primes-   -- satisfying the predicate are not a part of the result.-   split :: (m -> Bool) -> m -> [m]-   -- | Equivalent to 'List.takeWhile' from "Data.List".-   takeWhile :: (m -> Bool) -> m -> m-   -- | Equivalent to 'List.dropWhile' from "Data.List".-   dropWhile :: (m -> Bool) -> m -> m-   -- | A stateful variant of 'span', threading the result of the test function as long as it returns 'Just'.-   spanMaybe :: s -> (s -> m -> Maybe s) -> m -> (m, m, s)-   -- | Strict version of 'spanMaybe'.-   spanMaybe' :: s -> (s -> m -> Maybe s) -> m -> (m, m, s)-   -- | Like 'List.splitAt' from "Data.List" on the list of 'primes'.-   splitAt :: Int -> m -> (m, m)-   -- | Equivalent to 'List.drop' from "Data.List".-   drop :: Int -> m -> m-   -- | Equivalent to 'List.take' from "Data.List".-   take :: Int -> m -> m-   -- | Equivalent to 'List.reverse' from "Data.List".-   reverse :: m -> m--   factors = List.unfoldr splitPrimePrefix-   primePrefix = maybe mempty fst . splitPrimePrefix-   primeSuffix = maybe mempty snd . splitPrimeSuffix-   splitPrimePrefix x = case factors x-                        of [] -> Nothing-                           prefix : rest -> Just (prefix, mconcat rest)-   splitPrimeSuffix x = case factors x-                        of [] -> Nothing-                           fs -> Just (mconcat (List.init fs), List.last fs)-   inits = foldr (\m l-> mempty : List.map (mappend m) l) [mempty]-   tails m = m : maybe [] (tails . snd) (splitPrimePrefix m)-   foldl f f0 = List.foldl f f0 . factors-   foldl' f f0 = List.foldl' f f0 . factors-   foldr f f0 = List.foldr f f0 . factors-   length = List.length . factors-   foldMap f = foldr (mappend . f) mempty-   span p m0 = spanAfter id m0-      where spanAfter f m = case splitPrimePrefix m-                            of Just (prime, rest) | p prime -> spanAfter (f . mappend prime) rest-                               _ -> (f mempty, m)-   break = span . (not .)-   spanMaybe s0 f m0 = spanAfter id s0 m0-      where spanAfter g s m = case splitPrimePrefix m-                              of Just (prime, rest) | Just s' <- f s prime -> spanAfter (g . mappend prime) s' rest-                                                    | otherwise -> (g mempty, m, s)-                                 Nothing -> (m0, m, s)-   spanMaybe' s0 f m0 = spanAfter id s0 m0-      where spanAfter g s m = seq s $-                              case splitPrimePrefix m-                              of Just (prime, rest) | Just s' <- f s prime -> spanAfter (g . mappend prime) s' rest-                                                    | otherwise -> (g mempty, m, s)-                                 Nothing -> (m0, m, s)-   split p m = prefix : splitRest-      where (prefix, rest) = break p m-            splitRest = case splitPrimePrefix rest-                        of Nothing -> []-                           Just (_, tl) -> split p tl-   takeWhile p = fst . span p-   dropWhile p = snd . span p-   splitAt n0 m0 | n0 <= 0 = (mempty, m0)-                 | otherwise = split' n0 id m0-      where split' 0 f m = (f mempty, m)-            split' n f m = case splitPrimePrefix m-                           of Nothing -> (f mempty, m)-                              Just (prime, rest) -> split' (pred n) (f . mappend prime) rest-   drop n p = snd (splitAt n p)-   take n p = fst (splitAt n p)-   reverse = mconcat . List.reverse . factors-   {-# MINIMAL factors | splitPrimePrefix #-}---- | A subclass of 'FactorialMonoid' whose instances satisfy this additional law:------ > factors (a <> b) == factors a <> factors b-class (FactorialMonoid m, PositiveMonoid m) => StableFactorialMonoid m--instance FactorialMonoid () where-   factors () = []-   primePrefix () = ()-   primeSuffix () = ()-   splitPrimePrefix () = Nothing-   splitPrimeSuffix () = Nothing-   length () = 0-   reverse = id--instance FactorialMonoid a => FactorialMonoid (Dual a) where-   factors (Dual a) = fmap Dual (reverse $ factors a)-   length (Dual a) = length a-   primePrefix (Dual a) = Dual (primeSuffix a)-   primeSuffix (Dual a) = Dual (primePrefix a)-   splitPrimePrefix (Dual a) = case splitPrimeSuffix a-                               of Nothing -> Nothing-                                  Just (p, s) -> Just (Dual s, Dual p)-   splitPrimeSuffix (Dual a) = case splitPrimePrefix a-                               of Nothing -> Nothing-                                  Just (p, s) -> Just (Dual s, Dual p)-   inits (Dual a) = fmap Dual (reverse $ tails a)-   tails (Dual a) = fmap Dual (reverse $ inits a)-   reverse (Dual a) = Dual (reverse a)--instance (Integral a, Eq a) => FactorialMonoid (Sum a) where-   primePrefix (Sum a) = Sum (signum a )-   primeSuffix = primePrefix-   splitPrimePrefix (Sum 0) = Nothing-   splitPrimePrefix (Sum a) = Just (Sum (signum a), Sum (a - signum a))-   splitPrimeSuffix (Sum 0) = Nothing-   splitPrimeSuffix (Sum a) = Just (Sum (a - signum a), Sum (signum a))-   length (Sum a) = abs (fromIntegral a)-   reverse = id--instance Integral a => FactorialMonoid (Product a) where-   factors (Product a) = List.map Product (primeFactors a)-   reverse = id--instance FactorialMonoid a => FactorialMonoid (Maybe a) where-   factors Nothing = []-   factors (Just a) | null a = [Just a]-                    | otherwise = List.map Just (factors a)-   length Nothing = 0-   length (Just a) | null a = 1-                   | otherwise = length a-   reverse = fmap reverse--instance (FactorialMonoid a, FactorialMonoid b) => FactorialMonoid (a, b) where-   factors (a, b) = List.map (\a1-> (a1, mempty)) (factors a) ++ List.map ((,) mempty) (factors b)-   primePrefix (a, b) | null a = (a, primePrefix b)-                      | otherwise = (primePrefix a, mempty)-   primeSuffix (a, b) | null b = (primeSuffix a, b)-                      | otherwise = (mempty, primeSuffix b)-   splitPrimePrefix (a, b) = case (splitPrimePrefix a, splitPrimePrefix b)-                             of (Just (ap, as), _) -> Just ((ap, mempty), (as, b))-                                (Nothing, Just (bp, bs)) -> Just ((a, bp), (a, bs))-                                (Nothing, Nothing) -> Nothing-   splitPrimeSuffix (a, b) = case (splitPrimeSuffix a, splitPrimeSuffix b)-                             of (_, Just (bp, bs)) -> Just ((a, bp), (mempty, bs))-                                (Just (ap, as), Nothing) -> Just ((ap, b), (as, b))-                                (Nothing, Nothing) -> Nothing-   inits (a, b) = List.map (flip (,) mempty) (inits a) ++ List.map ((,) a) (List.tail $ inits b)-   tails (a, b) = List.map (flip (,) b) (tails a) ++ List.map ((,) mempty) (List.tail $ tails b)-   foldl f a0 (x, y) = foldl f2 (foldl f1 a0 x) y-      where f1 a = f a . fromFst-            f2 a = f a . fromSnd-   foldl' f a0 (x, y) = a' `seq` foldl' f2 a' y-      where f1 a = f a . fromFst-            f2 a = f a . fromSnd-            a' = foldl' f1 a0 x-   foldr f a (x, y) = foldr (f . fromFst) (foldr (f . fromSnd) a y) x-   foldMap f (x, y) = foldMap (f . fromFst) x `mappend` foldMap (f . fromSnd) y-   length (a, b) = length a + length b-   span p (x, y) = ((xp, yp), (xs, ys))-      where (xp, xs) = span (p . fromFst) x-            (yp, ys) | null xs = span (p . fromSnd) y-                     | otherwise = (mempty, y)-   spanMaybe s0 f (x, y) | null xs = ((xp, yp), (xs, ys), s2)-                         | otherwise = ((xp, mempty), (xs, y), s1)-     where (xp, xs, s1) = spanMaybe s0 (\s-> f s . fromFst) x-           (yp, ys, s2) = spanMaybe s1 (\s-> f s . fromSnd) y-   spanMaybe' s0 f (x, y) | null xs = ((xp, yp), (xs, ys), s2)-                          | otherwise = ((xp, mempty), (xs, y), s1)-     where (xp, xs, s1) = spanMaybe' s0 (\s-> f s . fromFst) x-           (yp, ys, s2) = spanMaybe' s1 (\s-> f s . fromSnd) y-   split p (x0, y0) = fst $ List.foldr combine (ys, False) xs-      where xs = List.map fromFst $ split (p . fromFst) x0-            ys = List.map fromSnd $ split (p . fromSnd) y0-            combine x (~(y:rest), False) = (mappend x y : rest, True)-            combine x (rest, True) = (x:rest, True)-   splitAt n (x, y) = ((xp, yp), (xs, ys))-      where (xp, xs) = splitAt n x-            (yp, ys) | null xs = splitAt (n - length x) y-                     | otherwise = (mempty, y)-   reverse (a, b) = (reverse a, reverse b)--{-# INLINE fromFst #-}-fromFst :: Monoid b => a -> (a, b)-fromFst a = (a, mempty)--{-# INLINE fromSnd #-}-fromSnd :: Monoid a => b -> (a, b)-fromSnd b = (mempty, b)--instance FactorialMonoid [x] where-   factors xs = List.map (:[]) xs-   primePrefix [] = []-   primePrefix (x:_) = [x]-   primeSuffix [] = []-   primeSuffix xs = [List.last xs]-   splitPrimePrefix [] = Nothing-   splitPrimePrefix (x:xs) = Just ([x], xs)-   splitPrimeSuffix [] = Nothing-   splitPrimeSuffix xs = Just (splitLast id xs)-      where splitLast f last@[_] = (f [], last)-            splitLast f ~(x:rest) = splitLast (f . (x:)) rest-   inits = List.inits-   tails = List.tails-   foldl _ a [] = a-   foldl f a (x:xs) = foldl f (f a [x]) xs-   foldl' _ a [] = a-   foldl' f a (x:xs) = let a' = f a [x] in a' `seq` foldl' f a' xs-   foldr _ f0 [] = f0-   foldr f f0 (x:xs) = f [x] (foldr f f0 xs)-   length = List.length-   foldMap f = mconcat . List.map (f . (:[]))-   break f = List.break (f . (:[]))-   span f = List.span (f . (:[]))-   dropWhile f = List.dropWhile (f . (:[]))-   takeWhile f = List.takeWhile (f . (:[]))-   spanMaybe s0 f l = (prefix' [], suffix' [], s')-      where (prefix', suffix', s', _) = List.foldl' g (id, id, s0, True) l-            g (prefix, suffix, s1, live) x | live, Just s2 <- f s1 [x] = (prefix . (x:), id, s2, True)-                                           | otherwise = (prefix, suffix . (x:), s1, False)-   spanMaybe' s0 f l = (prefix' [], suffix' [], s')-      where (prefix', suffix', s', _) = List.foldl' g (id, id, s0, True) l-            g (prefix, suffix, s1, live) x | live, Just s2 <- f s1 [x] = seq s2 $ (prefix . (x:), id, s2, True)-                                           | otherwise = (prefix, suffix . (x:), s1, False)-   splitAt = List.splitAt-   drop = List.drop-   take = List.take-   reverse = List.reverse--instance FactorialMonoid ByteString.ByteString where-   factors x = factorize (ByteString.length x) x-      where factorize 0 _ = []-            factorize n xs = xs1 : factorize (pred n) xs'-              where (xs1, xs') = ByteString.splitAt 1 xs-   primePrefix = ByteString.take 1-   primeSuffix x = ByteString.drop (ByteString.length x - 1) x-   splitPrimePrefix x = if ByteString.null x then Nothing else Just (ByteString.splitAt 1 x)-   splitPrimeSuffix x = if ByteString.null x then Nothing else Just (ByteString.splitAt (ByteString.length x - 1) x)-   inits = ByteString.inits-   tails = ByteString.tails-   foldl f = ByteString.foldl f'-      where f' a byte = f a (ByteString.singleton byte)-   foldl' f = ByteString.foldl' f'-      where f' a byte = f a (ByteString.singleton byte)-   foldr f = ByteString.foldr (f . ByteString.singleton)-   break f = ByteString.break (f . ByteString.singleton)-   span f = ByteString.span (f . ByteString.singleton)-   spanMaybe s0 f b = case ByteString.foldr g id b (0, s0)-                      of (i, s') | (prefix, suffix) <- ByteString.splitAt i b -> (prefix, suffix, s')-      where g w cont (i, s) | Just s' <- f s (ByteString.singleton w) = let i' = succ i :: Int in seq i' $ cont (i', s')-                            | otherwise = (i, s)-   spanMaybe' s0 f b = case ByteString.foldr g id b (0, s0)-                       of (i, s') | (prefix, suffix) <- ByteString.splitAt i b -> (prefix, suffix, s')-      where g w cont (i, s) | Just s' <- f s (ByteString.singleton w) = let i' = succ i :: Int in seq i' $ seq s' $ cont (i', s')-                            | otherwise = (i, s)-   dropWhile f = ByteString.dropWhile (f . ByteString.singleton)-   takeWhile f = ByteString.takeWhile (f . ByteString.singleton)-   length = ByteString.length-   split f = ByteString.splitWith f'-      where f' = f . ByteString.singleton-   splitAt = ByteString.splitAt-   drop = ByteString.drop-   take = ByteString.take-   reverse = ByteString.reverse--instance FactorialMonoid LazyByteString.ByteString where-   factors x = factorize (LazyByteString.length x) x-      where factorize 0 _ = []-            factorize n xs = xs1 : factorize (pred n) xs'-               where (xs1, xs') = LazyByteString.splitAt 1 xs-   primePrefix = LazyByteString.take 1-   primeSuffix x = LazyByteString.drop (LazyByteString.length x - 1) x-   splitPrimePrefix x = if LazyByteString.null x then Nothing-                        else Just (LazyByteString.splitAt 1 x)-   splitPrimeSuffix x = if LazyByteString.null x then Nothing-                        else Just (LazyByteString.splitAt (LazyByteString.length x - 1) x)-   inits = LazyByteString.inits-   tails = LazyByteString.tails-   foldl f = LazyByteString.foldl f'-      where f' a byte = f a (LazyByteString.singleton byte)-   foldl' f = LazyByteString.foldl' f'-      where f' a byte = f a (LazyByteString.singleton byte)-   foldr f = LazyByteString.foldr f'-      where f' byte a = f (LazyByteString.singleton byte) a-   length = fromIntegral . LazyByteString.length-   break f = LazyByteString.break (f . LazyByteString.singleton)-   span f = LazyByteString.span (f . LazyByteString.singleton)-   spanMaybe s0 f b = case LazyByteString.foldr g id b (0, s0)-                      of (i, s') | (prefix, suffix) <- LazyByteString.splitAt i b -> (prefix, suffix, s')-      where g w cont (i, s) | Just s' <- f s (LazyByteString.singleton w) = let i' = succ i :: Int64 in seq i' $ cont (i', s')-                            | otherwise = (i, s)-   spanMaybe' s0 f b = case LazyByteString.foldr g id b (0, s0)-                       of (i, s') | (prefix, suffix) <- LazyByteString.splitAt i b -> (prefix, suffix, s')-      where g w cont (i, s)-              | Just s' <- f s (LazyByteString.singleton w) = let i' = succ i :: Int64 in seq i' $ seq s' $ cont (i', s')-              | otherwise = (i, s)-   dropWhile f = LazyByteString.dropWhile (f . LazyByteString.singleton)-   takeWhile f = LazyByteString.takeWhile (f . LazyByteString.singleton)-   split f = LazyByteString.splitWith f'-      where f' = f . LazyByteString.singleton-   splitAt = LazyByteString.splitAt . fromIntegral-   drop n = LazyByteString.drop (fromIntegral n)-   take n = LazyByteString.take (fromIntegral n)-   reverse = LazyByteString.reverse--instance FactorialMonoid Text.Text where-   factors = Text.chunksOf 1-   primePrefix = Text.take 1-   primeSuffix x = if Text.null x then Text.empty else Text.singleton (Text.last x)-   splitPrimePrefix = fmap (first Text.singleton) . Text.uncons-   splitPrimeSuffix x = if Text.null x then Nothing else Just (Text.init x, Text.singleton (Text.last x))-   inits = Text.inits-   tails = Text.tails-   foldl f = Text.foldl f'-      where f' a char = f a (Text.singleton char)-   foldl' f = Text.foldl' f'-      where f' a char = f a (Text.singleton char)-   foldr f = Text.foldr f'-      where f' char a = f (Text.singleton char) a-   length = Text.length-   span f = Text.span (f . Text.singleton)-   break f = Text.break (f . Text.singleton)-   dropWhile f = Text.dropWhile (f . Text.singleton)-   takeWhile f = Text.takeWhile (f . Text.singleton)-   spanMaybe s0 f t = case Text.foldr g id t (0, s0)-                      of (i, s') | (prefix, suffix) <- Text.splitAt i t -> (prefix, suffix, s')-      where g c cont (i, s) | Just s' <- f s (Text.singleton c) = let i' = succ i :: Int in seq i' $ cont (i', s')-                            | otherwise = (i, s)-   spanMaybe' s0 f t = case Text.foldr g id t (0, s0)-                       of (i, s') | (prefix, suffix) <- Text.splitAt i t -> (prefix, suffix, s')-      where g c cont (i, s) | Just s' <- f s (Text.singleton c) = let i' = succ i :: Int in seq i' $ seq s' $ cont (i', s')-                            | otherwise = (i, s)-   split f = Text.split f'-      where f' = f . Text.singleton-   splitAt = Text.splitAt-   drop = Text.drop-   take = Text.take-   reverse = Text.reverse--instance FactorialMonoid LazyText.Text where-   factors = LazyText.chunksOf 1-   primePrefix = LazyText.take 1-   primeSuffix x = if LazyText.null x then LazyText.empty else LazyText.singleton (LazyText.last x)-   splitPrimePrefix = fmap (first LazyText.singleton) . LazyText.uncons-   splitPrimeSuffix x = if LazyText.null x-                        then Nothing-                        else Just (LazyText.init x, LazyText.singleton (LazyText.last x))-   inits = LazyText.inits-   tails = LazyText.tails-   foldl f = LazyText.foldl f'-      where f' a char = f a (LazyText.singleton char)-   foldl' f = LazyText.foldl' f'-      where f' a char = f a (LazyText.singleton char)-   foldr f = LazyText.foldr f'-      where f' char a = f (LazyText.singleton char) a-   length = fromIntegral . LazyText.length-   span f = LazyText.span (f . LazyText.singleton)-   break f = LazyText.break (f . LazyText.singleton)-   dropWhile f = LazyText.dropWhile (f . LazyText.singleton)-   takeWhile f = LazyText.takeWhile (f . LazyText.singleton)-   spanMaybe s0 f t = case LazyText.foldr g id t (0, s0)-                      of (i, s') | (prefix, suffix) <- LazyText.splitAt i t -> (prefix, suffix, s')-      where g c cont (i, s) | Just s' <- f s (LazyText.singleton c) = let i' = succ i :: Int64 in seq i' $ cont (i', s')-                            | otherwise = (i, s)-   spanMaybe' s0 f t = case LazyText.foldr g id t (0, s0)-                       of (i, s') | (prefix, suffix) <- LazyText.splitAt i t -> (prefix, suffix, s')-      where g c cont (i, s) | Just s' <- f s (LazyText.singleton c) = let i' = succ i :: Int64 in seq i' $ seq s' $ cont (i', s')-                            | otherwise = (i, s)-   split f = LazyText.split f'-      where f' = f . LazyText.singleton-   splitAt = LazyText.splitAt . fromIntegral-   drop n = LazyText.drop (fromIntegral n)-   take n = LazyText.take (fromIntegral n)-   reverse = LazyText.reverse--instance Ord k => FactorialMonoid (Map.Map k v) where-   factors = List.map (uncurry Map.singleton) . Map.toAscList-   primePrefix map | Map.null map = map-                   | otherwise = uncurry Map.singleton $ Map.findMin map-   primeSuffix map | Map.null map = map-                   | otherwise = uncurry Map.singleton $ Map.findMax map-   splitPrimePrefix = fmap singularize . Map.minViewWithKey-      where singularize ((k, v), rest) = (Map.singleton k v, rest)-   splitPrimeSuffix = fmap singularize . Map.maxViewWithKey-      where singularize ((k, v), rest) = (rest, Map.singleton k v)-   foldl f = Map.foldlWithKey f'-      where f' a k v = f a (Map.singleton k v)-   foldl' f = Map.foldlWithKey' f'-      where f' a k v = f a (Map.singleton k v)-   foldr f = Map.foldrWithKey f'-      where f' k v a = f (Map.singleton k v) a-   length = Map.size-   reverse = id--instance FactorialMonoid (IntMap.IntMap a) where-   factors = List.map (uncurry IntMap.singleton) . IntMap.toAscList-   primePrefix map | IntMap.null map = map-                   | otherwise = uncurry IntMap.singleton $ IntMap.findMin map-   primeSuffix map | IntMap.null map = map-                   | otherwise = uncurry IntMap.singleton $ IntMap.findMax map-   splitPrimePrefix = fmap singularize . IntMap.minViewWithKey-      where singularize ((k, v), rest) = (IntMap.singleton k v, rest)-   splitPrimeSuffix = fmap singularize . IntMap.maxViewWithKey-      where singularize ((k, v), rest) = (rest, IntMap.singleton k v)-   foldl f = IntMap.foldlWithKey f'-      where f' a k v = f a (IntMap.singleton k v)-   foldl' f = IntMap.foldlWithKey' f'-      where f' a k v = f a (IntMap.singleton k v)-   foldr f = IntMap.foldrWithKey f'-      where f' k v a = f (IntMap.singleton k v) a-   length = IntMap.size-   reverse = id--instance FactorialMonoid IntSet.IntSet where-   factors = List.map IntSet.singleton . IntSet.toAscList-   primePrefix set | IntSet.null set = set-                   | otherwise = IntSet.singleton $ IntSet.findMin set-   primeSuffix set | IntSet.null set = set-                   | otherwise = IntSet.singleton $ IntSet.findMax set-   splitPrimePrefix = fmap singularize . IntSet.minView-      where singularize (min, rest) = (IntSet.singleton min, rest)-   splitPrimeSuffix = fmap singularize . IntSet.maxView-      where singularize (max, rest) = (rest, IntSet.singleton max)-   foldl f = IntSet.foldl f'-      where f' a b = f a (IntSet.singleton b)-   foldl' f = IntSet.foldl' f'-      where f' a b = f a (IntSet.singleton b)-   foldr f = IntSet.foldr f'-      where f' a b = f (IntSet.singleton a) b-   length = IntSet.size-   reverse = id--instance FactorialMonoid (Sequence.Seq a) where-   factors = List.map Sequence.singleton . Foldable.toList-   primePrefix = Sequence.take 1-   primeSuffix q = Sequence.drop (Sequence.length q - 1) q-   splitPrimePrefix q = case Sequence.viewl q-                        of Sequence.EmptyL -> Nothing-                           hd Sequence.:< rest -> Just (Sequence.singleton hd, rest)-   splitPrimeSuffix q = case Sequence.viewr q-                        of Sequence.EmptyR -> Nothing-                           rest Sequence.:> last -> Just (rest, Sequence.singleton last)-   inits = Foldable.toList . Sequence.inits-   tails = Foldable.toList . Sequence.tails-   foldl f = Foldable.foldl f'-      where f' a b = f a (Sequence.singleton b)-   foldl' f = Foldable.foldl' f'-      where f' a b = f a (Sequence.singleton b)-   foldr f = Foldable.foldr f'-      where f' a b = f (Sequence.singleton a) b-   span f = Sequence.spanl (f . Sequence.singleton)-   break f = Sequence.breakl (f . Sequence.singleton)-   dropWhile f = Sequence.dropWhileL (f . Sequence.singleton)-   takeWhile f = Sequence.takeWhileL (f . Sequence.singleton)-   spanMaybe s0 f b = case Foldable.foldr g id b (0, s0)-                      of (i, s') | (prefix, suffix) <- Sequence.splitAt i b -> (prefix, suffix, s')-      where g x cont (i, s) | Just s' <- f s (Sequence.singleton x) = let i' = succ i :: Int in seq i' $ cont (i', s')-                            | otherwise = (i, s)-   spanMaybe' s0 f b = case Foldable.foldr g id b (0, s0)-                       of (i, s') | (prefix, suffix) <- Sequence.splitAt i b -> (prefix, suffix, s')-      where g x cont (i, s) | Just s' <- f s (Sequence.singleton x) = let i' = succ i :: Int in seq i' $ seq s' $ cont (i', s')-                            | otherwise = (i, s)-   splitAt = Sequence.splitAt-   drop = Sequence.drop-   take = Sequence.take-   length = Sequence.length-   reverse = Sequence.reverse--instance Ord a => FactorialMonoid (Set.Set a) where-   factors = List.map Set.singleton . Set.toAscList-   primePrefix set | Set.null set = set-                   | otherwise = Set.singleton $ Set.findMin set-   primeSuffix set | Set.null set = set-                   | otherwise = Set.singleton $ Set.findMax set-   splitPrimePrefix = fmap singularize . Set.minView-      where singularize (min, rest) = (Set.singleton min, rest)-   splitPrimeSuffix = fmap singularize . Set.maxView-      where singularize (max, rest) = (rest, Set.singleton max)-   foldl f = Foldable.foldl f'-      where f' a b = f a (Set.singleton b)-   foldl' f = Foldable.foldl' f'-      where f' a b = f a (Set.singleton b)-   foldr f = Foldable.foldr f'-      where f' a b = f (Set.singleton a) b-   length = Set.size-   reverse = id--instance FactorialMonoid (Vector.Vector a) where-   factors x = factorize (Vector.length x) x-      where factorize 0 _ = []-            factorize n xs = xs1 : factorize (pred n) xs'-               where (xs1, xs') = Vector.splitAt 1 xs-   primePrefix = Vector.take 1-   primeSuffix x = Vector.drop (Vector.length x - 1) x-   splitPrimePrefix x = if Vector.null x then Nothing else Just (Vector.splitAt 1 x)-   splitPrimeSuffix x = if Vector.null x then Nothing else Just (Vector.splitAt (Vector.length x - 1) x)-   inits x0 = initsWith x0 []-      where initsWith x rest | Vector.null x = x:rest-                             | otherwise = initsWith (Vector.unsafeInit x) (x:rest)-   tails x = x : if Vector.null x then [] else tails (Vector.unsafeTail x)-   foldl f = Vector.foldl f'-      where f' a byte = f a (Vector.singleton byte)-   foldl' f = Vector.foldl' f'-      where f' a byte = f a (Vector.singleton byte)-   foldr f = Vector.foldr f'-      where f' byte a = f (Vector.singleton byte) a-   break f = Vector.break (f . Vector.singleton)-   span f = Vector.span (f . Vector.singleton)-   dropWhile f = Vector.dropWhile (f . Vector.singleton)-   takeWhile f = Vector.takeWhile (f . Vector.singleton)-   spanMaybe s0 f v = case Vector.ifoldr g Left v s0-                      of Left s' -> (v, Vector.empty, s')-                         Right (i, s') | (prefix, suffix) <- Vector.splitAt i v -> (prefix, suffix, s')-      where g i x cont s | Just s' <- f s (Vector.singleton x) = cont s'-                         | otherwise = Right (i, s)-   spanMaybe' s0 f v = case Vector.ifoldr' g Left v s0-                       of Left s' -> (v, Vector.empty, s')-                          Right (i, s') | (prefix, suffix) <- Vector.splitAt i v -> (prefix, suffix, s')-      where g i x cont s | Just s' <- f s (Vector.singleton x) = seq s' (cont s')-                         | otherwise = Right (i, s)-   splitAt = Vector.splitAt-   drop = Vector.drop-   take = Vector.take-   length = Vector.length-   reverse = Vector.reverse--instance StableFactorialMonoid ()-instance StableFactorialMonoid a => StableFactorialMonoid (Dual a)-instance StableFactorialMonoid [x]-instance StableFactorialMonoid ByteString.ByteString-instance StableFactorialMonoid LazyByteString.ByteString-instance StableFactorialMonoid Text.Text-instance StableFactorialMonoid LazyText.Text-instance StableFactorialMonoid (Sequence.Seq a)-instance StableFactorialMonoid (Vector.Vector a)---- | A 'Monad.mapM' equivalent.-mapM :: (FactorialMonoid a, Monoid b, Monad m) => (a -> m b) -> a -> m b-mapM f = ($ return mempty) . appEndo . foldMap (Endo . Monad.liftM2 mappend . f)---- | A 'Monad.mapM_' equivalent.-mapM_ :: (FactorialMonoid a, Monad m) => (a -> m b) -> a -> m ()-mapM_ f = foldr ((>>) . f) (return ())
− tests/examples/Undefined11.hs
@@ -1,423 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-}-module Algebra.Additive (-    -- * Class-    C,-    zero,-    (+), (-),-    negate, subtract,--    -- * Complex functions-    sum, sum1,-    sumNestedAssociative,-    sumNestedCommutative,--    -- * Instance definition helpers-    elementAdd, elementSub, elementNeg,-    (<*>.+), (<*>.-), (<*>.-$),--    -- * Instances for atomic types-    propAssociative,-    propCommutative,-    propIdentity,-    propInverse,-  ) where--import qualified Algebra.Laws as Laws--import Data.Int  (Int,  Int8,  Int16,  Int32,  Int64,  )-import Data.Word (Word, Word8, Word16, Word32, Word64, )--import qualified NumericPrelude.Elementwise as Elem-import Control.Applicative (Applicative(pure, (<*>)), )-import Data.Tuple.HT (fst3, snd3, thd3, )-import qualified Data.List.Match as Match--import qualified Data.Complex as Complex98-import qualified Data.Ratio as Ratio98-import qualified Prelude as P-import Prelude (Integer, Float, Double, fromInteger, )-import NumericPrelude.Base---infixl 6  +, ---{- |-Additive a encapsulates the notion of a commutative group, specified-by the following laws:--@-          a + b === b + a-    (a + b) + c === a + (b + c)-       zero + a === a-   a + negate a === 0-@--Typical examples include integers, dollars, and vectors.--Minimal definition: '+', 'zero', and ('negate' or '(-)')--}--class C a where-    {-# MINIMAL zero, (+), ((-) | negate) #-}-    -- | zero element of the vector space-    zero     :: a-    -- | add and subtract elements-    (+), (-) :: a -> a -> a-    -- | inverse with respect to '+'-    negate   :: a -> a--    {-# INLINE negate #-}-    negate a = zero - a-    {-# INLINE (-) #-}-    a - b    = a + negate b--{- |-'subtract' is @(-)@ with swapped operand order.-This is the operand order which will be needed in most cases-of partial application.--}-subtract :: C a => a -> a -> a-subtract = flip (-)-----{- |-Sum up all elements of a list.-An empty list yields zero.--This function is inappropriate for number types like Peano.-Maybe we should make 'sum' a method of Additive.-This would also make 'lengthLeft' and 'lengthRight' superfluous.--}-sum :: (C a) => [a] -> a-sum = foldl (+) zero--{- |-Sum up all elements of a non-empty list.-This avoids including a zero which is useful for types-where no universal zero is available.--}-sum1 :: (C a) => [a] -> a-sum1 = foldl1 (+)---{- |-Sum the operands in an order,-such that the dependencies are minimized.-Does this have a measurably effect on speed?--Requires associativity.--}-sumNestedAssociative :: (C a) => [a] -> a-sumNestedAssociative [] = zero-sumNestedAssociative [x] = x-sumNestedAssociative xs = sumNestedAssociative (sum2 xs)--{--Make sure that the last entries in the list-are equally often part of an addition.-Maybe this can reduce rounding errors.-The list that sum2 computes is a breadth-first-flattened binary tree.--Requires associativity and commutativity.--}-sumNestedCommutative :: (C a) => [a] -> a-sumNestedCommutative [] = zero-sumNestedCommutative xs@(_:rs) =-   let ys = xs ++ Match.take rs (sum2 ys)-   in  last ys--_sumNestedCommutative :: (C a) => [a] -> a-_sumNestedCommutative [] = zero-_sumNestedCommutative xs@(_:rs) =-   let ys = xs ++ take (length rs) (sum2 ys)-   in  last ys--{--[a,b,c, a+b,c+(a+b)]-[a,b,c,d, a+b,c+d,(a+b)+(c+d)]-[a,b,c,d,e, a+b,c+d,e+(a+b),(c+d)+e+(a+b)]-[a,b,c,d,e,f, a+b,c+d,e+f,(a+b)+(c+d),(e+f)+((a+b)+(c+d))]--}--sum2 :: (C a) => [a] -> [a]-sum2 (x:y:rest) = (x+y) : sum2 rest-sum2 xs = xs----{- |-Instead of baking the add operation into the element function,-we could use higher rank types-and pass a generic @uncurry (+)@ to the run function.-We do not do so in order to stay Haskell 98-at least for parts of NumericPrelude.--}-{-# INLINE elementAdd #-}-elementAdd ::-   (C x) =>-   (v -> x) -> Elem.T (v,v) x-elementAdd f =-   Elem.element (\(x,y) -> f x + f y)--{-# INLINE elementSub #-}-elementSub ::-   (C x) =>-   (v -> x) -> Elem.T (v,v) x-elementSub f =-   Elem.element (\(x,y) -> f x - f y)--{-# INLINE elementNeg #-}-elementNeg ::-   (C x) =>-   (v -> x) -> Elem.T v x-elementNeg f =-   Elem.element (negate . f)----- like <*>-infixl 4 <*>.+, <*>.-, <*>.-$--{- |-> addPair :: (Additive.C a, Additive.C b) => (a,b) -> (a,b) -> (a,b)-> addPair = Elem.run2 $ Elem.with (,) <*>.+  fst <*>.+  snd--}-{-# INLINE (<*>.+) #-}-(<*>.+) ::-   (C x) =>-   Elem.T (v,v) (x -> a) -> (v -> x) -> Elem.T (v,v) a-(<*>.+) f acc =-   f <*> elementAdd acc--{-# INLINE (<*>.-) #-}-(<*>.-) ::-   (C x) =>-   Elem.T (v,v) (x -> a) -> (v -> x) -> Elem.T (v,v) a-(<*>.-) f acc =-   f <*> elementSub acc--{-# INLINE (<*>.-$) #-}-(<*>.-$) ::-   (C x) =>-   Elem.T v (x -> a) -> (v -> x) -> Elem.T v a-(<*>.-$) f acc =-   f <*> elementNeg acc----- * Instances for atomic types--instance C Integer where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Float   where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Double  where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)---instance C Int     where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Int8    where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Int16   where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Int32   where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Int64   where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)---instance C Word    where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Word8   where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Word16  where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Word32  where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)--instance C Word64  where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = P.fromInteger 0-   negate = P.negate-   (+)    = (P.+)-   (-)    = (P.-)------- * Instances for composed types--instance (C v0, C v1) => C (v0, v1) where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = (,) zero zero-   (+)    = Elem.run2 $ pure (,) <*>.+  fst <*>.+  snd-   (-)    = Elem.run2 $ pure (,) <*>.-  fst <*>.-  snd-   negate = Elem.run  $ pure (,) <*>.-$ fst <*>.-$ snd--instance (C v0, C v1, C v2) => C (v0, v1, v2) where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero   = (,,) zero zero zero-   (+)    = Elem.run2 $ pure (,,) <*>.+  fst3 <*>.+  snd3 <*>.+  thd3-   (-)    = Elem.run2 $ pure (,,) <*>.-  fst3 <*>.-  snd3 <*>.-  thd3-   negate = Elem.run  $ pure (,,) <*>.-$ fst3 <*>.-$ snd3 <*>.-$ thd3---instance (C v) => C [v] where-   zero   = []-   negate = map negate-   (+) (x:xs) (y:ys) = (+) x y : (+) xs ys-   (+) xs     []     = xs-   (+) []     ys     = ys-   (-) (x:xs) (y:ys) = (-) x y : (-) xs ys-   (-) xs     []     = xs-   (-) []     ys     = negate ys---instance (C v) => C (b -> v) where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero       _ = zero-   (+)    f g x = (+) (f x) (g x)-   (-)    f g x = (-) (f x) (g x)-   negate f   x = negate (f x)---- * Properties--propAssociative :: (Eq a, C a) => a -> a -> a -> Bool-propCommutative :: (Eq a, C a) => a -> a -> Bool-propIdentity    :: (Eq a, C a) => a -> Bool-propInverse     :: (Eq a, C a) => a -> Bool--propCommutative  =  Laws.commutative (+)-propAssociative  =  Laws.associative (+)-propIdentity     =  Laws.identity (+) zero-propInverse      =  Laws.inverse (+) negate zero------ legacy--instance (P.Integral a) => C (Ratio98.Ratio a) where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero                =  P.fromInteger 0-   (+)                 =  (P.+)-   (-)                 =  (P.-)-   negate              =  P.negate--instance (P.RealFloat a) => C (Complex98.Complex a) where-   {-# INLINE zero #-}-   {-# INLINE negate #-}-   {-# INLINE (+) #-}-   {-# INLINE (-) #-}-   zero                =  P.fromInteger 0-   (+)                 =  (P.+)-   (-)                 =  (P.-)-   negate              =  P.negate
− tests/examples/Undefined13.hs
@@ -1,130 +0,0 @@-{-# LANGUAGE OverloadedStrings, TypeFamilies, QuasiQuotes #-}-{-# OPTIONS_GHC -fno-warn-orphans #-}--module Network.TigHTTP.Papillon (-    ContentType(..), Type(..), Subtype(..), Parameter(..), Charset(..),-        parseContentType, showContentType,-) where--import Data.Char-import Text.Papillon--import Data.ByteString (ByteString)-import Data.ByteString.Char8 (pack)-import qualified Data.ByteString as BS--import Network.TigHTTP.Token--data ContentType = ContentType Type Subtype [Parameter]-    deriving (Show, Eq)--parseContentType :: BS.ByteString -> ContentType-parseContentType ct = case runError . contentType $ parse ct of-    Left _ -> error "parseContentType"-    Right (r, _) -> r--showContentType :: ContentType -> BS.ByteString-showContentType (ContentType t st ps) = showType t-    `BS.append` "/"-    `BS.append` showSubtype st-    `BS.append` showParameters ps--data Type-    = Text-    | TypeRaw BS.ByteString-    deriving (Show, Eq)--mkType :: BS.ByteString -> Type-mkType "text" = Text-mkType t = TypeRaw t--showType :: Type -> BS.ByteString-showType Text = "text"-showType (TypeRaw t) = t--data Subtype-    = Plain-    | Html-    | Css-    | SubtypeRaw BS.ByteString-    deriving (Show, Eq)--mkSubtype :: BS.ByteString -> Subtype-mkSubtype "html" = Html-mkSubtype "plain" = Plain-mkSubtype "css" = Css-mkSubtype s = SubtypeRaw s--showSubtype :: Subtype -> BS.ByteString-showSubtype Plain = "plain"-showSubtype Html = "html"-showSubtype Css = "css"-showSubtype (SubtypeRaw s) = s--data Parameter-    = Charset Charset-    | ParameterRaw BS.ByteString BS.ByteString-    deriving (Show, Eq)--mkParameter :: BS.ByteString -> BS.ByteString -> Parameter-mkParameter "charset" "UTF-8" = Charset Utf8-mkParameter "charset" v = Charset $ CharsetRaw v-mkParameter a v = ParameterRaw a v--showParameters :: [Parameter] -> BS.ByteString-showParameters [] = ""-showParameters (Charset v : ps) = "; " `BS.append` "charset"-    `BS.append` "=" `BS.append` showCharset v `BS.append` showParameters ps-showParameters (ParameterRaw a v : ps) = "; " `BS.append` a-    `BS.append` "=" `BS.append` v `BS.append` showParameters ps--data Charset-    = Utf8-    | CharsetRaw BS.ByteString-    deriving (Show, Eq)--showCharset :: Charset -> BS.ByteString-showCharset Utf8 = "UTF-8"-showCharset (CharsetRaw cs) = cs--bsconcat :: [ByteString] -> ByteString-bsconcat = BS.concat--[papillon|--source: ByteString--contentType :: ContentType-    = c:token '/' sc:token ps:(';' ' '* p:parameter { p })*-    { ContentType (mkType c) (mkSubtype sc) ps }--token :: ByteString-    = t:<isTokenChar>+          { pack t }--quotedString :: ByteString-    = '"' t:(qt:qdtext { qt } / qp:quotedPair { pack [qp] })* '"'-                        { bsconcat t }--quotedPair :: Char-    = '\\' c:<isAscii>          { c }--crlf :: () = '\r' '\n'--lws :: () = _:crlf _:(' ' / '\t')+---- text :: ByteString---  = ts:(cs:<isTextChar>+ { cs } / _:lws { " " })+     { pack $ concat ts }--qdtext :: ByteString-    = ts:(cs:<isQdtextChar>+ { cs } / _:lws { " " })+   { pack $ concat ts }--parameter :: Parameter-    = a:attribute '=' v:value               { mkParameter a v }--attribute :: ByteString = t:token               { t }--value :: ByteString-    = t:token                       { t }-    / qs:quotedString                   { qs }--|]
− tests/examples/Undefined2.hs
@@ -1,56 +0,0 @@-{-# LANGUAGE Safe #-}---------------------------------------------------------------------------------- |--- Module      :  Control.Monad.Zip--- Copyright   :  (c) Nils Schweinsberg 2011,---                (c) George Giorgidze 2011---                (c) University Tuebingen 2011--- License     :  BSD-style (see the file libraries/base/LICENSE)--- Maintainer  :  libraries@haskell.org--- Stability   :  experimental--- Portability :  portable------ Monadic zipping (used for monad comprehensions)-----------------------------------------------------------------------------------module Control.Monad.Zip where--import Prelude-import Control.Monad (liftM)---- | `MonadZip` type class. Minimal definition: `mzip` or `mzipWith`------ Instances should satisfy the laws:------ * Naturality :------   > liftM (f *** g) (mzip ma mb) = mzip (liftM f ma) (liftM g mb)------ * Information Preservation:------   > liftM (const ()) ma = liftM (const ()) mb---   > ==>---   > munzip (mzip ma mb) = (ma, mb)----class Monad m => MonadZip m where--    mzip :: m a -> m b -> m (a,b)-    mzip = mzipWith (,)--    mzipWith :: (a -> b -> c) -> m a -> m b -> m c-    mzipWith f ma mb = liftM (uncurry f) (mzip ma mb)--    munzip :: m (a,b) -> (m a, m b)-    munzip mab = (liftM fst mab, liftM snd mab)-    -- munzip is a member of the class because sometimes-    -- you can implement it more efficiently than the-    -- above default code.  See Trac #4370 comment by giorgidze-    {-# MINIMAL mzip | mzipWith #-}--instance MonadZip [] where-    mzip     = zip-    mzipWith = zipWith-    munzip   = unzip-
− tests/examples/Undefined3.hs
@@ -1,340 +0,0 @@-{-# LANGUAGE Trustworthy #-}---------------------------------------------------------------------------------- |--- Module      :  Data.Foldable--- Copyright   :  Ross Paterson 2005--- License     :  BSD-style (see the LICENSE file in the distribution)------ Maintainer  :  libraries@haskell.org--- Stability   :  experimental--- Portability :  portable------ Class of data structures that can be folded to a summary value.------ Many of these functions generalize "Prelude", "Control.Monad" and--- "Data.List" functions of the same names from lists to any 'Foldable'--- functor.  To avoid ambiguity, either import those modules hiding--- these names or qualify uses of these function names with an alias--- for this module.-----------------------------------------------------------------------------------module Data.Foldable (-    -- * Folds-    Foldable(..),-    -- ** Special biased folds-    foldrM,-    foldlM,-    -- ** Folding actions-    -- *** Applicative actions-    traverse_,-    for_,-    sequenceA_,-    asum,-    -- *** Monadic actions-    mapM_,-    forM_,-    sequence_,-    msum,-    -- ** Specialized folds-    toList,-    concat,-    concatMap,-    and,-    or,-    any,-    all,-    sum,-    product,-    maximum,-    maximumBy,-    minimum,-    minimumBy,-    -- ** Searches-    elem,-    notElem,-    find-    ) where--import Prelude hiding (foldl, foldr, foldl1, foldr1, mapM_, sequence_,-                elem, notElem, concat, concatMap, and, or, any, all,-                sum, product, maximum, minimum)-import qualified Prelude (foldl, foldr, foldl1, foldr1)-import qualified Data.List as List (foldl')-import Control.Applicative-import Control.Monad (MonadPlus(..))-import Data.Maybe (fromMaybe, listToMaybe)-import Data.Monoid-import Data.Proxy--import GHC.Exts (build)-import GHC.Arr---- | Data structures that can be folded.------ Minimal complete definition: 'foldMap' or 'foldr'.------ For example, given a data type------ > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)------ a suitable instance would be------ > instance Foldable Tree where--- >    foldMap f Empty = mempty--- >    foldMap f (Leaf x) = f x--- >    foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r------ This is suitable even for abstract types, as the monoid is assumed--- to satisfy the monoid laws.  Alternatively, one could define @foldr@:------ > instance Foldable Tree where--- >    foldr f z Empty = z--- >    foldr f z (Leaf x) = f x z--- >    foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l----class Foldable t where-    -- | Combine the elements of a structure using a monoid.-    fold :: Monoid m => t m -> m-    fold = foldMap id--    -- | Map each element of the structure to a monoid,-    -- and combine the results.-    foldMap :: Monoid m => (a -> m) -> t a -> m-    foldMap f = foldr (mappend . f) mempty--    -- | Right-associative fold of a structure.-    ---    -- @'foldr' f z = 'Prelude.foldr' f z . 'toList'@-    foldr :: (a -> b -> b) -> b -> t a -> b-    foldr f z t = appEndo (foldMap (Endo . f) t) z--    -- | Right-associative fold of a structure,-    -- but with strict application of the operator.-    foldr' :: (a -> b -> b) -> b -> t a -> b-    foldr' f z0 xs = foldl f' id xs z0-      where f' k x z = k $! f x z--    -- | Left-associative fold of a structure.-    ---    -- @'foldl' f z = 'Prelude.foldl' f z . 'toList'@-    foldl :: (b -> a -> b) -> b -> t a -> b-    foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z--    -- | Left-associative fold of a structure.-    -- but with strict application of the operator.-    ---    -- @'foldl' f z = 'List.foldl'' f z . 'toList'@-    foldl' :: (b -> a -> b) -> b -> t a -> b-    foldl' f z0 xs = foldr f' id xs z0-      where f' x k z = k $! f z x--    -- | A variant of 'foldr' that has no base case,-    -- and thus may only be applied to non-empty structures.-    ---    -- @'foldr1' f = 'Prelude.foldr1' f . 'toList'@-    foldr1 :: (a -> a -> a) -> t a -> a-    foldr1 f xs = fromMaybe (error "foldr1: empty structure")-                    (foldr mf Nothing xs)-      where-        mf x Nothing = Just x-        mf x (Just y) = Just (f x y)--    -- | A variant of 'foldl' that has no base case,-    -- and thus may only be applied to non-empty structures.-    ---    -- @'foldl1' f = 'Prelude.foldl1' f . 'toList'@-    foldl1 :: (a -> a -> a) -> t a -> a-    foldl1 f xs = fromMaybe (error "foldl1: empty structure")-                    (foldl mf Nothing xs)-      where-        mf Nothing y = Just y-        mf (Just x) y = Just (f x y)-    {-# MINIMAL foldMap | foldr #-}---- instances for Prelude types--instance Foldable Maybe where-    foldr _ z Nothing = z-    foldr f z (Just x) = f x z--    foldl _ z Nothing = z-    foldl f z (Just x) = f z x--instance Foldable [] where-    foldr = Prelude.foldr-    foldl = Prelude.foldl-    foldl' = List.foldl'-    foldr1 = Prelude.foldr1-    foldl1 = Prelude.foldl1--instance Foldable (Either a) where-    foldMap _ (Left _) = mempty-    foldMap f (Right y) = f y--    foldr _ z (Left _) = z-    foldr f z (Right y) = f y z--instance Foldable ((,) a) where-    foldMap f (_, y) = f y--    foldr f z (_, y) = f y z--instance Ix i => Foldable (Array i) where-    foldr f z = Prelude.foldr f z . elems-    foldl f z = Prelude.foldl f z . elems-    foldr1 f = Prelude.foldr1 f . elems-    foldl1 f = Prelude.foldl1 f . elems--instance Foldable Proxy where-    foldMap _ _ = mempty-    {-# INLINE foldMap #-}-    fold _ = mempty-    {-# INLINE fold #-}-    foldr _ z _ = z-    {-# INLINE foldr #-}-    foldl _ z _ = z-    {-# INLINE foldl #-}-    foldl1 _ _ = error "foldl1: Proxy"-    {-# INLINE foldl1 #-}-    foldr1 _ _ = error "foldr1: Proxy"-    {-# INLINE foldr1 #-}--instance Foldable (Const m) where-    foldMap _ _ = mempty---- | Monadic fold over the elements of a structure,--- associating to the right, i.e. from right to left.-foldrM :: (Foldable t, Monad m) => (a -> b -> m b) -> b -> t a -> m b-foldrM f z0 xs = foldl f' return xs z0-  where f' k x z = f x z >>= k---- | Monadic fold over the elements of a structure,--- associating to the left, i.e. from left to right.-foldlM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b-foldlM f z0 xs = foldr f' return xs z0-  where f' x k z = f z x >>= k---- | Map each element of a structure to an action, evaluate--- these actions from left to right, and ignore the results.-traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()-traverse_ f = foldr ((*>) . f) (pure ())---- | 'for_' is 'traverse_' with its arguments flipped.-for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()-{-# INLINE for_ #-}-for_ = flip traverse_---- | Map each element of a structure to a monadic action, evaluate--- these actions from left to right, and ignore the results.-mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()-mapM_ f = foldr ((>>) . f) (return ())---- | 'forM_' is 'mapM_' with its arguments flipped.-forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()-{-# INLINE forM_ #-}-forM_ = flip mapM_---- | Evaluate each action in the structure from left to right,--- and ignore the results.-sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()-sequenceA_ = foldr (*>) (pure ())---- | Evaluate each monadic action in the structure from left to right,--- and ignore the results.-sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()-sequence_ = foldr (>>) (return ())---- | The sum of a collection of actions, generalizing 'concat'.-asum :: (Foldable t, Alternative f) => t (f a) -> f a-{-# INLINE asum #-}-asum = foldr (<|>) empty---- | The sum of a collection of actions, generalizing 'concat'.-msum :: (Foldable t, MonadPlus m) => t (m a) -> m a-{-# INLINE msum #-}-msum = foldr mplus mzero---- These use foldr rather than foldMap to avoid repeated concatenation.---- | List of elements of a structure.-toList :: Foldable t => t a -> [a]-{-# INLINE toList #-}-toList t = build (\ c n -> foldr c n t)---- | The concatenation of all the elements of a container of lists.-concat :: Foldable t => t [a] -> [a]-concat = fold---- | Map a function over all the elements of a container and concatenate--- the resulting lists.-concatMap :: Foldable t => (a -> [b]) -> t a -> [b]-concatMap = foldMap---- | 'and' returns the conjunction of a container of Bools.  For the--- result to be 'True', the container must be finite; 'False', however,--- results from a 'False' value finitely far from the left end.-and :: Foldable t => t Bool -> Bool-and = getAll . foldMap All---- | 'or' returns the disjunction of a container of Bools.  For the--- result to be 'False', the container must be finite; 'True', however,--- results from a 'True' value finitely far from the left end.-or :: Foldable t => t Bool -> Bool-or = getAny . foldMap Any---- | Determines whether any element of the structure satisfies the predicate.-any :: Foldable t => (a -> Bool) -> t a -> Bool-any p = getAny . foldMap (Any . p)---- | Determines whether all elements of the structure satisfy the predicate.-all :: Foldable t => (a -> Bool) -> t a -> Bool-all p = getAll . foldMap (All . p)---- | The 'sum' function computes the sum of the numbers of a structure.-sum :: (Foldable t, Num a) => t a -> a-sum = getSum . foldMap Sum---- | The 'product' function computes the product of the numbers of a structure.-product :: (Foldable t, Num a) => t a -> a-product = getProduct . foldMap Product---- | The largest element of a non-empty structure.-maximum :: (Foldable t, Ord a) => t a -> a-maximum = foldr1 max---- | The largest element of a non-empty structure with respect to the--- given comparison function.-maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a-maximumBy cmp = foldr1 max'-  where max' x y = case cmp x y of-                        GT -> x-                        _  -> y---- | The least element of a non-empty structure.-minimum :: (Foldable t, Ord a) => t a -> a-minimum = foldr1 min---- | The least element of a non-empty structure with respect to the--- given comparison function.-minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a-minimumBy cmp = foldr1 min'-  where min' x y = case cmp x y of-                        GT -> y-                        _  -> x---- | Does the element occur in the structure?-elem :: (Foldable t, Eq a) => a -> t a -> Bool-elem = any . (==)---- | 'notElem' is the negation of 'elem'.-notElem :: (Foldable t, Eq a) => a -> t a -> Bool-notElem x = not . elem x---- | The 'find' function takes a predicate and a structure and returns--- the leftmost element of the structure matching the predicate, or--- 'Nothing' if there is no such element.-find :: Foldable t => (a -> Bool) -> t a -> Maybe a-find p = listToMaybe . concatMap (\ x -> if p x then [x] else [])-
− tests/examples/Undefined4.hs
@@ -1,280 +0,0 @@-{-# LANGUAGE Trustworthy #-}---------------------------------------------------------------------------------- |--- Module      :  Data.Traversable--- Copyright   :  Conor McBride and Ross Paterson 2005--- License     :  BSD-style (see the LICENSE file in the distribution)------ Maintainer  :  libraries@haskell.org--- Stability   :  experimental--- Portability :  portable------ Class of data structures that can be traversed from left to right,--- performing an action on each element.------ See also------  * \"Applicative Programming with Effects\",---    by Conor McBride and Ross Paterson,---    /Journal of Functional Programming/ 18:1 (2008) 1-13, online at---    <http://www.soi.city.ac.uk/~ross/papers/Applicative.html>.------  * \"The Essence of the Iterator Pattern\",---    by Jeremy Gibbons and Bruno Oliveira,---    in /Mathematically-Structured Functional Programming/, 2006, online at---    <http://web.comlab.ox.ac.uk/oucl/work/jeremy.gibbons/publications/#iterator>.------  * \"An Investigation of the Laws of Traversals\",---    by Mauro Jaskelioff and Ondrej Rypacek,---    in /Mathematically-Structured Functional Programming/, 2012, online at---    <http://arxiv.org/pdf/1202.2919>.------ Note that the functions 'mapM' and 'sequence' generalize "Prelude"--- functions of the same names from lists to any 'Traversable' functor.--- To avoid ambiguity, either import the "Prelude" hiding these names--- or qualify uses of these function names with an alias for this module.-----------------------------------------------------------------------------------module Data.Traversable (-    -- * The 'Traversable' class-    Traversable(..),-    -- * Utility functions-    for,-    forM,-    mapAccumL,-    mapAccumR,-    -- * General definitions for superclass methods-    fmapDefault,-    foldMapDefault,-    ) where--import Prelude hiding (mapM, sequence, foldr)-import qualified Prelude (mapM, foldr)-import Control.Applicative-import Data.Foldable (Foldable())-import Data.Monoid (Monoid)-import Data.Proxy--import GHC.Arr---- | Functors representing data structures that can be traversed from--- left to right.------ Minimal complete definition: 'traverse' or 'sequenceA'.------ A definition of 'traverse' must satisfy the following laws:------ [/naturality/]---   @t . 'traverse' f = 'traverse' (t . f)@---   for every applicative transformation @t@------ [/identity/]---   @'traverse' Identity = Identity@------ [/composition/]---   @'traverse' (Compose . 'fmap' g . f) = Compose . 'fmap' ('traverse' g) . 'traverse' f@------ A definition of 'sequenceA' must satisfy the following laws:------ [/naturality/]---   @t . 'sequenceA' = 'sequenceA' . 'fmap' t@---   for every applicative transformation @t@------ [/identity/]---   @'sequenceA' . 'fmap' Identity = Identity@------ [/composition/]---   @'sequenceA' . 'fmap' Compose = Compose . 'fmap' 'sequenceA' . 'sequenceA'@------ where an /applicative transformation/ is a function------ @t :: (Applicative f, Applicative g) => f a -> g a@------ preserving the 'Applicative' operations, i.e.------  * @t ('pure' x) = 'pure' x@------  * @t (x '<*>' y) = t x '<*>' t y@------ and the identity functor @Identity@ and composition of functors @Compose@--- are defined as------ >   newtype Identity a = Identity a--- >--- >   instance Functor Identity where--- >     fmap f (Identity x) = Identity (f x)--- >--- >   instance Applicative Indentity where--- >     pure x = Identity x--- >     Identity f <*> Identity x = Identity (f x)--- >--- >   newtype Compose f g a = Compose (f (g a))--- >--- >   instance (Functor f, Functor g) => Functor (Compose f g) where--- >     fmap f (Compose x) = Compose (fmap (fmap f) x)--- >--- >   instance (Applicative f, Applicative g) => Applicative (Compose f g) where--- >     pure x = Compose (pure (pure x))--- >     Compose f <*> Compose x = Compose ((<*>) <$> f <*> x)------ (The naturality law is implied by parametricity.)------ Instances are similar to 'Functor', e.g. given a data type------ > data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)------ a suitable instance would be------ > instance Traversable Tree where--- >    traverse f Empty = pure Empty--- >    traverse f (Leaf x) = Leaf <$> f x--- >    traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r------ This is suitable even for abstract types, as the laws for '<*>'--- imply a form of associativity.------ The superclass instances should satisfy the following:------  * In the 'Functor' instance, 'fmap' should be equivalent to traversal---    with the identity applicative functor ('fmapDefault').------  * In the 'Foldable' instance, 'Data.Foldable.foldMap' should be---    equivalent to traversal with a constant applicative functor---    ('foldMapDefault').----class (Functor t, Foldable t) => Traversable t where-    -- | Map each element of a structure to an action, evaluate-    -- these actions from left to right, and collect the results.-    traverse :: Applicative f => (a -> f b) -> t a -> f (t b)-    traverse f = sequenceA . fmap f--    -- | Evaluate each action in the structure from left to right,-    -- and collect the results.-    sequenceA :: Applicative f => t (f a) -> f (t a)-    sequenceA = traverse id--    -- | Map each element of a structure to a monadic action, evaluate-    -- these actions from left to right, and collect the results.-    mapM :: Monad m => (a -> m b) -> t a -> m (t b)-    mapM f = unwrapMonad . traverse (WrapMonad . f)--    -- | Evaluate each monadic action in the structure from left to right,-    -- and collect the results.-    sequence :: Monad m => t (m a) -> m (t a)-    sequence = mapM id-    {-# MINIMAL traverse | sequenceA #-}---- instances for Prelude types--instance Traversable Maybe where-    traverse _ Nothing = pure Nothing-    traverse f (Just x) = Just <$> f x--instance Traversable [] where-    {-# INLINE traverse #-} -- so that traverse can fuse-    traverse f = Prelude.foldr cons_f (pure [])-      where cons_f x ys = (:) <$> f x <*> ys--    mapM = Prelude.mapM--instance Traversable (Either a) where-    traverse _ (Left x) = pure (Left x)-    traverse f (Right y) = Right <$> f y--instance Traversable ((,) a) where-    traverse f (x, y) = (,) x <$> f y--instance Ix i => Traversable (Array i) where-    traverse f arr = listArray (bounds arr) `fmap` traverse f (elems arr)--instance Traversable Proxy where-    traverse _ _ = pure Proxy-    {-# INLINE traverse #-}-    sequenceA _ = pure Proxy-    {-# INLINE sequenceA #-}-    mapM _ _ = return Proxy-    {-# INLINE mapM #-}-    sequence _ = return Proxy-    {-# INLINE sequence #-}--instance Traversable (Const m) where-    traverse _ (Const m) = pure $ Const m---- general functions---- | 'for' is 'traverse' with its arguments flipped.-for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)-{-# INLINE for #-}-for = flip traverse---- | 'forM' is 'mapM' with its arguments flipped.-forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)-{-# INLINE forM #-}-forM = flip mapM---- left-to-right state transformer-newtype StateL s a = StateL { runStateL :: s -> (s, a) }--instance Functor (StateL s) where-    fmap f (StateL k) = StateL $ \ s -> let (s', v) = k s in (s', f v)--instance Applicative (StateL s) where-    pure x = StateL (\ s -> (s, x))-    StateL kf <*> StateL kv = StateL $ \ s ->-        let (s', f) = kf s-            (s'', v) = kv s'-        in (s'', f v)---- |The 'mapAccumL' function behaves like a combination of 'fmap'--- and 'foldl'; it applies a function to each element of a structure,--- passing an accumulating parameter from left to right, and returning--- a final value of this accumulator together with the new structure.-mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)-mapAccumL f s t = runStateL (traverse (StateL . flip f) t) s---- right-to-left state transformer-newtype StateR s a = StateR { runStateR :: s -> (s, a) }--instance Functor (StateR s) where-    fmap f (StateR k) = StateR $ \ s -> let (s', v) = k s in (s', f v)--instance Applicative (StateR s) where-    pure x = StateR (\ s -> (s, x))-    StateR kf <*> StateR kv = StateR $ \ s ->-        let (s', v) = kv s-            (s'', f) = kf s'-        in (s'', f v)---- |The 'mapAccumR' function behaves like a combination of 'fmap'--- and 'foldr'; it applies a function to each element of a structure,--- passing an accumulating parameter from right to left, and returning--- a final value of this accumulator together with the new structure.-mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)-mapAccumR f s t = runStateR (traverse (StateR . flip f) t) s---- | This function may be used as a value for `fmap` in a `Functor`---   instance, provided that 'traverse' is defined. (Using---   `fmapDefault` with a `Traversable` instance defined only by---   'sequenceA' will result in infinite recursion.)-fmapDefault :: Traversable t => (a -> b) -> t a -> t b-{-# INLINE fmapDefault #-}-fmapDefault f = getId . traverse (Id . f)---- | This function may be used as a value for `Data.Foldable.foldMap`--- in a `Foldable` instance.-foldMapDefault :: (Traversable t, Monoid m) => (a -> m) -> t a -> m-foldMapDefault f = getConst . traverse (Const . f)---- local instances--newtype Id a = Id { getId :: a }--instance Functor Id where-    fmap f (Id x) = Id (f x)--instance Applicative Id where-    pure = Id-    Id f <*> Id x = Id (f x)-
− tests/examples/Undefined5.hs
@@ -1,66 +0,0 @@-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE QuasiQuotes #-}-module Algebra.Ring.Polynomial.Parser ( monomial, expression, variable, variableWithPower-                                      , number, integer, natural, parsePolyn) where-import           Algebra.Ring.Polynomial.Monomorphic-import           Control.Applicative                 hiding (many)-import qualified Data.Map                            as M-import           Data.Ratio-import qualified Numeric.Algebra as NA-import           Text.Peggy--[peggy|-expression :: Polynomial Rational-  = expr !.--letter :: Char-  = [a-zA-Z]--variable :: Variable-  = letter ('_' integer)? { Variable $1 (fromInteger <$> $2) }--variableWithPower :: (Variable, Integer)-  = variable "^" natural { ($1, $2) }-  / variable  { ($1, 1) }--expr :: Polynomial Rational-  = expr "+" term { $1 + $2 }-  / expr "-" term { $1 - $2 }-  / term--term :: Polynomial Rational-   = number space* monoms { injectCoeff $1 * $3 }-   / number { injectCoeff $1 }-   / monoms--monoms :: Polynomial Rational-  = monoms space * fact { $1 * $3 }-  / fact--fact :: Polynomial Rational-  = fact "^" natural { $1 ^ $2 }-  / "(" expr ")"-  / monomial { toPolyn [($1, 1)] }--monomial :: Monomial-  = variableWithPower+ { M.fromListWith (+) $1 }--number :: Rational-  = integer "/" integer { $1 % $2 }-  / integer '.' [0-9]+ { realToFrac (read (show $1 ++ '.' : $2) :: Double) }-  / integer { fromInteger $1 }--integer :: Integer-  = "-" natural { negate $1 }-  / natural--natural :: Integer-  = [1-9] [0-9]* { read ($1 : $2) }--|]--toPolyn :: [(Monomial, Ratio Integer)] -> Polynomial (Ratio Integer)-toPolyn = normalize . Polynomial . M.fromList--parsePolyn :: String -> Either ParseError (Polynomial Rational)-parsePolyn = parseString expression "polynomial"
− tests/examples/Undefined6.hs
@@ -1,238 +0,0 @@-{-# LANGUAGE BangPatterns, FlexibleContexts, MultiParamTypeClasses-           , TypeFamilies #-}--module Vision.Image.Class (-    -- * Classes-      Pixel (..), MaskedImage (..), Image (..), ImageChannel, FromFunction (..)-    , FunctorImage (..)-    -- * Functions-    , (!), (!?), nChannels, pixel-    -- * Conversion-    , Convertible (..), convert-    ) where--import Data.Convertible (Convertible (..), convert)-import Data.Int-import Data.Vector.Storable (Vector, generate, unfoldr)-import Data.Word-import Foreign.Storable (Storable)-import Prelude hiding (map, read)--import Vision.Primitive (-      Z (..), (:.) (..), Point, Size-    , fromLinearIndex, toLinearIndex, shapeLength-    )---- Classes ------------------------------------------------------------------------- | Determines the number of channels and the type of each pixel of the image--- and how images are represented.-class Pixel p where-    type PixelChannel p--    -- | Returns the number of channels of the pixel.-    ---    -- Must not consume 'p' (could be 'undefined').-    pixNChannels :: p -> Int--    pixIndex :: p -> Int -> PixelChannel p--instance Pixel Int16 where-    type PixelChannel Int16 = Int16-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Int32 where-    type PixelChannel Int32 = Int32-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Int where-    type PixelChannel Int = Int-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Word8 where-    type PixelChannel Word8 = Word8-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Word16 where-    type PixelChannel Word16 = Word16-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Word32 where-    type PixelChannel Word32 = Word32-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Word where-    type PixelChannel Word = Word-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Float where-    type PixelChannel Float = Float-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Double where-    type PixelChannel Double = Double-    pixNChannels _   = 1-    pixIndex     p _ = p--instance Pixel Bool where-    type PixelChannel Bool = Bool-    pixNChannels _   = 1-    pixIndex     p _ = p---- | Provides an abstraction for images which are not defined for each of their--- pixels. The interface is similar to 'Image' except that indexing functions--- don't always return.------ Image origin (@'ix2' 0 0@) is located in the upper left corner.-class Storable (ImagePixel i) => MaskedImage i where-    type ImagePixel i--    shape :: i -> Size--    -- | Returns the pixel\'s value at 'Z :. y, :. x'.-    maskedIndex :: i -> Point -> Maybe (ImagePixel i)-    maskedIndex img = (img `maskedLinearIndex`) . toLinearIndex (shape img)-    {-# INLINE maskedIndex #-}--    -- | Returns the pixel\'s value as if the image was a single dimension-    -- vector (row-major representation).-    maskedLinearIndex :: i -> Int -> Maybe (ImagePixel i)-    maskedLinearIndex img = (img `maskedIndex`) . fromLinearIndex (shape img)-    {-# INLINE maskedLinearIndex #-}--    -- | Returns the non-masked values of the image.-    values :: i -> Vector (ImagePixel i)-    values !img =-        unfoldr step 0-      where-        !n = shapeLength (shape img)--        step !i | i >= n                              = Nothing-                | Just p <- img `maskedLinearIndex` i = Just (p, i + 1)-                | otherwise                           = step (i + 1)-    {-# INLINE values #-}--    {-# MINIMAL shape, (maskedIndex | maskedLinearIndex) #-}--type ImageChannel i = PixelChannel (ImagePixel i)---- | Provides an abstraction over the internal representation of an image.------ Image origin is located in the lower left corner.-class MaskedImage i => Image i where-    -- | Returns the pixel value at 'Z :. y :. x'.-    index :: i -> Point -> ImagePixel i-    index img = (img `linearIndex`) . toLinearIndex (shape img)-    {-# INLINE index #-}--    -- | Returns the pixel value as if the image was a single dimension vector-    -- (row-major representation).-    linearIndex :: i -> Int -> ImagePixel i-    linearIndex img = (img `index`) . fromLinearIndex (shape img)-    {-# INLINE linearIndex #-}--    -- | Returns every pixel values as if the image was a single dimension-    -- vector (row-major representation).-    vector :: i -> Vector (ImagePixel i)-    vector img = generate (shapeLength $ shape img) (img `linearIndex`)-    {-# INLINE vector #-}--    {-# MINIMAL index | linearIndex #-}---- | Provides ways to construct an image from a function.-class FromFunction i where-    type FromFunctionPixel i--    -- | Generates an image by calling the given function for each pixel of the-    -- constructed image.-    fromFunction :: Size -> (Point -> FromFunctionPixel i) -> i--    -- | Generates an image by calling the last function for each pixel of the-    -- constructed image.-    ---    -- The first function is called for each line, generating a line invariant-    -- value.-    ---    -- This function is faster for some image representations as some recurring-    -- computation can be cached.-    fromFunctionLine :: Size -> (Int -> a)-                     -> (a -> Point -> FromFunctionPixel i) -> i-    fromFunctionLine size line f =-        fromFunction size (\pt@(Z :. y :. _) -> f (line y) pt)-    {-# INLINE fromFunctionLine #-}--    -- | Generates an image by calling the last function for each pixel of the-    -- constructed image.-    ---    -- The first function is called for each column, generating a column-    -- invariant value.-    ---    -- This function *can* be faster for some image representations as some-    -- recurring computations can be cached. However, it may requires a vector-    -- allocation for these values. If the column invariant is cheap to-    -- compute, prefer 'fromFunction'.-    fromFunctionCol :: Storable b => Size -> (Int -> b)-                    -> (b -> Point -> FromFunctionPixel i) -> i-    fromFunctionCol size col f =-        fromFunction size (\pt@(Z :. _ :. x) -> f (col x) pt)-    {-# INLINE fromFunctionCol #-}--    -- | Generates an image by calling the last function for each pixel of the-    -- constructed image.-    ---    -- The two first functions are called for each line and for each column,-    -- respectively, generating common line and column invariant values.-    ---    -- This function is faster for some image representations as some recurring-    -- computation can be cached. However, it may requires a vector-    -- allocation for column values. If the column invariant is cheap to-    -- compute, prefer 'fromFunctionLine'.-    fromFunctionCached :: Storable b => Size-                       -> (Int -> a)               -- ^ Line function-                       -> (Int -> b)               -- ^ Column function-                       -> (a -> b -> Point-                           -> FromFunctionPixel i) -- ^ Pixel function-                       -> i-    fromFunctionCached size line col f =-        fromFunction size (\pt@(Z :. y :. x) -> f (line y) (col x) pt)-    {-# INLINE fromFunctionCached #-}--    {-# MINIMAL fromFunction #-}---- | Defines a class for images on which a function can be applied. The class is--- different from 'Functor' as there could be some constraints and--- transformations the pixel and image types.-class (MaskedImage src, MaskedImage res) => FunctorImage src res where-    map :: (ImagePixel src -> ImagePixel res) -> src -> res---- Functions ----------------------------------------------------------------------- | Alias of 'maskedIndex'.-(!?) :: MaskedImage i => i -> Point -> Maybe (ImagePixel i)-(!?) = maskedIndex-{-# INLINE (!?) #-}---- | Alias of 'index'.-(!) :: Image i => i -> Point -> ImagePixel i-(!) = index-{-# INLINE (!) #-}---- | Returns the number of channels of an image.-nChannels :: (Pixel (ImagePixel i), MaskedImage i) => i -> Int-nChannels img = pixNChannels (pixel img)-{-# INLINE nChannels #-}---- | Returns an 'undefined' instance of a pixel of the image. This is sometime--- useful to satisfy the type checker as in a call to 'pixNChannels' :------ > nChannels img = pixNChannels (pixel img)-pixel :: MaskedImage i => i -> ImagePixel i-pixel _ = undefined
− tests/examples/Undefined7.hs
@@ -1,76 +0,0 @@-{-# LANGUAGE TemplateHaskell, QuasiQuotes, StandaloneDeriving, DeriveDataTypeable #-}--module Test where--import Control.Applicative-import Control.Monad-import qualified Data.ByteString as B-import qualified Data.ByteString.Lazy as L-import Data.Binary-import Data.Binary.Get-import Data.Binary.Put-import qualified Data.Map as M-import Data.Generics--import Data.Binary.ISO8583-import Data.Binary.ISO8583.TH--[binary|-  Message-  2 pan embedded 2-  4 amount int 12-  11 stan int 6-  43 termAddress TermAddress 222-|]--deriving instance Eq Message-deriving instance Show Message--data TermAddress = TermAddress {-      tOwner :: B.ByteString,-      tCity :: B.ByteString,-      tOther :: L.ByteString }-  deriving (Eq, Show, Typeable)--instance Binary TermAddress where-  -- NB: this implementation is smth odd and usable only for this testcase.-  get =-    TermAddress-      <$> B.filter (/= 0x20) `fmap` getByteString 30-      <*> B.filter (/= 0x20) `fmap` getByteString 30-      <*> L.filter (/= 0x20) `fmap` getRemainingLazyByteString--  put (TermAddress owner city other) = do-    putByteStringPad 30 owner-    putByteStringPad 30 city-    putLazyByteStringPad 162 other--instance Binary Message where-  get = do-    m <- getBitmap getMessage-    return $ constructMessage m--  put msg = do-    putBitmap' (putMessage msg)--testMsg :: Message-testMsg = Message {-  pan = Just $ toBS "12345678",-  amount = Just $ 100500,-  stan = Just $ 123456,-  termAddress = Just $ TermAddress {-                  tOwner = toBS "TestBank",-                  tCity = toBS "Magnitogorsk",-                  tOther = L.empty }-}--test :: IO ()-test = do-  let bstr = encode testMsg-      msg = decode bstr-  if msg /= testMsg-    then fail $ "Encode/decode mismatch:\n" ++-           show testMsg ++ "\n /= \n" ++-           show msg-    else putStrLn "passed."-
− tests/examples/Undefined8.hs
@@ -1,134 +0,0 @@-{-# LANGUAGE QuasiQuotes, TypeFamilies, PackageImports #-}--module Text.Markdown.Pap.Parser (-    parseMrd-) where--import Control.Arrow-import "monads-tf" Control.Monad.State-import "monads-tf" Control.Monad.Error-import Data.Maybe-import Data.Char-import Text.Papillon--import Text.Markdown.Pap.Text--parseMrd :: String -> Maybe [Text]-parseMrd src = case flip runState (0, [- 1]) $ runErrorT $ markdown $ parse src of-    (Right (r, _), _) -> Just r-    _ -> Nothing--clear :: State (Int, [Int]) Bool-clear = put (0, [- 1]) >> return True--reset :: State (Int, [Int]) Bool-reset = modify (first $ const 0) >> return True--count :: State (Int, [Int]) ()-count = modify $ first (+ 1)--deeper :: State (Int, [Int]) Bool-deeper = do-    (n, n0 : ns) <- get-    if n > n0 then put (n, n : n0 : ns) >> return True else return False--same :: State (Int, [Int]) Bool-same = do-    (n, n0 : _) <- get-    return $ n == n0--shallow :: State (Int, [Int]) Bool-shallow = do-    (n, n0 : ns) <- get-    if n < n0 then put (n, ns) >> return True else return False--[papillon|--monad: State (Int, [Int])--markdown :: [Text]-    = md:(m:markdown1 _:dmmy[clear] { return m })*      { return md }--markdown1 :: Text-    = h:header              { return h }-    / l:link '\n'*              { return l }-    / i:image '\n'*             { return i }-    / l:list '\n'*              { return $ List l }-    / c:code                { return $ Code c }-    / p:paras               { return $ Paras p }--header :: Text-    = n:sharps _:<isSpace>* l:line '\n'+    { return $ Header n l }-    / l:line '\n' _:equals '\n'+        { return $ Header 1 l }-    / l:line '\n' _:hyphens '\n'+       { return $ Header 2 l }--sharps :: Int-    = '#' n:sharps              { return $ n + 1 }-    / '#'                   { return 1 }--equals :: ()-    = '=' _:equals-    / '='--hyphens :: ()-    = '-' _:hyphens-    / '-'--line :: String-    = l:<(`notElem` "#\n")>+        { return l }--line' :: String-    = l:<(`notElem` "\n")>+         { return l }--code :: String-    = l:fourSpacesLine c:code       { return $ l ++ c }-    / l:fourSpacesLine          { return l }--fourSpacesLine :: String-    = _:fourSpaces l:line' ns:('\n' { return '\n' })+   { return $ l ++ ns }--fourSpaces :: ()-    = ' ' ' ' ' ' ' '--list :: List = _:cnt _:dmmy[deeper] l:list1 ls:list1'* _:shllw  { return $ l : ls }--cnt :: () = _:dmmy[reset] _:(' ' { count })*--list1' :: List1-    = _:cnt _:dmmy[same] l:list1        { return l }--list1 :: List1-    = _:listHead ' ' l:line '\n' ls:list?-        { return $ BulItem l $ fromMaybe [] ls }-    / _:nListHead ' ' l:line '\n' ls:list?-        { return $ OrdItem l $ fromMaybe [] ls }--listHead :: ()-    = '*' / '-' / '+'--nListHead :: ()-    = _:<isDigit>+ '.'--paras :: [String]-    = ps:para+              { return ps }--para :: String-    = ls:(!_:('!') !_:listHead !_:nListHead !_:header !_:fourSpaces l:line '\n' { return l })+ _:('\n' / !_ / !_:para)-                        { return $ unwords ls }--shllw :: ()-    = _:dmmy[shallow]-    / !_-    / !_:list--dmmy :: () =--link :: Text-    = '[' t:<(/= ']')>+ ']' ' '* '(' a:<(/= ')')>+ ')' { return $ Link t a "" }--image :: Text-    = '!' '[' alt:<(/= ']')>+ ']' ' '* '(' addrs:<(`notElem` ")\" ")>+ ' '*-        '"' t:<(/= '"')>+ '"' ')'-        { return $ Image alt addrs t }--|]
− tests/examples/Undefined9.hs
@@ -1,30 +0,0 @@-{-# LANGUAGE QuasiQuotes, TypeFamilies #-}--module Image.PNG (isPNG, pngSize) where--import Data.Maybe-import File.Binary.PNG-import File.Binary-import File.Binary.Instances-import File.Binary.Instances.BigEndian--isPNG :: String -> Bool-isPNG img = isJust (fromBinary () img :: Maybe (PNGHeader, String))--pngSize :: String -> Maybe (Double, Double)-pngSize src = case getChunks src of-    Right cs -> Just-        (fromIntegral $ width $ ihdr cs, fromIntegral $ height $ ihdr cs)-    _ -> Nothing--[binary|--PNGHeader deriving Show--1: 0x89-3: "PNG"-2: "\r\n"-1: "\SUB"-1: "\n"--|]
− tests/examples/Unicode.hs
@@ -1,31 +0,0 @@-{-# LANGUAGE UnicodeSyntax #-}--module Unicode where--import Control.Monad.Trans.State.Strict---- | We'll start off with a monad in which to manipulate ABTs; we'll need some--- state for fresh variable generation.----newtype M α-  = M-  { _M ∷ State Int α-  }---- | We'll run an ABT computation by starting the variable counter at @0@.----runM ∷ M α → α-runM (M m) = evalState m 0----- | To indicate that a term is in normal form.----stepsExhausted-  ∷ Applicative m-  ⇒ StepT m α-stepsExhausted = StepT . MaybeT $ pure Nothing--stepsExhausted2-  ∷ Applicative m-  => m α-stepsExhausted2 = undefined
− tests/examples/UnicodeRules.hs
@@ -1,16 +0,0 @@-{-# LANGUAGE-    BangPatterns-  , FlexibleContexts-  , FlexibleInstances-  , ScopedTypeVariables-  , UnboxedTuples-  , UndecidableInstances-  , UnicodeSyntax-  #-}--strictHead ∷ G.Bitstream (Packet d) ⇒ Bitstream d → Bool-{-# RULES "head → strictHead" [1]-    ∀(v ∷ G.Bitstream (Packet d) ⇒ Bitstream d).-    head v = strictHead v #-}-{-# INLINE strictHead #-}-strictHead (Bitstream _ v) = head (SV.head v)
− tests/examples/UnicodeRules.hs.bad
@@ -1,16 +0,0 @@-{-# LANGUAGE-    BangPatterns-  , FlexibleContexts-  , FlexibleInstances-  , ScopedTypeVariables-  , UnboxedTuples-  , UndecidableInstances-  , UnicodeSyntax-  #-}--strictHead ∷ G.Bitstream (Packet d) ⇒ Bitstream d → Bool-{-# RULES "head \8594 strictHead" [1]-    ∀(v ∷ G.Bitstream (Packet d) ⇒ Bitstream d).-    head v = strictHead v #-}-{-# INLINE strictHead #-}-strictHead (Bitstream _ v) = head (SV.head v)
− tests/examples/UnicodeSyntax.hs
@@ -1,236 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE LambdaCase #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE UnicodeSyntax #-}-{-# LANGUAGE ViewPatterns #-}-{-# LANGUAGE Arrows          #-}--module Tutorial where---- import Abt.Class--- import Abt.Types--- import Abt.Concrete.LocallyNameless--import Control.Applicative-import Control.Monad.Trans.State.Strict-import Control.Monad.Trans.Maybe-import Control.Monad.Trans.Except--- import Data.Vinyl-import Prelude hiding (pi)---- | We'll start off with a monad in which to manipulate ABTs; we'll need some--- state for fresh variable generation.----newtype M α-  = M-  { _M ∷ State Int α-  } deriving (Functor, Applicative, Monad)---- | We'll run an ABT computation by starting the variable counter at @0@.----runM ∷ M α → α-runM (M m) = evalState m 0---- | Check out the source to see fresh variable generation.----instance MonadVar Var M where-  fresh = M $ do-    n ← get-    let n' = n + 1-    put n'-    return $ Var Nothing n'--  named a = do-    v ← fresh-    return $ v { _varName = Just a }---- | Next, we'll define the operators for a tiny lambda calculus as a datatype--- indexed by arities.----data Lang ns where-  LAM ∷ Lang '[S Z]-  APP ∷ Lang '[Z, Z]-  PI ∷ Lang '[Z, S Z]-  UNIT ∷ Lang '[]-  AX ∷ Lang '[]--instance Show1 Lang where-  show1 = \case-    LAM → "lam"-    APP → "ap"-    PI → "pi"-    UNIT → "unit"-    AX → "<>"--instance HEq1 Lang where-  heq1 LAM LAM = Just Refl-  heq1 APP APP = Just Refl-  heq1 PI PI = Just Refl-  heq1 UNIT UNIT = Just Refl-  heq1 AX AX = Just Refl-  heq1 _ _ = Nothing--lam ∷ Tm Lang (S Z) → Tm0 Lang-lam e = LAM $$ e :& RNil--app ∷ Tm0 Lang → Tm0 Lang → Tm0 Lang-app m n = APP $$ m :& n :& RNil--ax ∷ Tm0 Lang-ax = AX $$ RNil--unit ∷ Tm0 Lang-unit = UNIT $$ RNil--pi ∷ Tm0 Lang → Tm Lang (S Z) → Tm0 Lang-pi α xβ = PI $$ α :& xβ :& RNil---- | A monad transformer for small step operational semantics.----newtype StepT m α-  = StepT-  { runStepT ∷ MaybeT m α-  } deriving (Monad, Functor, Applicative, Alternative)---- | To indicate that a term is in normal form.----stepsExhausted-  ∷ Applicative m-  ⇒ StepT m α-stepsExhausted = StepT . MaybeT $ pure Nothing--instance MonadVar Var m ⇒ MonadVar Var (StepT m) where-  fresh = StepT . MaybeT $ Just <$> fresh-  named str = StepT . MaybeT $ Just <$> named str---- | A single evaluation step.----step-  ∷ Tm0 Lang-  → StepT M (Tm0 Lang)-step tm =-  out tm >>= \case-    APP :$ m :& n :& RNil →-      out m >>= \case-        LAM :$ xe :& RNil → xe // n-        _ → app <$> step m <*> pure n <|> app <$> pure m <*> step n-    PI :$ α :& xβ :& RNil → pi <$> step α <*> pure xβ-    _ → stepsExhausted---- | The reflexive-transitive closure of a small-step operational semantics.----star-  ∷ Monad m-  ⇒ (α → StepT m α)-  → (α → m α)-star f a =-  runMaybeT (runStepT $ f a) >>=-    return a `maybe` star f---- | Evaluate a term to normal form----eval ∷ Tm0 Lang → Tm0 Lang-eval = runM . star step--newtype JudgeT m α-  = JudgeT-  { runJudgeT ∷ ExceptT String m α-  } deriving (Monad, Functor, Applicative, Alternative)--instance MonadVar Var m ⇒ MonadVar Var (JudgeT m) where-  fresh = JudgeT . ExceptT $ Right <$> fresh-  named str = JudgeT . ExceptT $ Right <$> named str--type Ctx = [(Var, Tm0 Lang)]--raise ∷ Monad m ⇒ String → JudgeT m α-raise = JudgeT . ExceptT . return . Left--checkTy-  ∷ Ctx-  → Tm0 Lang-  → Tm0 Lang-  → JudgeT M ()-checkTy g tm ty = do-  let ntm = eval tm-      nty = eval ty-  (,) <$> out ntm <*> out nty >>= \case-    (LAM :$ xe :& RNil, PI :$ α :& yβ :& RNil) → do-      z ← fresh-      ez ← xe // var z-      βz ← yβ // var z-      checkTy ((z,α):g) ez βz-    (AX :$ RNil, UNIT :$ RNil) → return ()-    _ → do-      ty' ← inferTy g tm-      if ty' === nty-        then return ()-        else raise "Type error"--inferTy-  ∷ Ctx-  → Tm0 Lang-  → JudgeT M (Tm0 Lang)-inferTy g tm = do-  out (eval tm) >>= \case-    V v | Just (eval → ty) ← lookup v g → return ty-        | otherwise → raise "Ill-scoped variable"-    APP :$ m :& n :& RNil → do-      inferTy g m >>= out >>= \case-        PI :$ α :& xβ :& RNil → do-          checkTy g n α-          eval <$> xβ // n-        _ → raise "Expected pi type for lambda abstraction"-    _ → raise "Only infer neutral terms"---- | @λx.x@----identityTm ∷ M (Tm0 Lang)-identityTm = do-  x ← fresh-  return $ lam (x \\ var x)---- | @(λx.x)(λx.x)@----appTm ∷ M (Tm0 Lang)-appTm = do-  tm ← identityTm-  return $ app tm tm---- | A demonstration of evaluating (and pretty-printing). Output:------ @--- ap[lam[\@2.\@2];lam[\@3.\@3]] ~>* lam[\@4.\@4]--- @----main ∷ IO ()-main = do-  -- Try out the type checker-  either fail print . runM . runExceptT . runJudgeT $ do-    x ← fresh-    checkTy [] (lam (x \\ var x)) (pi unit (x \\ unit))--  print . runM $ do-    mm ← appTm-    mmStr ← toString mm-    mmStr' ← toString $ eval mm-    return $ mmStr ++ " ~>* " ++ mmStr'--doMap ∷ FilePath → IOSArrow XmlTree TiledMap-doMap mapPath = proc m → do-    mapWidth       ← getAttrR "width"      ⤙ m-    returnA -< baz---- ^ An opaque ESD handle for recording data from the soundcard via ESD.-data Recorder fr ch (r ∷ ★ → ★)-    = Recorder {-        reRate   ∷ !Int-      , reHandle ∷ !Handle-      , reCloseH ∷ !(FinalizerHandle r)-      }-
− tests/examples/UnicodeSyntax.hs.bad
@@ -1,236 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE FlexibleContexts #-}-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE GeneralizedNewtypeDeriving #-}-{-# LANGUAGE LambdaCase #-}-{-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE ScopedTypeVariables #-}-{-# LANGUAGE UnicodeSyntax #-}-{-# LANGUAGE ViewPatterns #-}-{-# LANGUAGE Arrows          #-}--module Tutorial where---- import Abt.Class--- import Abt.Types--- import Abt.Concrete.LocallyNameless--import Control.Applicative-import Control.Monad.Trans.State.Strict-import Control.Monad.Trans.Maybe-import Control.Monad.Trans.Except--- import Data.Vinyl-import Prelude hiding (pi)---- | We'll start off with a monad in which to manipulate ABTs; we'll need some--- state for fresh variable generation.----newtype M α-  = M-  { _M ∷ State Int α-  } deriving (Functor, Applicative, Monad)---- | We'll run an ABT computation by starting the variable counter at @0@.----runM ∷ M α → α-runM (M m) = evalState m 0---- | Check out the source to see fresh variable generation.----instance MonadVar Var M where-  fresh = M $ do-    n ← get-    let n' = n + 1-    put n'-    return $ Var Nothing n'--  named a = do-    v ← fresh-    return $ v { _varName = Just a }---- | Next, we'll define the operators for a tiny lambda calculus as a datatype--- indexed by arities.----data Lang ns where-  LAM ∷ Lang '[S Z]-  APP ∷ Lang '[Z, Z]-  PI ∷ Lang '[Z, S Z]-  UNIT ∷ Lang '[]-  AX ∷ Lang '[]--instance Show1 Lang where-  show1 = \case-    LAM → "lam"-    APP → "ap"-    PI → "pi"-    UNIT → "unit"-    AX → "<>"--instance HEq1 Lang where-  heq1 LAM LAM = Just Refl-  heq1 APP APP = Just Refl-  heq1 PI PI = Just Refl-  heq1 UNIT UNIT = Just Refl-  heq1 AX AX = Just Refl-  heq1 _ _ = Nothing--lam ∷ Tm Lang (S Z) → Tm0 Lang-lam e = LAM $$ e :& RNil--app ∷ Tm0 Lang → Tm0 Lang → Tm0 Lang-app m n = APP $$ m :& n :& RNil--ax ∷ Tm0 Lang-ax = AX $$ RNil--unit ∷ Tm0 Lang-unit = UNIT $$ RNil--pi ∷ Tm0 Lang → Tm Lang (S Z) → Tm0 Lang-pi α xβ = PI $$ α :& xβ :& RNil---- | A monad transformer for small step operational semantics.----newtype StepT m α-  = StepT-  { runStepT ∷ MaybeT m α-  } deriving (Monad, Functor, Applicative, Alternative)---- | To indicate that a term is in normal form.----stepsExhausted-  ∷ Applicative m-  ⇒ StepT m α-stepsExhausted = StepT . MaybeT $ pure Nothing--instance MonadVar Var m ⇒ MonadVar Var (StepT m) where-  fresh = StepT . MaybeT $ Just <$> fresh-  named str = StepT . MaybeT $ Just <$> named str---- | A single evaluation step.----step-  ∷ Tm0 Lang-  → StepT M (Tm0 Lang)-step tm =-  out tm >>= \case-    APP :$ m :& n :& RNil →-      out m >>= \case-        LAM :$ xe :& RNil → xe // n-        _ → app <$> step m <*> pure n <|> app <$> pure m <*> step n-    PI :$ α :& xβ :& RNil → pi <$> step α <*> pure xβ-    _ → stepsExhausted---- | The reflexive-transitive closure of a small-step operational semantics.----star-  ∷ Monad m-  ⇒ (α → StepT m α)-  → (α → m α)-star f a =-  runMaybeT (runStepT $ f a) >>=-    return a `maybe` star f---- | Evaluate a term to normal form----eval ∷ Tm0 Lang → Tm0 Lang-eval = runM . star step--newtype JudgeT m α-  = JudgeT-  { runJudgeT ∷ ExceptT String m α-  } deriving (Monad, Functor, Applicative, Alternative)--instance MonadVar Var m ⇒ MonadVar Var (JudgeT m) where-  fresh = JudgeT . ExceptT $ Right <$> fresh-  named str = JudgeT . ExceptT $ Right <$> named str--type Ctx = [(Var, Tm0 Lang)]--raise ∷ Monad m ⇒ String → JudgeT m α-raise = JudgeT . ExceptT . return . Left--checkTy-  ∷ Ctx-  → Tm0 Lang-  → Tm0 Lang-  → JudgeT M ()-checkTy g tm ty = do-  let ntm = eval tm-      nty = eval ty-  (,) <$> out ntm <*> out nty >>= \case-    (LAM :$ xe :& RNil, PI :$ α :& yβ :& RNil) → do-      z ← fresh-      ez ← xe // var z-      βz ← yβ // var z-      checkTy ((z,α):g) ez βz-    (AX :$ RNil, UNIT :$ RNil) → return ()-    _ → do-      ty' ← inferTy g tm-      if ty' === nty-        then return ()-        else raise "Type error"--inferTy-  ∷ Ctx-  → Tm0 Lang-  → JudgeT M (Tm0 Lang)-inferTy g tm = do-  out (eval tm) >>= \case-    V v | Just (eval → ty) ← lookup v g → return ty-        | otherwise → raise "Ill-scoped variable"-    APP :$ m :& n :& RNil → do-      inferTy g m >>= out >>= \case-        PI :$ α :& xβ :& RNil → do-          checkTy g n α-          eval <$> xβ // n-        _ → raise "Expected pi type for lambda abstraction"-    _ → raise "Only infer neutral terms"---- | @λx.x@----identityTm ∷ M (Tm0 Lang)-identityTm = do-  x ← fresh-  return $ lam (x \\ var x)---- | @(λx.x)(λx.x)@----appTm ∷ M (Tm0 Lang)-appTm = do-  tm ← identityTm-  return $ app tm tm---- | A demonstration of evaluating (and pretty-printing). Output:------ @--- ap[lam[\@2.\@2];lam[\@3.\@3]] ~>* lam[\@4.\@4]--- @----main ∷ IO ()-main = do-  -- Try out the type checker-  either fail print . runM . runExceptT . runJudgeT $ do-    x ← fresh-    checkTy [] (lam (x \\ var x)) (pi unit (x \\ unit))--  print . runM $ do-    mm ← appTm-    mmStr ← toString mm-    mmStr' ← toString $ eval mm-    return $ mmStr ++ " ~>* " ++ mmStr'--doMap ∷ FilePath → IOSArrow XmlTree TiledMap-doMap mapPath = proc m → do-    mapWidth       ← getAttrR "width"      ⤙ m-    returnA -< baz---- ^ An opaque ESD handle for recording data from the soundcard via ESD.-data Recorder fr ch (r ∷ * → *)-    = Recorder {-        reRate   ∷ !Int-      , reHandle ∷ !Handle-      , reCloseH ∷ !(FinalizerHandle r)-      }-
− tests/examples/UnicodeSyntaxFailure.hs
@@ -1,3 +0,0 @@-{-# LANGUAGE UnicodeSyntax #-}--foo x = addToEnv (∀)
− tests/examples/Utilities.hs
@@ -1,17 +0,0 @@-module Utilities (toBinary, fl) where--import Stream-import Data.Ratio---- Convert from an Integer to its signed-digit representation-toBinary :: Integer -> Stream-toBinary 0 = [0]-toBinary x = toBinary t ++ [x `mod` 2]-             where t = x `div` 2----fl :: Stream -> Stream-fl (x:xs) = (f x):xs-          where f 0 = 1-                f 1 = 0
− tests/examples/Utils2.hs
@@ -1,86 +0,0 @@-{-# LANGUAGE FlexibleInstances #-}-{-# LANGUAGE StandaloneDeriving #-}-module Utils2 where---import Control.Applicative (Applicative(..))-import Control.Monad (when, liftM, ap)-import Control.Exception-import Data.Data-import Data.List-import Data.Maybe-import Data.Monoid---- import Language.Haskell.GHC.ExactPrint.Utils-import Language.Haskell.GHC.ExactPrint.Types hiding (showGhc)--import qualified Bag            as GHC-import qualified BasicTypes     as GHC-import qualified BooleanFormula as GHC-import qualified Class          as GHC-import qualified CoAxiom        as GHC-import qualified DynFlags       as GHC-import qualified FastString     as GHC-import qualified ForeignCall    as GHC-import qualified GHC            as GHC-import qualified GHC.Paths      as GHC-import qualified Lexer          as GHC-import qualified Name           as GHC-import qualified NameSet        as GHC-import qualified Outputable     as GHC-import qualified RdrName        as GHC-import qualified SrcLoc         as GHC-import qualified StringBuffer   as GHC-import qualified UniqSet        as GHC-import qualified Unique         as GHC-import qualified Var            as GHC--import qualified Data.Map as Map---- -----------------------------------------------------------------------instance AnnotateP GHC.RdrName where-  annotateP l n = do-    case rdrName2String n of-      "[]" -> do-        addDeltaAnnotation GHC.AnnOpenS -- '[' nonBUG-        addDeltaAnnotation GHC.AnnCloseS -- ']' BUG-      "()" -> do-        addDeltaAnnotation GHC.AnnOpenP -- '('-        addDeltaAnnotation GHC.AnnCloseP -- ')'-      "(##)" -> do-        addDeltaAnnotation GHC.AnnOpen -- '(#'-        addDeltaAnnotation GHC.AnnClose -- '#)'-      "[::]" -> do-        addDeltaAnnotation GHC.AnnOpen -- '[:'-        addDeltaAnnotation GHC.AnnClose -- ':]'-      _ ->  do-        addDeltaAnnotation GHC.AnnType-        addDeltaAnnotation GHC.AnnOpenP -- '('-        addDeltaAnnotationLs GHC.AnnBackquote 0-        addDeltaAnnotations GHC.AnnCommaTuple -- For '(,,,)'-        cnt <- countAnnsAP GHC.AnnVal-        cntT <- countAnnsAP GHC.AnnCommaTuple-        cntR <- countAnnsAP GHC.AnnRarrow-        case cnt of-          0 -> if cntT >0 || cntR >0 then return () else addDeltaAnnotationExt l GHC.AnnVal-          1 -> addDeltaAnnotation GHC.AnnVal-          x -> error $ "annotateP.RdrName: too many AnnVal :" ++ showGhc (l,x)-        addDeltaAnnotation GHC.AnnTildehsh-        addDeltaAnnotation GHC.AnnTilde-        addDeltaAnnotation GHC.AnnRarrow-        addDeltaAnnotationLs GHC.AnnBackquote 1-        addDeltaAnnotation GHC.AnnCloseP -- ')'--  -- temporary, for test-class (Typeable ast) => AnnotateP ast where-  annotateP :: GHC.SrcSpan -> ast -> IO ()--addDeltaAnnotation = undefined-addDeltaAnnotations = undefined-addDeltaAnnotationLs = undefined-addDeltaAnnotationExt = undefined-countAnnsAP = undefined-showGhc = undefined-rdrName2String = undefined-
− tests/examples/Vect.hs
@@ -1,70 +0,0 @@-{-# LANGUAGE ParallelArrays #-}-{-# OPTIONS_GHC -fvectorise #-}-{-# LANGUAGE UnboxedTuples #-}--module Vect where---- import Data.Array.Parallel---{-# VECTORISe isFive = blah #-}-{-# NoVECTORISE isEq #-}--{-# VECTORISE SCALAR type Int  #-}-{-# VECTORISE        type Char #-}-{-# VECTORISE        type ( ) #-}-{-# VECTORISE        type (# #) #-}--{-# VECTORISE SCALAR type Integer = Int #-}-{-# VECTORISE        type Bool    = String  #-}--{-# Vectorise class Eq #-}--blah = 5--data MyBool = MyTrue | MyFalse--class Eq a => Cmp a where-  cmp :: a -> a -> Bool---- FIXME:--- instance Cmp Int where---   cmp = (==)--- isFive :: (Eq a, Num a) => a -> Bool-isFive :: Int -> Bool-isFive x = x == 5--isEq :: Eq a => a -> Bool-isEq x = x == x---fiveEq :: Int -> Bool-fiveEq x = isFive x && isEq x--cmpArrs :: PArray Int -> PArray Int -> Bool-{-# NOINLINE cmpArrs #-}-cmpArrs v w = cmpArrs' (fromPArrayP v) (fromPArrayP w)--cmpArrs' :: [:Int:] -> [:Int:] -> Bool-cmpArrs' xs ys = andP [:x == y | x <- xs | y <- ys:]--isFives :: PArray Int -> Bool-{-# NOINLINE isFives #-}-isFives xs = isFives' (fromPArrayP xs)--isFives' :: [:Int:] -> Bool-isFives' xs = andP (mapP isFive xs)--isEqs :: PArray Int -> Bool-{-# NOINLINE isEqs #-}-isEqs xs = isEqs' (fromPArrayP xs)--isEqs' :: [:Int:] -> Bool-isEqs' xs = undefined -- andP (mapP isEq xs)---- fudge for compiler--fromPArrayP = undefined-andP = undefined-mapP = undefined-data PArray a = PArray a
− tests/examples/ViewPatterns.hs
@@ -1,23 +0,0 @@-{-# LANGUAGE ViewPatterns #-}---- From https://ghc.haskell.org/trac/ghc/wiki/ViewPatterns-import Prelude hiding (length)--data JList a = Empty-             | Single a-             | Join (JList a) (JList a)--data JListView a = Nil-                 | Cons a (JList a)---view :: JList a -> JListView a-view Empty = Nil-view (Single a) = Cons a Empty-view (Join (view -> Cons xh xt) y) = Cons xh $ Join xt y-view (Join (view -> Nil) y) = view y--length :: JList a -> Integer-length (view -> Nil) = 0-length (view -> Cons x xs) = 1 + length xs-
− tests/examples/Warning.hs
@@ -1,16 +0,0 @@--module Warning-{-# WARNINg ["This is a module warning",-             "multi-line"] #-}-  where--{-# Warning   foo ,  bar-         ["This is a multi-line",-          "deprecation message",-          "for foo"] #-}-foo :: Int-foo = 4--bar :: Char-bar = 'c'-
− tests/examples/WhereIn3.hs
@@ -1,19 +0,0 @@-module WhereIn3 where----A definition can be demoted to the local 'where' binding of a friend declaration,---if it is only used by this friend declaration.----Demoting a definition narrows down the scope of the definition.---In this example, demote the top level 'sq' to 'sumSquares'---In this case (there are multi matches), the parameters are not folded after demoting.--sumSquares x y = sq p x + sq p y-         where p=2  {-There is a comment-}--sq :: Int -> Int -> Int-sq pow 0 = 0      --prior comment-sq pow {- blah -} z = z^pow  --there is a comment---- A leading comment-anotherFun 0 y = sq y-     where  sq x = x^2
− tests/examples/WhereIn3.hs.expected
@@ -1,16 +0,0 @@-module WhereIn3 where----A definition can be demoted to the local 'where' binding of a friend declaration,---if it is only used by this friend declaration.----Demoting a definition narrows down the scope of the definition.---In this example, demote the top level 'sq' to 'sumSquares'---In this case (there are multi matches), the parameters are not folded after demoting.--sumSquares x y = sq p x + sq p y-         where p=2  {-There is a comment-}--sq :: Int -> Int -> Int--anotherFun 0 y = sq y-     where  sq x = x^2
− tests/examples/WhereIn3a.hs
@@ -1,19 +0,0 @@-module WhereIn3a where----A definition can be demoted to the local 'where' binding of a friend declaration,---if it is only used by this friend declaration.----Demoting a definition narrows down the scope of the definition.---In this example, demote the top level 'sq' to 'sumSquares'---In this case (there are multi matches), the parameters are not folded after demoting.--sumSquares x y = sq p x + sq p y-         where p=2  {-There is a comment-}--sq :: Int -> Int -> Int-sq pow 0 = 0      -- prior comment-sq pow z = z^pow  --there is a comment---- A leading comment-anotherFun 0 y = sq y-     where  sq x = x^2
− tests/examples/WhereIn3a.hs.expected
@@ -1,25 +0,0 @@-module WhereIn3a where---- A leading comment-anotherFun 0 y = sq y-     where  sq x = x^2-sq pow 0 = 0      -- prior comment-sq pow z = z^pow  --there is a comment----A definition can be demoted to the local 'where' binding of a friend declaration,---if it is only used by this friend declaration.----Demoting a definition narrows down the scope of the definition.---In this example, demote the top level 'sq' to 'sumSquares'---In this case (there are multi matches), the parameters are not folded after demoting.--sumSquares x y = sq p x + sq p y-         where p=2  {-There is a comment-}--sq :: Int -> Int -> Int-sq pow 0 = 0      -- prior comment-sq pow z = z^pow  --there is a comment---- A leading comment-anotherFun 0 y = sq y-     where  sq x = x^2
− tests/examples/WhereIn4.hs
@@ -1,19 +0,0 @@-module WhereIn4 where----A definition can be demoted to the local 'where' binding of a friend declaration,---if it is only used by this friend declaration.----Demoting a definition narrows down the scope of the definition.---In this example, demote the top level 'sq' to 'sumSquares'---In this case (there is single matches), if possible,---the parameters will be folded after demoting and type sigature will be removed.--sumSquares x y = sq p x + sq p y-         where p=2  {-There is a comment-}--sq::Int->Int->Int-sq pow z = z^pow  --there is a comment--anotherFun 0 y = sq y-     where  sq x = x^2-
− tests/examples/WhereIn4.hs.expected
@@ -1,19 +0,0 @@-module WhereIn4 where----A definition can be demoted to the local 'where' binding of a friend declaration,---if it is only used by this friend declaration.----Demoting a definition narrows down the scope of the definition.---In this example, demote the top level 'sq' to 'sumSquares'---In this case (there is single matches), if possible,---the parameters will be folded after demoting and type sigature will be removed.--sumSquares x y = sq p x + sq p y-         where p_2=2  {-There is a comment-}--sq::Int->Int->Int-sq pow z = z^pow  --there is a comment--anotherFun 0 y = sq y-     where  sq x = x^2-
− tests/examples/Zipper.hs
@@ -1,168 +0,0 @@-{-# LANGUAGE ExistentialQuantification #-}-{-# LANGUAGE GADTs #-}-{-# LANGUAGE Rank2Types #-}--------------------------------------------------------------------------------- |--- Module      :  Data.Generics.Zipper--- Copyright   :  (c) Michael D. Adams, 2010--- License     :  BSD-style (see the LICENSE file)------ ``Scrap Your Zippers: A Generic Zipper for Heterogeneous Types.--- Michael D. Adams.  WGP '10: Proceedings of the 2010 ACM SIGPLAN--- workshop on Generic programming, 2010.''------ See <http://www.cs.indiana.edu/~adamsmd/papers/scrap_your_zippers/>-----------------------------------------------------------------------------------{-# OPTIONS -Wall #-}-{-# LANGUAGE Rank2Types, GADTs #-}--module Zipper where--import Data.Generics-import Control.Monad ((<=<), MonadPlus, mzero, mplus, liftM)-import Data.Maybe (fromJust)---- Core types---- | A generic zipper with a root object of type @root@.-data Zipper root =-  forall hole. (Data hole) =>-    Zipper hole (Context hole root)------ Internal types and functions-data Context hole root where-    CtxtNull :: Context a a-    CtxtCons ::-      forall hole root rights parent. (Data parent) =>-        Left (hole -> rights)-        -> Right rights parent-        -> Context parent root-        -> Context hole root--combine :: Left (hole -> rights)-         -> hole-         -> Right rights parent-         -> parent-combine lefts hole rights =-  fromRight ((fromLeft lefts) hole) rights--data Left expects-  = LeftUnit expects-  | forall b. (Data b) => LeftCons (Left (b -> expects)) b--toLeft :: (Data a) => a -> Left a-toLeft a = gfoldl LeftCons LeftUnit a--fromLeft :: Left r -> r-fromLeft (LeftUnit a)   = a-fromLeft (LeftCons f b) = fromLeft f b--data Right provides parent where-  RightNull :: Right parent parent-  RightCons ::-    (Data b) => b -> Right a t -> Right (b -> a) t--fromRight :: r -> Right r parent -> parent-fromRight f (RightNull)     = f-fromRight f (RightCons b r) = fromRight (f b) r---- | Apply a generic monadic transformation to the hole-transM :: (Monad m) => GenericM m -> Zipper a -> m (Zipper a)-transM f (Zipper hole ctxt) = do-  hole' <- f hole-  return (Zipper hole' ctxt)---- Generic zipper traversals----- Traversal helpers--- | A movement operation such as 'left', 'right', 'up', or 'down'.-type Move a = Zipper a -> Maybe (Zipper a)---- | Apply a generic query using the specified movement operation.-moveQ :: Move a -- ^ Move operation-      -> b -- ^ Default if can't move-      -> (Zipper a -> b) -- ^ Query if can move-      -> Zipper a -- ^ Zipper-      -> b-moveQ move b f z = case move z of-                     Nothing -> b-                     Just z' -> f z'---- | Repeatedly apply a monadic 'Maybe' generic transformation at the--- top-most, left-most position that the transformation returns--- 'Just'.  Behaves like iteratively applying 'zsomewhere' but is--- more efficient because it re-evaluates the transformation--- at only the parents of the last successful application.-zreduce :: GenericM Maybe -> Zipper a -> Zipper a-zreduce f z =-  case transM f z of-    Nothing ->-      downQ (g z) (zreduce f . leftmost) z where-        g z' = rightQ (upQ z' g z') (zreduce f) z'-    Just x  -> zreduce f (reduceAncestors1 f x x)--reduceAncestors1 ::-  GenericM Maybe -> Zipper a -> Zipper a -> Zipper a-reduceAncestors1 f z def = upQ def g z where-  g z' = reduceAncestors1 f z' def' where-    def' = case transM f z' of-             Nothing -> def-             Just x  -> reduceAncestors1 f x x-------- Query--- | Apply a generic query to the left sibling if one exists.-leftQ :: b -- ^ Value to return of no left sibling exists.-      -> (Zipper a -> b) -> Zipper a -> b-leftQ b f z = moveQ left b f z---- | Apply a generic query to the right sibling if one exists.-rightQ :: b -- ^ Value to return if no right sibling exists.-       -> (Zipper a -> b) -> Zipper a -> b-rightQ b f z = moveQ right b f z---- | Apply a generic query to the parent if it exists.-downQ :: b -- ^ Value to return if no children exist.-      -> (Zipper a -> b) -> Zipper a -> b-downQ b f z = moveQ down b f z---- | Apply a generic query to the rightmost child if one exists.-upQ :: b -- ^ Value to return if parent does not exist.-    -> (Zipper a -> b) -> Zipper a -> b-upQ b f z = moveQ up b f z------ Basic movement---- | Move left.  Returns 'Nothing' iff already at leftmost sibling.-left  :: Zipper a -> Maybe (Zipper a)-left (Zipper _ CtxtNull) = Nothing-left (Zipper _ (CtxtCons (LeftUnit _) _ _)) = Nothing-left (Zipper h (CtxtCons (LeftCons l h') r c)) =-  Just (Zipper h' (CtxtCons l (RightCons h r) c))---- | Move right.  Returns 'Nothing' iff already at rightmost sibling.-right :: Zipper a -> Maybe (Zipper a)-right (Zipper _ CtxtNull) = Nothing-right (Zipper _ (CtxtCons _ RightNull _)) = Nothing-right (Zipper h (CtxtCons l (RightCons h' r) c)) =-  Just (Zipper h' (CtxtCons (LeftCons l h) r c))---- | Move down.  Moves to rightmost immediate child.  Returns 'Nothing' iff at a leaf and thus no children exist.-down  :: Zipper a -> Maybe (Zipper a)-down (Zipper hole ctxt) =-  case toLeft hole of-    LeftUnit _ -> Nothing-    LeftCons l hole' ->-      Just (Zipper hole' (CtxtCons l RightNull ctxt))---- | Move up.  Returns 'Nothing' iff already at root and thus no parent exists.-up    :: Zipper a -> Maybe (Zipper a)-up (Zipper _ CtxtNull) = Nothing-up (Zipper hole (CtxtCons l r ctxt)) =-  Just (Zipper (combine l hole r) ctxt)-------- Movement--- | Move to the leftmost sibling.-leftmost :: Zipper a -> Zipper a-leftmost z = leftQ z leftmost z-
+ tests/examples/failing/Deprecation.hs view
@@ -0,0 +1,16 @@++module Deprecation+{-# Deprecated ["This is a module \"deprecation\"",+             "multi-line",+             "with unicode: Frère" ] #-}+   ( foo )+ where++{-# DEPRECATEd   foo+         ["This is a multi-line",+          "deprecation message",+          "for foo"] #-}+foo :: Int+foo = 4++{-# DEPRECATED withBool        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
+ tests/examples/failing/Deprecation.hs.bad view
@@ -0,0 +1,16 @@++module Deprecation+{-# Deprecated ["This is a module \"deprecation\"",+             "multi-line",+             "with unicode: Fr\232re" ] #-}+   ( foo )+ where++{-# DEPRECATEd   foo+         ["This is a multi-line",+          "deprecation message",+          "for foo"] #-}+foo :: Int+foo = 4++{-# DEPRECATED withBool        "The C2HS module will soon stop providing unnecessary\nutility functions. Please use standard FFI library functions instead." #-}
+ tests/examples/failing/InfixOperator.hs view
@@ -0,0 +1,26 @@+{-# LANGUAGE BangPatterns, CPP, OverloadedStrings #-}++#define BACKSLASH 92+#define CLOSE_CURLY 125+#define CLOSE_SQUARE 93+#define COMMA 44+#define DOUBLE_QUOTE 34+#define OPEN_CURLY 123+#define OPEN_SQUARE 91+#define C_0 48+#define C_9 57+#define C_A 65+#define C_F 70+#define C_a 97+#define C_f 102+#define C_n 110+#define C_t 116++json_ :: Parser Value -> Parser Value -> Parser Value+json_ obj ary = do+  w <- skipSpace *> A.satisfy (\w -> w == OPEN_CURLY || w == OPEN_SQUARE)+  if w == OPEN_CURLY+    then obj+    else ary+{-# INLINE json_ #-}+
+ tests/examples/failing/InfixOperator.hs.bad view
@@ -0,0 +1,25 @@+{-# LANGUAGE BangPatterns, CPP, OverloadedStrings #-}++#define BACKSLASH 92+#define CLOSE_CURLY 125+#define CLOSE_SQUARE 93+#define COMMA 44+#define DOUBLE_QUOTE 34+#define OPEN_CURLY 123+#define OPEN_SQUARE 91+#define C_0 48+#define C_9 57+#define C_A 65+#define C_F 70+#define C_a 97+#define C_f 102+#define C_n 110+#define C_t 116++json_ :: Parser Value -> Parser Value -> Parser Value+json_ obj ary = do+  w <- skipSpace *> A.satisfy (\w -> w == 123OPEN_CURLY w ==||) == OPEN_SQUARE)+  if w == 123OPEN_CURLY+    then obj+    else ary+{-# INLINE json_ #-}
+ tests/examples/failing/MultiLineWarningPragma.hs view
@@ -0,0 +1,18 @@++{-# WARNING Logic+          , mkSolver+          , mkSimpleSolver+          , mkSolverForLogic+          , solverSetParams+          , solverPush+          , solverPop+          , solverReset+          , solverGetNumScopes+          , solverAssertCnstr+          , solverAssertAndTrack+          , solverCheck+          , solverCheckAndGetModel+          , solverGetReasonUnknown+          "New Z3 API support is still incomplete and fragile: \+          \you may experience segmentation faults!"+  #-}
+ tests/examples/failing/MultiLineWarningPragma.hs.bad view
@@ -0,0 +1,17 @@++{-# WARNING Logic+          , mkSolver+          , mkSimpleSolver+          , mkSolverForLogic+          , solverSetParams+          , solverPush+          , solverPop+          , solverReset+          , solverGetNumScopes+          , solverAssertCnstr+          , solverAssertAndTrack+          , solverCheck+          , solverCheckAndGetModel+          , solverGetReasonUnknown+          "New Z3 API support is still incomplete and fragile: you may experience segmentation faults!"+  #-}
+ tests/examples/failing/UnicodeRules.hs view
@@ -0,0 +1,16 @@+{-# LANGUAGE+    BangPatterns+  , FlexibleContexts+  , FlexibleInstances+  , ScopedTypeVariables+  , UnboxedTuples+  , UndecidableInstances+  , UnicodeSyntax+  #-}++strictHead ∷ G.Bitstream (Packet d) ⇒ Bitstream d → Bool+{-# RULES "head → strictHead" [1]+    ∀(v ∷ G.Bitstream (Packet d) ⇒ Bitstream d).+    head v = strictHead v #-}+{-# INLINE strictHead #-}+strictHead (Bitstream _ v) = head (SV.head v)
+ tests/examples/failing/UnicodeRules.hs.bad view
@@ -0,0 +1,16 @@+{-# LANGUAGE+    BangPatterns+  , FlexibleContexts+  , FlexibleInstances+  , ScopedTypeVariables+  , UnboxedTuples+  , UndecidableInstances+  , UnicodeSyntax+  #-}++strictHead ∷ G.Bitstream (Packet d) ⇒ Bitstream d → Bool+{-# RULES "head \8594 strictHead" [1]+    ∀(v ∷ G.Bitstream (Packet d) ⇒ Bitstream d).+    head v = strictHead v #-}+{-# INLINE strictHead #-}+strictHead (Bitstream _ v) = head (SV.head v)
+ tests/examples/failing/UnicodeSyntax.hs view
@@ -0,0 +1,236 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE UnicodeSyntax #-}+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE Arrows          #-}++module Tutorial where++-- import Abt.Class+-- import Abt.Types+-- import Abt.Concrete.LocallyNameless++import Control.Applicative+import Control.Monad.Trans.State.Strict+import Control.Monad.Trans.Maybe+import Control.Monad.Trans.Except+-- import Data.Vinyl+import Prelude hiding (pi)++-- | We'll start off with a monad in which to manipulate ABTs; we'll need some+-- state for fresh variable generation.+--+newtype M α+  = M+  { _M ∷ State Int α+  } deriving (Functor, Applicative, Monad)++-- | We'll run an ABT computation by starting the variable counter at @0@.+--+runM ∷ M α → α+runM (M m) = evalState m 0++-- | Check out the source to see fresh variable generation.+--+instance MonadVar Var M where+  fresh = M $ do+    n ← get+    let n' = n + 1+    put n'+    return $ Var Nothing n'++  named a = do+    v ← fresh+    return $ v { _varName = Just a }++-- | Next, we'll define the operators for a tiny lambda calculus as a datatype+-- indexed by arities.+--+data Lang ns where+  LAM ∷ Lang '[S Z]+  APP ∷ Lang '[Z, Z]+  PI ∷ Lang '[Z, S Z]+  UNIT ∷ Lang '[]+  AX ∷ Lang '[]++instance Show1 Lang where+  show1 = \case+    LAM → "lam"+    APP → "ap"+    PI → "pi"+    UNIT → "unit"+    AX → "<>"++instance HEq1 Lang where+  heq1 LAM LAM = Just Refl+  heq1 APP APP = Just Refl+  heq1 PI PI = Just Refl+  heq1 UNIT UNIT = Just Refl+  heq1 AX AX = Just Refl+  heq1 _ _ = Nothing++lam ∷ Tm Lang (S Z) → Tm0 Lang+lam e = LAM $$ e :& RNil++app ∷ Tm0 Lang → Tm0 Lang → Tm0 Lang+app m n = APP $$ m :& n :& RNil++ax ∷ Tm0 Lang+ax = AX $$ RNil++unit ∷ Tm0 Lang+unit = UNIT $$ RNil++pi ∷ Tm0 Lang → Tm Lang (S Z) → Tm0 Lang+pi α xβ = PI $$ α :& xβ :& RNil++-- | A monad transformer for small step operational semantics.+--+newtype StepT m α+  = StepT+  { runStepT ∷ MaybeT m α+  } deriving (Monad, Functor, Applicative, Alternative)++-- | To indicate that a term is in normal form.+--+stepsExhausted+  ∷ Applicative m+  ⇒ StepT m α+stepsExhausted = StepT . MaybeT $ pure Nothing++instance MonadVar Var m ⇒ MonadVar Var (StepT m) where+  fresh = StepT . MaybeT $ Just <$> fresh+  named str = StepT . MaybeT $ Just <$> named str++-- | A single evaluation step.+--+step+  ∷ Tm0 Lang+  → StepT M (Tm0 Lang)+step tm =+  out tm >>= \case+    APP :$ m :& n :& RNil →+      out m >>= \case+        LAM :$ xe :& RNil → xe // n+        _ → app <$> step m <*> pure n <|> app <$> pure m <*> step n+    PI :$ α :& xβ :& RNil → pi <$> step α <*> pure xβ+    _ → stepsExhausted++-- | The reflexive-transitive closure of a small-step operational semantics.+--+star+  ∷ Monad m+  ⇒ (α → StepT m α)+  → (α → m α)+star f a =+  runMaybeT (runStepT $ f a) >>=+    return a `maybe` star f++-- | Evaluate a term to normal form+--+eval ∷ Tm0 Lang → Tm0 Lang+eval = runM . star step++newtype JudgeT m α+  = JudgeT+  { runJudgeT ∷ ExceptT String m α+  } deriving (Monad, Functor, Applicative, Alternative)++instance MonadVar Var m ⇒ MonadVar Var (JudgeT m) where+  fresh = JudgeT . ExceptT $ Right <$> fresh+  named str = JudgeT . ExceptT $ Right <$> named str++type Ctx = [(Var, Tm0 Lang)]++raise ∷ Monad m ⇒ String → JudgeT m α+raise = JudgeT . ExceptT . return . Left++checkTy+  ∷ Ctx+  → Tm0 Lang+  → Tm0 Lang+  → JudgeT M ()+checkTy g tm ty = do+  let ntm = eval tm+      nty = eval ty+  (,) <$> out ntm <*> out nty >>= \case+    (LAM :$ xe :& RNil, PI :$ α :& yβ :& RNil) → do+      z ← fresh+      ez ← xe // var z+      βz ← yβ // var z+      checkTy ((z,α):g) ez βz+    (AX :$ RNil, UNIT :$ RNil) → return ()+    _ → do+      ty' ← inferTy g tm+      if ty' === nty+        then return ()+        else raise "Type error"++inferTy+  ∷ Ctx+  → Tm0 Lang+  → JudgeT M (Tm0 Lang)+inferTy g tm = do+  out (eval tm) >>= \case+    V v | Just (eval → ty) ← lookup v g → return ty+        | otherwise → raise "Ill-scoped variable"+    APP :$ m :& n :& RNil → do+      inferTy g m >>= out >>= \case+        PI :$ α :& xβ :& RNil → do+          checkTy g n α+          eval <$> xβ // n+        _ → raise "Expected pi type for lambda abstraction"+    _ → raise "Only infer neutral terms"++-- | @λx.x@+--+identityTm ∷ M (Tm0 Lang)+identityTm = do+  x ← fresh+  return $ lam (x \\ var x)++-- | @(λx.x)(λx.x)@+--+appTm ∷ M (Tm0 Lang)+appTm = do+  tm ← identityTm+  return $ app tm tm++-- | A demonstration of evaluating (and pretty-printing). Output:+--+-- @+-- ap[lam[\@2.\@2];lam[\@3.\@3]] ~>* lam[\@4.\@4]+-- @+--+main ∷ IO ()+main = do+  -- Try out the type checker+  either fail print . runM . runExceptT . runJudgeT $ do+    x ← fresh+    checkTy [] (lam (x \\ var x)) (pi unit (x \\ unit))++  print . runM $ do+    mm ← appTm+    mmStr ← toString mm+    mmStr' ← toString $ eval mm+    return $ mmStr ++ " ~>* " ++ mmStr'++doMap ∷ FilePath → IOSArrow XmlTree TiledMap+doMap mapPath = proc m → do+    mapWidth       ← getAttrR "width"      ⤙ m+    returnA -< baz++-- ^ An opaque ESD handle for recording data from the soundcard via ESD.+data Recorder fr ch (r ∷ ★ → ★)+    = Recorder {+        reRate   ∷ !Int+      , reHandle ∷ !Handle+      , reCloseH ∷ !(FinalizerHandle r)+      }+
+ tests/examples/failing/UnicodeSyntax.hs.bad view
@@ -0,0 +1,236 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE UnicodeSyntax #-}+{-# LANGUAGE ViewPatterns #-}+{-# LANGUAGE Arrows          #-}++module Tutorial where++-- import Abt.Class+-- import Abt.Types+-- import Abt.Concrete.LocallyNameless++import Control.Applicative+import Control.Monad.Trans.State.Strict+import Control.Monad.Trans.Maybe+import Control.Monad.Trans.Except+-- import Data.Vinyl+import Prelude hiding (pi)++-- | We'll start off with a monad in which to manipulate ABTs; we'll need some+-- state for fresh variable generation.+--+newtype M α+  = M+  { _M ∷ State Int α+  } deriving (Functor, Applicative, Monad)++-- | We'll run an ABT computation by starting the variable counter at @0@.+--+runM ∷ M α → α+runM (M m) = evalState m 0++-- | Check out the source to see fresh variable generation.+--+instance MonadVar Var M where+  fresh = M $ do+    n ← get+    let n' = n + 1+    put n'+    return $ Var Nothing n'++  named a = do+    v ← fresh+    return $ v { _varName = Just a }++-- | Next, we'll define the operators for a tiny lambda calculus as a datatype+-- indexed by arities.+--+data Lang ns where+  LAM ∷ Lang '[S Z]+  APP ∷ Lang '[Z, Z]+  PI ∷ Lang '[Z, S Z]+  UNIT ∷ Lang '[]+  AX ∷ Lang '[]++instance Show1 Lang where+  show1 = \case+    LAM → "lam"+    APP → "ap"+    PI → "pi"+    UNIT → "unit"+    AX → "<>"++instance HEq1 Lang where+  heq1 LAM LAM = Just Refl+  heq1 APP APP = Just Refl+  heq1 PI PI = Just Refl+  heq1 UNIT UNIT = Just Refl+  heq1 AX AX = Just Refl+  heq1 _ _ = Nothing++lam ∷ Tm Lang (S Z) → Tm0 Lang+lam e = LAM $$ e :& RNil++app ∷ Tm0 Lang → Tm0 Lang → Tm0 Lang+app m n = APP $$ m :& n :& RNil++ax ∷ Tm0 Lang+ax = AX $$ RNil++unit ∷ Tm0 Lang+unit = UNIT $$ RNil++pi ∷ Tm0 Lang → Tm Lang (S Z) → Tm0 Lang+pi α xβ = PI $$ α :& xβ :& RNil++-- | A monad transformer for small step operational semantics.+--+newtype StepT m α+  = StepT+  { runStepT ∷ MaybeT m α+  } deriving (Monad, Functor, Applicative, Alternative)++-- | To indicate that a term is in normal form.+--+stepsExhausted+  ∷ Applicative m+  ⇒ StepT m α+stepsExhausted = StepT . MaybeT $ pure Nothing++instance MonadVar Var m ⇒ MonadVar Var (StepT m) where+  fresh = StepT . MaybeT $ Just <$> fresh+  named str = StepT . MaybeT $ Just <$> named str++-- | A single evaluation step.+--+step+  ∷ Tm0 Lang+  → StepT M (Tm0 Lang)+step tm =+  out tm >>= \case+    APP :$ m :& n :& RNil →+      out m >>= \case+        LAM :$ xe :& RNil → xe // n+        _ → app <$> step m <*> pure n <|> app <$> pure m <*> step n+    PI :$ α :& xβ :& RNil → pi <$> step α <*> pure xβ+    _ → stepsExhausted++-- | The reflexive-transitive closure of a small-step operational semantics.+--+star+  ∷ Monad m+  ⇒ (α → StepT m α)+  → (α → m α)+star f a =+  runMaybeT (runStepT $ f a) >>=+    return a `maybe` star f++-- | Evaluate a term to normal form+--+eval ∷ Tm0 Lang → Tm0 Lang+eval = runM . star step++newtype JudgeT m α+  = JudgeT+  { runJudgeT ∷ ExceptT String m α+  } deriving (Monad, Functor, Applicative, Alternative)++instance MonadVar Var m ⇒ MonadVar Var (JudgeT m) where+  fresh = JudgeT . ExceptT $ Right <$> fresh+  named str = JudgeT . ExceptT $ Right <$> named str++type Ctx = [(Var, Tm0 Lang)]++raise ∷ Monad m ⇒ String → JudgeT m α+raise = JudgeT . ExceptT . return . Left++checkTy+  ∷ Ctx+  → Tm0 Lang+  → Tm0 Lang+  → JudgeT M ()+checkTy g tm ty = do+  let ntm = eval tm+      nty = eval ty+  (,) <$> out ntm <*> out nty >>= \case+    (LAM :$ xe :& RNil, PI :$ α :& yβ :& RNil) → do+      z ← fresh+      ez ← xe // var z+      βz ← yβ // var z+      checkTy ((z,α):g) ez βz+    (AX :$ RNil, UNIT :$ RNil) → return ()+    _ → do+      ty' ← inferTy g tm+      if ty' === nty+        then return ()+        else raise "Type error"++inferTy+  ∷ Ctx+  → Tm0 Lang+  → JudgeT M (Tm0 Lang)+inferTy g tm = do+  out (eval tm) >>= \case+    V v | Just (eval → ty) ← lookup v g → return ty+        | otherwise → raise "Ill-scoped variable"+    APP :$ m :& n :& RNil → do+      inferTy g m >>= out >>= \case+        PI :$ α :& xβ :& RNil → do+          checkTy g n α+          eval <$> xβ // n+        _ → raise "Expected pi type for lambda abstraction"+    _ → raise "Only infer neutral terms"++-- | @λx.x@+--+identityTm ∷ M (Tm0 Lang)+identityTm = do+  x ← fresh+  return $ lam (x \\ var x)++-- | @(λx.x)(λx.x)@+--+appTm ∷ M (Tm0 Lang)+appTm = do+  tm ← identityTm+  return $ app tm tm++-- | A demonstration of evaluating (and pretty-printing). Output:+--+-- @+-- ap[lam[\@2.\@2];lam[\@3.\@3]] ~>* lam[\@4.\@4]+-- @+--+main ∷ IO ()+main = do+  -- Try out the type checker+  either fail print . runM . runExceptT . runJudgeT $ do+    x ← fresh+    checkTy [] (lam (x \\ var x)) (pi unit (x \\ unit))++  print . runM $ do+    mm ← appTm+    mmStr ← toString mm+    mmStr' ← toString $ eval mm+    return $ mmStr ++ " ~>* " ++ mmStr'++doMap ∷ FilePath → IOSArrow XmlTree TiledMap+doMap mapPath = proc m → do+    mapWidth       ← getAttrR "width"      ⤙ m+    returnA -< baz++-- ^ An opaque ESD handle for recording data from the soundcard via ESD.+data Recorder fr ch (r ∷ * → *)+    = Recorder {+        reRate   ∷ !Int+      , reHandle ∷ !Handle+      , reCloseH ∷ !(FinalizerHandle r)+      }+
+ tests/examples/ghc710/AddAndOr3.hs view
@@ -0,0 +1,7 @@+{-# LANGUAGE PartialTypeSignatures #-}+module AddAndOr3 where++addAndOr3 :: _ -> _ -> _+addAndOr3 (a, b) (c, d) = (a `plus` d, b || c)+  where plus :: Int -> Int -> Int+        x `plus` y = x + y
+ tests/examples/ghc710/AltsSemis.hs view
@@ -0,0 +1,11 @@+++foo x =+  case x of+   { ;;; -- leading+     0 -> 'a';  -- case 0+     1 -> 'b'   -- case 1+   ; 2 -> 'c' ; -- case 2+   ; 3 -> 'd'   -- case 3+          ;;;   -- case 4+   }
+ tests/examples/ghc710/Ann01.hs view
@@ -0,0 +1,38 @@+{-# LANGUAGE TemplateHaskell #-}++module Ann01 where++{-# ANN module (1 :: Int) #-}+{-# ANN module (1 :: Integer) #-}+{-# ANN module (1 :: Double) #-}+{-# ANN module $([| 1 :: Int |]) #-}+{-# ANN module "Hello" #-}+{-# ANN module (Just (1 :: Int)) #-}+{-# ANN module [1 :: Int, 2, 3] #-}+{-# ANN module ([1..10] :: [Integer]) #-}+{-# ANN module ''Foo #-}+{-# ANN module (-1 :: Int) #-}++{-# ANN type Foo (1 :: Int) #-}+{-# ANN type Foo (1 :: Integer) #-}+{-# ANN type Foo (1 :: Double) #-}+{-# ANN type Foo $([| 1 :: Int |]) #-}+{-# ANN type Foo "Hello" #-}+{-# ANN type Foo (Just (1 :: Int)) #-}+{-# ANN type Foo [1 :: Int, 2, 3] #-}+{-# ANN type Foo ([1..10] :: [Integer]) #-}+{-# ANN type Foo ''Foo #-}+{-# ANN type Foo (-1 :: Int) #-}+data Foo = Bar Int++{-# ANN f (1 :: Int) #-}+{-# ANN f (1 :: Integer) #-}+{-# ANN f (1 :: Double) #-}+{-# ANN f $([| 1 :: Int |]) #-}+{-# ANN f "Hello" #-}+{-# ANN f (Just (1 :: Int)) #-}+{-# ANN f [1 :: Int, 2, 3] #-}+{-# ANN f ([1..10] :: [Integer]) #-}+{-# ANN f 'f #-}+{-# ANN f (-1 :: Int) #-}+f x = x
+ tests/examples/ghc710/AnnPackageName.hs view
@@ -0,0 +1,4 @@+++import "base" Prelude+import "base" Data.Data
+ tests/examples/ghc710/Annotations.hs view
@@ -0,0 +1,40 @@+{-# LANGUAGE TemplateHaskell #-}++module Annotations where++{-# ANN module (1 :: Int) #-}+{-# ANN module (1 :: Integer) #-}+{-# ANN module (1 :: Double) #-}+{-# ANN module $([| 1 :: Int |]) #-}+{-# ANN module "Hello" #-}+{-# ANN module (Just (1 :: Int)) #-}+{-# ANN module [1 :: Int, 2, 3] #-}+{-# ANN module ([1..10] :: [Integer]) #-}+{-# ANN module ''Foo #-}+{-# ANN module (-1 :: Int) #-}++{-# ANN type Foo (1 :: Int) #-}+{-# ANN type Foo (1 :: Integer) #-}+{-# ANN type Foo (1 :: Double) #-}+{-# ANN type Foo $([| 1 :: Int |]) #-}+{-# ANN type Foo "Hello" #-}+{-# ANN type Foo (Just (1 :: Int)) #-}+{-# ANN type Foo [1 :: Int, 2, 3] #-}+{-# ANN type Foo ([1..10] :: [Integer]) #-}+{-# ANN type Foo ''Foo #-}+{-# ANN type Foo (-1 :: Int) #-}+data Foo = Bar Int++{-# ANN f (1 :: Int) #-}+{-# ANN f (1 :: Integer) #-}+{-# ANN f (1 :: Double) #-}+{-# ANN f $([| 1 :: Int |]) #-}+{-# ANN f "Hello" #-}+{-# ANN f (Just (1 :: Int)) #-}+{-# ANN f [1 :: Int, 2, 3] #-}+{-# ANN f ([1..10] :: [Integer]) #-}+{-# ANN f 'f #-}+{-# ANN f (-1 :: Int) #-}+f x = x++{-# ANN foo "HLint: ignore" #-};foo = map f (map g x)
+ tests/examples/ghc710/Arrow.hs view
@@ -0,0 +1,46 @@+{-# LANGUAGE Arrows #-}+module Arrow where++import Control.Arrow+import qualified Control.Category as Cat++addA :: Arrow a => a b Int -> a b Int -> a b Int+addA f g = proc x -> do+                y <- f -< x+                z <- g -< x+                returnA -< y + z++newtype Circuit a b = Circuit { unCircuit :: a -> (Circuit a b, b) }++instance Cat.Category Circuit where+    id = Circuit $ \a -> (Cat.id, a)+    (.) = dot+      where+        (Circuit cir2) `dot` (Circuit cir1) = Circuit $ \a ->+            let (cir1', b) = cir1 a+                (cir2', c) = cir2 b+            in  (cir2' `dot` cir1', c)++instance Arrow Circuit where+    arr f = Circuit $ \a -> (arr f, f a)+    first (Circuit cir) = Circuit $ \(b, d) ->+        let (cir', c) = cir b+        in  (first cir', (c, d))++-- | Accumulator that outputs a value determined by the supplied function.+accum :: acc -> (a -> acc -> (b, acc)) -> Circuit a b+accum acc f = Circuit $ \input ->+    let (output, acc') = input `f` acc+    in  (accum acc' f, output)++-- | Accumulator that outputs the accumulator value.+accum' :: b -> (a -> b -> b) -> Circuit a b+accum' acc f = accum acc (\a b -> let b' = a `f` b in (b', b'))++total :: Num a => Circuit a a+total = accum' 0 (+)++mean3 :: Fractional a => Circuit a a+mean3 = proc value -> do+    (t, n) <- (| (&&&) (total -< value) (total -< 1) |)+    returnA -< t / n
+ tests/examples/ghc710/Arrows.hs view
@@ -0,0 +1,87 @@+{-# LANGUAGE Arrows #-}+-- from https://ocharles.org.uk/blog/guest-posts/2014-12-21-arrows.html++import Control.Monad (guard)+import Control.Monad.Identity (Identity, runIdentity)+import Control.Arrow (returnA, Kleisli(Kleisli), runKleisli)++f :: Int -> (Int, Int)+f = \x ->+  let y  = 2 * x+      z1 = y + 3+      z2 = y - 5+  in (z1, z2)++-- ghci> f 10+-- (23, 15)++fM :: Int -> Identity (Int, Int)+fM = \x -> do+  y  <- return (2 * x)+  z1 <- return (y + 3)+  z2 <- return (y - 5)+  return (z1, z2)++-- ghci> runIdentity (fM 10)+-- (23,15)+++fA :: Int -> (Int, Int)+fA = proc x -> do+  y  <- (2 *) -< x+  z1 <- (+ 3) -< y+  z2 <- (subtract 5) -< y+  returnA -< (z1, z2)++-- ghci> fA 10+-- (23,15)++range :: Int -> [Int]+range r = [-r..r]++cM :: Int -> [(Int, Int)]+cM = \r -> do+  x <- range 5+  y <- range 5+  guard (x*x + y*y <= r*r)+  return (x, y)++-- ghci> take 10 (cM 5)+-- [(-5,0),(-4,-3),(-4,-2),(-4,-1),(-4,0),(-4,1),(-4,2),(-4,3),(-3,-4),(-3,-3)]+++type K = Kleisli++k :: (a -> m b) -> Kleisli m a b+k = Kleisli++runK :: Kleisli m a b -> (a -> m b)+runK = runKleisli++cA :: Kleisli [] Int (Int, Int)+cA = proc r -> do+  x <- k range -< 5+  y <- k range -< 5+  k guard -< (x*x + y*y <= r*r)+  returnA -< (x, y)++-- ghci> take 10 (runK cA 5)+-- [(-5,0),(-4,-3),(-4,-2),(-4,-1),(-4,0),(-4,1),(-4,2),(-4,3),(-3,-4),(-3,-3)]++getLineM :: String -> IO String+getLineM prompt = do+  print prompt+  getLine++printM :: String -> IO ()+printM = print++writeFileM :: (FilePath, String) -> IO ()+writeFileM  (filePath, string) = writeFile filePath string++procedureM :: String -> IO ()+procedureM = \prompt -> do+  input <- getLineM prompt+  if input == "Hello"+    then printM "You said 'Hello'"+    else writeFileM ("/tmp/output", "The user said '" ++ input ++ "'")
+ tests/examples/ghc710/Associated.hs view
@@ -0,0 +1,81 @@+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE GADTs #-}++-- From https://www.haskell.org/haskellwiki/GHC/Type_families#An_associated_data_type_example++import qualified Data.IntMap+import Prelude hiding (lookup)+import Data.Char (ord)++class GMapKey k where+  data GMap k :: * -> *+  empty       :: GMap k v+  lookup      :: k -> GMap k v -> Maybe v+  insert      :: k -> v -> GMap k v -> GMap k v++-- An Int instance+instance GMapKey Int where+  data GMap Int v        = GMapInt (Data.IntMap.IntMap v)+  empty                  = GMapInt Data.IntMap.empty+  lookup k   (GMapInt m) = Data.IntMap.lookup k m+  insert k v (GMapInt m) = GMapInt (Data.IntMap.insert k v m)++-- A Char instance+instance GMapKey Char where+  data GMap Char v        = GMapChar (GMap Int v)+  empty                   = GMapChar empty+  lookup k (GMapChar m)   = lookup (ord k) m+  insert k v (GMapChar m) = GMapChar (insert (ord k) v m)++-- A Unit instance+instance GMapKey () where+  data GMap () v           = GMapUnit (Maybe v)+  empty                    = GMapUnit Nothing+  lookup () (GMapUnit v)   = v+  insert () v (GMapUnit _) = GMapUnit $ Just v++-- Product and sum instances+instance (GMapKey a, GMapKey b) => GMapKey (a, b) where+  data GMap (a, b) v            = GMapPair (GMap a (GMap b v))+  empty                         = GMapPair empty+  lookup (a, b) (GMapPair gm)   = lookup a gm >>= lookup b+  insert (a, b) v (GMapPair gm) = GMapPair $ case lookup a gm of+                                    Nothing  -> insert a (insert b v empty) gm+                                    Just gm2 -> insert a (insert b v gm2  ) gm++instance (GMapKey a, GMapKey b) => GMapKey (Either a b) where+  data GMap (Either a b) v                = GMapEither (GMap a v) (GMap b v)+  empty                                   = GMapEither empty empty+  lookup (Left  a) (GMapEither gm1  _gm2) = lookup a gm1+  lookup (Right b) (GMapEither _gm1 gm2 ) = lookup b gm2+  insert (Left  a) v (GMapEither gm1 gm2) = GMapEither (insert a v gm1) gm2+  insert (Right b) v (GMapEither gm1 gm2) = GMapEither gm1 (insert b v gm2)++myGMap :: GMap (Int, Either Char ()) String+myGMap = insert (5, Left 'c') "(5, Left 'c')"    $+         insert (4, Right ()) "(4, Right ())"    $+         insert (5, Right ()) "This is the one!" $+         insert (5, Right ()) "This is the two!" $+         insert (6, Right ()) "(6, Right ())"    $+         insert (5, Left 'a') "(5, Left 'a')"    $+         empty++main = putStrLn $ maybe "Couldn't find key!" id $ lookup (5, Right ()) myGMap++-- (Type) Synonym Family++type family Elem c++type instance Elem [e] = e++-- type instance Elem BitSet = Char+++data family T a+data    instance T Int  = T1 Int | T2 Bool+newtype instance T Char = TC Bool++data family G a b+data instance G [a] b where+   G1 :: c -> G [Int] b+   G2 :: G [a] Bool
+ tests/examples/ghc710/AssociatedType.hs view
@@ -0,0 +1,5 @@+{-# LANGUAGE TypeFamilies #-}+class Foldable t where+  type FoldableConstraint t x :: *+  type FoldableConstraint t x = ()+
+ tests/examples/ghc710/B.hs view
@@ -0,0 +1,4 @@++foo x = case (odd x) of+            True  -> "Odd"+            False -> "Even"
+ tests/examples/ghc710/BCase.hs view
@@ -0,0 +1,8 @@+++main =+ case 1 > 10 of+   True  -> do putStrLn "hello"+               putStrLn "there"+   False -> do putStrLn "blah"+               putStrLn "blah"
+ tests/examples/ghc710/BIf.hs view
@@ -0,0 +1,8 @@+++main =+ if 1 > 10+   then do putStrLn "hello"+           putStrLn "there"+   else do putStrLn "blah"+           putStrLn "blah"
+ tests/examples/ghc710/Backquote.hs view
@@ -0,0 +1,11 @@+import Data.List++foo = do+  let genOut (f,st) = putStrLn (f ++ "\t"++go [e`div`4,e`div`2,3*e`div`4] (scanl1 (+) $ sort st))+  Just 5++f = undefined+go = undefined+e = undefined++
+ tests/examples/ghc710/BangPatterns.hs view
@@ -0,0 +1,16 @@+{-# LANGUAGE BangPatterns #-}++-- From https://ocharles.org.uk/blog/posts/2014-12-05-bang-patterns.html++import Data.Function (fix)+import Data.List (foldl')++hello3 :: Bool -> String+hello3 !loud = "Hello."++mean :: [Double] -> Double+mean xs = s / fromIntegral l+  where+    (s, l) = foldl' step (0, 0) xs+    step (!s, !l) a = (s + a, l + 1)+
+ tests/examples/ghc710/BootImport.hs view
@@ -0,0 +1,3 @@+module BootImport where++data Foo = Foo Int
+ tests/examples/ghc710/BootImport.hs-boot view
@@ -0,0 +1,3 @@+module BootImport where++data Foo
+ tests/examples/ghc710/BracesSemiDataDecl.hs view
@@ -0,0 +1,7 @@+++data Nat (t :: NatKind) where+{+    ZeroNat :: Nat Zero;+    SuccNat :: Nat t -> Nat (Succ t);+};
+ tests/examples/ghc710/CExpected.hs view
@@ -0,0 +1,12 @@+module CExpected where+-- Test for refactor of if to case+-- The comments on the then and else legs should be preserved++foo x = case (odd x) of+          True  -> -- This is an odd result+            bob x 1+          False -> -- This is an even result+            bob x 2++bob x y = x + y+
+ tests/examples/ghc710/Cg008.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE MagicHash, BangPatterns #-}+{-# OPTIONS_GHC -O0 #-}++-- Variant of cgrun066; compilation as a module is different.++module Cg008 (hashStr) where++import Foreign.C+import Data.Word+import Foreign.Ptr+import GHC.Exts++import Control.Exception++hashStr  :: Ptr Word8 -> Int -> Int+hashStr (Ptr a#) (I# len#) = loop 0# 0#+   where+    loop h n | isTrue# (n GHC.Exts.==# len#) = I# h+             | otherwise  = loop h2 (n GHC.Exts.+# 1#)+          where !c = ord# (indexCharOffAddr# a# n)+                !h2 = (c GHC.Exts.+# (h GHC.Exts.*# 128#)) `remInt#` 4091#
+ tests/examples/ghc710/Commands.hs view
@@ -0,0 +1,257 @@+{-# LANGUAGE QuasiQuotes #-}++commands :: [Command]+commands = [+    command "help" "display a list of all commands, and their current keybindings" $ do+      macroGuesses <- Macro.guessCommands commandNames <$> getMacros+      addTab (Other "Help") (makeHelpWidget commands macroGuesses) AutoClose++  , command "log" "show the error log" $ do+      messages <- gets logMessages+      let widget = ListWidget.moveLast (ListWidget.new $ reverse messages)+      addTab (Other "Log") (AnyWidget . LogWidget $ widget) AutoClose++  , command "map" "display a list of all commands that are currently bound to keys" $ do+      showMappings++  , command "map" "display the command that is currently bound to the key {name}" $ do+      showMapping++  , command "map" [help|+        Bind the command {expansion} to the key {name}.  The same command may+        be bound to different keys.+        |] $ do+      addMapping++  , command "unmap" "remove the binding currently bound to the key {name}" $ do+      \(MacroName m) -> removeMacro m++  , command "mapclear" "" $ do+      clearMacros++  , command "exit" "exit vimus" $ do+      eval "quit"++  , command "quit" "exit vimus" $ do+      liftIO exitSuccess :: Vimus ()++  , command "close" "close the current window (not all windows can be closed)" $ do+      void closeTab++  , command "source" "read the file {path} and interprets all lines found there as if they were entered as commands." $ do+      \(Path p) -> liftIO (expandHome p) >>= either printError source_++  , command "runtime" "" $+      \(Path p) -> liftIO (getDataFileName p) >>= source_++  , command "color" "define the fore- and background color for a thing on the screen." $ do+      \color fg bg -> liftIO (defineColor color fg bg) :: Vimus ()++  , command "repeat" "set the playlist option *repeat*. When *repeat* is set, the playlist will start over when the last song has finished playing." $ do+      MPD.repeat  True :: Vimus ()++  , command "norepeat" "Unset the playlist option *repeat*." $ do+      MPD.repeat  False :: Vimus ()++  , command "consume" "set the playlist option *consume*. When *consume* is set, songs that have finished playing are automatically removed from the playlist." $ do+      MPD.consume True :: Vimus ()++  , command "noconsume" "Unset the playlist option *consume*." $ do+      MPD.consume False :: Vimus ()++  , command "random" "set the playlist option *random*. When *random* is set, songs in the playlist are played in random order." $ do+      MPD.random  True :: Vimus ()++  , command "norandom" "Unset the playlist option *random*." $ do+      MPD.random  False :: Vimus ()++  , command "single" "Set the playlist option *single*. When *single* is set, playback does not advance automatically to the next item in the playlist. Combine with *repeat* to repeatedly play the same song." $ do+      MPD.single  True :: Vimus ()++  , command "nosingle" "Unset the playlist option *single*." $ do+      MPD.single  False :: Vimus ()++  , command "autotitle" "Set the *autotitle* option.  When *autotitle* is set, the console window title is automatically set to the currently playing song." $ do+      setAutoTitle True++  , command "noautotitle" "Unset the *autotitle* option." $ do+      setAutoTitle False++  , command "volume" "[+-] set volume to  or adjust by [+-] num" $ do+      volume :: Volume -> Vimus ()++ , command "toggle-repeat" "Toggle the *repeat* option." $ do+      MPD.status >>= MPD.repeat  . not . MPD.stRepeat :: Vimus ()++  , command "toggle-consume" "Toggle the *consume* option." $ do+      MPD.status >>= MPD.consume . not . MPD.stConsume :: Vimus ()++  , command "toggle-random" "Toggle the *random* option." $ do+      MPD.status >>= MPD.random  . not . MPD.stRandom :: Vimus ()++  , command "toggle-single" "Toggle the *single* option." $ do+      MPD.status >>= MPD.single  . not . MPD.stSingle :: Vimus ()++  , command "set-library-path" "While MPD knows where your songs are stored, vimus doesn't. If you want to use the *%* feature of the command :! you need to tell vimus where your songs are stored." $ do+      \(Path p) -> setLibraryPath p++  , command "next" "stop playing the current song, and starts the next one" $ do+      MPD.next :: Vimus ()++  , command "previous" "stop playing the current song, and starts the previous one" $ do+      MPD.previous :: Vimus ()++  , command "toggle" "toggle between play and pause" $ do+      MPDE.toggle :: Vimus ()++  , command "stop" "stop playback" $ do+      MPD.stop :: Vimus ()++  , command "update" "tell MPD to update the music database. You must update your database when you add or delete files in your music directory, or when you edit the metadata of a song.  MPD will only rescan a file already in the database if its modification time has changed." $ do+      void (MPD.update Nothing) :: Vimus ()++  , command "rescan" "" $ do+      void (MPD.rescan Nothing) :: Vimus ()++  , command "clear" "delete all songs from the playlist" $ do+      MPD.clear :: Vimus ()++  , command "search-next" "jump to the next occurrence of the search string in the current window"+      searchNext++  , command "search-prev" "jump to the previous occurrence of the search string in the current window"+      searchPrev+++  , command "window-library" "open the *Library* window" $+      selectTab Library++  , command "window-playlist" "open the *Playlist* window" $+      selectTab Playlist++  , command "window-search" "open the *SearchResult* window" $+      selectTab SearchResult++  , command "window-browser" "open the *Browser* window" $+      selectTab Browser++  , command "window-next" "open the window to the right of the current one"+      nextTab++  , command "window-prev" "open the window to the left of the current one"+      previousTab++  , command "!" "execute {cmd} on the system shell. See chapter \"Using an external tag editor\" for an example."+      runShellCommand++  , command "seek" "jump to the given position in the current song"+      seek++  , command "visual" "start visual selection" $+      sendEventCurrent EvVisual++  , command "novisual" "cancel visual selection" $+      sendEventCurrent EvNoVisual++  -- Remove current song from playlist+  , command "remove" "remove the song under the cursor from the playlist" $+      sendEventCurrent EvRemove++  , command "paste" "add the last deleted song after the selected song in the playlist" $+      sendEventCurrent EvPaste++  , command "paste-prev" "" $+      sendEventCurrent EvPastePrevious++  , command "copy" "" $+      sendEventCurrent EvCopy++  , command "shuffle" "shuffle the current playlist" $ do+      MPD.shuffle Nothing :: Vimus ()++  , command "add" "append selected songs to the end of the playlist" $ do+      sendEventCurrent EvAdd++  -- insert a song right after the current song+  , command "insert" [help|+      inserts a song to the playlist. The song is inserted after the currently+      playing song.+      |] $ do+      st <- MPD.status+      case MPD.stSongPos st of+        Just n -> do+          -- there is a current song, insert after+          sendEventCurrent (EvInsert (n + 1))+        _ -> do+          -- there is no current song, just add+          sendEventCurrent EvAdd++  -- Playlist: play selected song+  -- Library:  add song to playlist and play it+  -- Browse:   either add song to playlist and play it, or :move-in+  , command "default-action" [help|+      depending on the item under the cursor, somthing different happens:++      - *Playlist* start playing the song under the cursor++      - *Library* append the song under the cursor to the playlist and start playing it++      - *Browser* on a song: append the song to the playlist and play it. On a directory: go down to that directory.+      |] $ do+      sendEventCurrent EvDefaultAction++  , command "add-album" "add all songs of the album of the selected song to the playlist" $ do+      songs <- fromCurrent MPD.Album [MPD.Disc, MPD.Track]+      maybe (printError "Song has no album metadata!") (MPDE.addMany "" . map MPD.sgFilePath) songs++  , command "add-artist" "add all songs of the artist of the selected song to the playlist" $ do+      songs <- fromCurrent MPD.Artist [MPD.Date, MPD.Album, MPD.Disc, MPD.Track]+      maybe (printError "Song has no artist metadata!") (MPDE.addMany "" . map MPD.sgFilePath) songs++  -- movement+  , command "move-up" "move the cursor one line up" $+      sendEventCurrent EvMoveUp++  , command "move-down" "move the cursor one line down" $+      sendEventCurrent EvMoveDown++  , command "move-album-prev" "move the cursor up to the first song of an album" $+      sendEventCurrent EvMoveAlbumPrev++  , command "move-album-next" "move the cursor down to the first song of an album" $+      sendEventCurrent EvMoveAlbumNext++  , command "move-in" "go down one level the directory hierarchy in the *Browser* window" $+      sendEventCurrent EvMoveIn++  , command "move-out" "go up one level in the directory hierarchy in the *Browser* window" $+      sendEventCurrent EvMoveOut++  , command "move-first" "go to the first line in the current window" $+      sendEventCurrent EvMoveFirst++  , command "move-last" "go to the last line in the current window" $+      sendEventCurrent EvMoveLast++  , command "scroll-up" "scroll the contents of the current window up one line" $+      sendEventCurrent (EvScroll (-1))++  , command "scroll-down" "scroll the contents of the current window down one line" $+      sendEventCurrent (EvScroll 1)++  , command "scroll-page-up" "scroll the contents of the current window up one page" $+      pageScroll >>= sendEventCurrent . EvScroll . negate++  , command "scroll-half-page-up" "scroll the contents of the current window up one half page" $+      pageScroll >>= sendEventCurrent . EvScroll . negate . (`div` 2)++  , command "scroll-page-down" "scroll the contents of the current window down one page" $+      pageScroll >>= sendEventCurrent . EvScroll++  , command "scroll-half-page-down" "scroll the contents of the current window down one half page" $+      pageScroll >>= sendEventCurrent . EvScroll . (`div` 2)++  , command "song-format" "set song rendering format" $+      sendEvent . EvChangeSongFormat+  ]+
+ tests/examples/ghc710/Control.hs view
@@ -0,0 +1,210 @@+{-# LANGUAGE Unsafe #-}+{-# LANGUAGE CPP+           , NoImplicitPrelude+           , ScopedTypeVariables+           , BangPatterns+  #-}++module GHC.Event.Control+    (+    -- * Managing the IO manager+      Signal+    , ControlMessage(..)+    , Control+    , newControl+    , closeControl+    -- ** Control message reception+    , readControlMessage+    -- *** File descriptors+    , controlReadFd+    , controlWriteFd+    , wakeupReadFd+    -- ** Control message sending+    , sendWakeup+    , sendDie+    -- * Utilities+    , setNonBlockingFD+    ) where++#include "EventConfig.h"++import Foreign.ForeignPtr (ForeignPtr)+import GHC.Base+import GHC.Conc.Signal (Signal)+import GHC.Real (fromIntegral)+import GHC.Show (Show)+import GHC.Word (Word8)+import Foreign.C.Error (throwErrnoIfMinus1_)+import Foreign.C.Types (CInt(..), CSize(..))+import Foreign.ForeignPtr (mallocForeignPtrBytes, withForeignPtr)+import Foreign.Marshal (alloca, allocaBytes)+import Foreign.Marshal.Array (allocaArray)+import Foreign.Ptr (castPtr)+import Foreign.Storable (peek, peekElemOff, poke)+import System.Posix.Internals (c_close, c_pipe, c_read, c_write,+                               setCloseOnExec, setNonBlockingFD)+import System.Posix.Types (Fd)++#if defined(HAVE_EVENTFD)+import Foreign.C.Error (throwErrnoIfMinus1)+import Foreign.C.Types (CULLong(..))+#else+import Foreign.C.Error (eAGAIN, eWOULDBLOCK, getErrno, throwErrno)+#endif++data ControlMessage = CMsgWakeup+                    | CMsgDie+                    | CMsgSignal {-# UNPACK #-} !(ForeignPtr Word8)+                                 {-# UNPACK #-} !Signal+    deriving (Eq, Show)++-- | The structure used to tell the IO manager thread what to do.+data Control = W {+      controlReadFd  :: {-# UNPACK #-} !Fd+    , controlWriteFd :: {-# UNPACK #-} !Fd+#if defined(HAVE_EVENTFD)+    , controlEventFd :: {-# UNPACK #-} !Fd+#else+    , wakeupReadFd   :: {-# UNPACK #-} !Fd+    , wakeupWriteFd  :: {-# UNPACK #-} !Fd+#endif+    , didRegisterWakeupFd :: !Bool+    } deriving (Show)++#if defined(HAVE_EVENTFD)+wakeupReadFd :: Control -> Fd+wakeupReadFd = controlEventFd+{-# INLINE wakeupReadFd #-}+#endif++-- | Create the structure (usually a pipe) used for waking up the IO+-- manager thread from another thread.+newControl :: Bool -> IO Control+newControl shouldRegister = allocaArray 2 $ \fds -> do+  let createPipe = do+        throwErrnoIfMinus1_ "pipe" $ c_pipe fds+        rd <- peekElemOff fds 0+        wr <- peekElemOff fds 1+        -- The write end must be non-blocking, since we may need to+        -- poke the event manager from a signal handler.+        setNonBlockingFD wr True+        setCloseOnExec rd+        setCloseOnExec wr+        return (rd, wr)+  (ctrl_rd, ctrl_wr) <- createPipe+#if defined(HAVE_EVENTFD)+  ev <- throwErrnoIfMinus1 "eventfd" $ c_eventfd 0 0+  setNonBlockingFD ev True+  setCloseOnExec ev+  when shouldRegister $ c_setIOManagerWakeupFd ev+#else+  (wake_rd, wake_wr) <- createPipe+  when shouldRegister $ c_setIOManagerWakeupFd wake_wr+#endif+  return W { controlReadFd  = fromIntegral ctrl_rd+           , controlWriteFd = fromIntegral ctrl_wr+#if defined(HAVE_EVENTFD)+           , controlEventFd = fromIntegral ev+#else+           , wakeupReadFd   = fromIntegral wake_rd+           , wakeupWriteFd  = fromIntegral wake_wr+#endif+           , didRegisterWakeupFd = shouldRegister+           }++-- | Close the control structure used by the IO manager thread.+-- N.B. If this Control is the Control whose wakeup file was registered with+-- the RTS, then *BEFORE* the wakeup file is closed, we must call+-- c_setIOManagerWakeupFd (-1), so that the RTS does not try to use the wakeup+-- file after it has been closed.+closeControl :: Control -> IO ()+closeControl w = do+  _ <- c_close . fromIntegral . controlReadFd $ w+  _ <- c_close . fromIntegral . controlWriteFd $ w+  when (didRegisterWakeupFd w) $ c_setIOManagerWakeupFd (-1)+#if defined(HAVE_EVENTFD)+  _ <- c_close . fromIntegral . controlEventFd $ w+#else+  _ <- c_close . fromIntegral . wakeupReadFd $ w+  _ <- c_close . fromIntegral . wakeupWriteFd $ w+#endif+  return ()++io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word8+io_MANAGER_WAKEUP = 0xff+io_MANAGER_DIE    = 0xfe++foreign import ccall "__hscore_sizeof_siginfo_t"+    sizeof_siginfo_t :: CSize++readControlMessage :: Control -> Fd -> IO ControlMessage+readControlMessage ctrl fd+    | fd == wakeupReadFd ctrl = allocaBytes wakeupBufferSize $ \p -> do+                    throwErrnoIfMinus1_ "readWakeupMessage" $+                      c_read (fromIntegral fd) p (fromIntegral wakeupBufferSize)+                    return CMsgWakeup+    | otherwise =+        alloca $ \p -> do+            throwErrnoIfMinus1_ "readControlMessage" $+                c_read (fromIntegral fd) p 1+            s <- peek p+            case s of+                -- Wakeup messages shouldn't be sent on the control+                -- file descriptor but we handle them anyway.+                _ | s == io_MANAGER_WAKEUP -> return CMsgWakeup+                _ | s == io_MANAGER_DIE    -> return CMsgDie+                _ -> do  -- Signal+                    fp <- mallocForeignPtrBytes (fromIntegral sizeof_siginfo_t)+                    withForeignPtr fp $ \p_siginfo -> do+                        r <- c_read (fromIntegral fd) (castPtr p_siginfo)+                             sizeof_siginfo_t+                        when (r /= fromIntegral sizeof_siginfo_t) $+                            error "failed to read siginfo_t"+                        let !s' = fromIntegral s+                        return $ CMsgSignal fp s'++  where wakeupBufferSize =+#if defined(HAVE_EVENTFD)+            8+#else+            4096+#endif++sendWakeup :: Control -> IO ()+#if defined(HAVE_EVENTFD)+sendWakeup c =+  throwErrnoIfMinus1_ "sendWakeup" $+  c_eventfd_write (fromIntegral (controlEventFd c)) 1+#else+sendWakeup c = do+  n <- sendMessage (wakeupWriteFd c) CMsgWakeup+  case n of+    _ | n /= -1   -> return ()+      | otherwise -> do+                   errno <- getErrno+                   when (errno /= eAGAIN && errno /= eWOULDBLOCK) $+                     throwErrno "sendWakeup"+#endif++sendDie :: Control -> IO ()+sendDie c = throwErrnoIfMinus1_ "sendDie" $+            sendMessage (controlWriteFd c) CMsgDie++sendMessage :: Fd -> ControlMessage -> IO Int+sendMessage fd msg = alloca $ \p -> do+  case msg of+    CMsgWakeup        -> poke p io_MANAGER_WAKEUP+    CMsgDie           -> poke p io_MANAGER_DIE+    CMsgSignal _fp _s -> error "Signals can only be sent from within the RTS"+  fromIntegral `fmap` c_write (fromIntegral fd) p 1++#if defined(HAVE_EVENTFD)+foreign import ccall unsafe "sys/eventfd.h eventfd"+   c_eventfd :: CInt -> CInt -> IO CInt++foreign import ccall unsafe "sys/eventfd.h eventfd_write"+   c_eventfd_write :: CInt -> CULLong -> IO CInt+#endif++foreign import ccall unsafe "setIOManagerWakeupFd"+   c_setIOManagerWakeupFd :: CInt -> IO ()
+ tests/examples/ghc710/CorePragma.hs view
@@ -0,0 +1,6 @@+{-# INLINE strictStream #-}+strictStream (Bitstream l v)+    = {-# CORE "Strict Bitstream stream" #-}+      S.concatMap stream (GV.stream v)+      `S.sized`+      Exact l
+ tests/examples/ghc710/Cpp.hs view
@@ -0,0 +1,17 @@+{-# Language CPP #-}++#if __GLASGOW_HASKELL__ > 704+foo :: Int+#else+foo :: Integer+#endif+foo = 3++bar :: (+#if __GLASGOW_HASKELL__ > 704+    Int)+#else+    Integer)+#endif+bar = 4+
+ tests/examples/ghc710/DataDecl.hs view
@@ -0,0 +1,34 @@+{-# Language DatatypeContexts #-}+{-# Language ExistentialQuantification #-}+{-# LAnguage GADTs #-}+{-# LAnguage KindSignatures #-}++data Foo = A+         | B+         | C++--         | data_or_newtype capi_ctype tycl_hdr constrs deriving+data {-# Ctype "Foo" "bar" #-} F1 = F1+data {-# Ctype       "baz" #-} Eq a =>  F2 a = F2 a++data (Eq a,Ord a) => F3 a = F3 Int a++data F4 a = forall x y. (Eq x,Eq y) => F4 a x y+          | forall x y. (Eq x,Eq y) => F4b a x y+++data G1 a :: * where+  G1A,  G1B :: Int -> G1 a+  G1C :: Double -> G1 a++data G2 a :: * where+  G2A { g2a :: a, g2b :: Int } :: G2 a+  G2C :: Double -> G2 a++++data (Eq a,Ord a) => G3 a = G3+  { g3A :: Int+  , g3B :: Bool+  , g3a :: a+  } deriving (Eq,Ord)
+ tests/examples/ghc710/DataFamilies.hs view
@@ -0,0 +1,50 @@+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE MultiParamTypeClasses #-}++-- Based on https://www.haskell.org/haskellwiki/GHC/Type_families#Detailed_definition_of_data_families++module DataFamilies+  (+    GMap+  , GMapKey(type GMapK)+  ) where++-- Type 1, Top level++data family GMap k :: * -> *++data family Array e++data family ArrayK :: * -> *+++-- Type 2, associated types++class GMapKey k where+  data GMapK k :: * -> *++class C a b c where { data T1 c a :: * }  -- OK+-- class C a b c where { data T a a :: * }  -- Bad: repeated variable+-- class D a where { data T a x :: * }      -- Bad: x is not a class variable+class D a where { data T2 a :: * -> * }   -- OK++-- Instances++data instance GMap (Either a b) v = GMapEither (GMap a v) (GMap b v)++data family T3 a+data instance T3 Int  = A+data instance T3 Char = B+nonsense :: T3 a -> Int+-- nonsense A = 1             -- WRONG: These two equations together...+-- nonsense B = 2             -- ...will produce a type error.+nonsense = undefined+++instance (GMapKey a, GMapKey b) => GMapKey (Either a b) where+  data GMapK (Either a b) v = GMapEitherK (GMap a v) (GMap b v)++-- data GMap () v = GMapUnit (Maybe v)+--               deriving Show++
+ tests/examples/ghc710/Dead1.hs view
@@ -0,0 +1,42 @@+{-# OPTIONS  -O -ddump-stranal #-}++module Dead1(foo) where++foo :: Int -> Int+foo n = baz (n+1) (bar1 n)++{-# NOINLINE bar1 #-}+bar1 n = 1 + bar n++bar :: Int -> Int+{-# NOINLINE bar #-}+{-# RULES+"bar/foo" forall n. bar (foo n) = n+   #-}+bar n = n-1++baz :: Int -> Int -> Int+{-# INLINE [0] baz #-}+baz m n = m+++{- Ronam writes (Feb08)++    Note that bar becomes dead as soon as baz gets inlined. But strangely,+    the simplifier only deletes it after full laziness and CSE. That is, it+    is not deleted in the phase in which baz gets inlined. In fact, it is+    still there after w/w and the subsequent simplifier run. It gets deleted+    immediately if I comment out the rule.++    I stumbled over this when I removed one simplifier run after SpecConstr+    (at the moment, it runs twice at the end but I don't think that should+    be necessary). With this change, the original version of a specialised+    loop (the one with the rules) is not longer deleted even if it isn't+    used any more. I'll reenable the second simplifier run for now but+    should this really be necessary?++No, it should not be necessary.  A refactoring in OccurAnal makes+this work right. Look at the simplifier output just before strictness+analysis; there should be a binding for 'foo', but for nothing else.++-}
+ tests/examples/ghc710/Default.hs view
@@ -0,0 +1,8 @@+default (Integer, Double) -- "default default"++mag :: Float -> Float -> Float+mag x y = sqrt( x^2 + y^2 )++main = do++print $ mag 1 1
+ tests/examples/ghc710/DefaultTypeInstance.hs view
@@ -0,0 +1,6 @@+{-# LANGUAGE TypeFamilies #-}+++class Foldable t where+  type FoldableConstraint t x :: Constraint+  type FoldableConstraint t x = ()
+ tests/examples/ghc710/Deriving.hs view
@@ -0,0 +1,14 @@+{-# LANGUAGE StandaloneDeriving #-}+{-# LANGUAGE DeriveDataTypeable #-}++import Data.Data++data Foo = FooA | FooB++deriving instance Show Foo++deriving instance {-# Overlappable #-} Eq Foo+deriving instance {-# Overlapping  #-} Ord Foo+deriving instance {-# Overlaps     #-} Typeable Foo+deriving instance {-# Incoherent   #-} Data Foo+
+ tests/examples/ghc710/DerivingOC.hs view
@@ -0,0 +1,36 @@+{-# LANGUAGE DeriveDataTypeable #-}+{-# LANGUAGE DeriveFoldable #-}+{-# LANGUAGE DeriveFunctor #-}+{-# LANGUAGE DeriveTraversable #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}++-- from https://ocharles.org.uk/blog/guest-posts/2014-12-15-deriving.html++import Data.Data+import Control.Monad.IO.Class+import Control.Monad.Reader+import Control.Monad.State++data MiniIoF a = Terminate+               | PrintLine String a+               | ReadLine (String -> a)+               deriving (Functor)+++-- data List a = Nil | Cons a (List a)+--               deriving (Eq, Show, Functor, Foldable, Traversable)++++data List a = Nil | Cons a (List a)+              deriving ( Eq, Show+                       , Functor, Foldable, Traversable+                       , Typeable, Data)++data Config = C String String+data AppState = S Int Bool++newtype App a = App { unApp :: ReaderT Config (StateT AppState IO) a }+                deriving (Monad, MonadReader Config,+                          MonadState AppState, MonadIO,+                          Applicative,Functor)
+ tests/examples/ghc710/DoParens.hs view
@@ -0,0 +1,4 @@++foo = do+  (-) <- Just 5+  return ()
+ tests/examples/ghc710/DoPatBind.hs view
@@ -0,0 +1,4 @@+module Main where++bar = do+  foo :: String <- baz
+ tests/examples/ghc710/DocDecls.hs view
@@ -0,0 +1,7 @@+module DocDecls where++-- | A document before+data Foo = A Int | B Char+         deriving (Show)++
+ tests/examples/ghc710/DoubleForall.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE ScopedTypeVariables #-}+++extremumNewton :: (Eq a, Fractional a) =>+                  (forall tag. forall tag1.+                          Tower tag1 (Tower tag a)+                              -> Tower tag1 (Tower tag a))+                      -> a -> [a]+extremumNewton f x0 = zeroNewton (diffUU f) x0
+ tests/examples/ghc710/DroppedComma.hs view
@@ -0,0 +1,5 @@+++foo =+  let (xs, ys) = ([1,2..3], [4,5..6]) in+  bar
+ tests/examples/ghc710/DroppedDoSpace.hs view
@@ -0,0 +1,26 @@+import FooBarBaz -- non-existent import, check that we can still parse++save :: C -> IO ()+save state = saveFileDialog "Save file " (maybe Nothing (Just . (++) "*.") (filesuffix state)) $+             do \fileName ->+                    case onSaveCB state of+                      Nothing ->+                          return ()+                      Just callback ->+                          do+                            c <- callback+                            case c of+                              Nothing ->+                                   return ()+                              Just c' ->+                                  let realfn = maybe+                                                fileName+                                                (extendFileName fileName)+                                                (filesuffix state)+                                  in do+                                    L.writeFile realfn c'+                                    postGUIAsync $ labelSetText (View.statusL $ gui state) $ realfn ++ " Saved."+    where+      extendFileName fileName suffix = if isSuffixOf suffix fileName+                                         then fileName+                                         else fileName ++ "." ++ suffix
+ tests/examples/ghc710/DroppedDoSpace2.hs view
@@ -0,0 +1,6 @@+++save state = do \fileName ->+                  4++
+ tests/examples/ghc710/EmptyMostly.hs view
@@ -0,0 +1,13 @@+module EmptyMostly where+   { ;;;+     ;;x=let{;;;;;y=2;;z=3;;;;}in y;+   -- ;;;;+    class Foo a where {;;;;;;+  (--<>--) :: a -> a -> Int  ;+  infixl 5 --<>-- ;+  (--<>--) _ _ = 2 ; -- empty decl at the end.+};+-- ;;;;;;;;;;;;+-- foo = a where {;;;;;;;;;;;;;;;;;;;;;;;a=1;;;;;;;;}+-- ;;+   }
+ tests/examples/ghc710/EmptyMostly2.hs view
@@ -0,0 +1,8 @@+module EmptyMostly2 where+   {+;;;;;;;;;;;;+;+class Baz a where {;;;;;;;;;+ ; baz :: a -> Int;;;+}+   }
+ tests/examples/ghc710/EmptyMostlyInst.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE FlexibleInstances #-}+module EmptyMostlyInst where+   {+;;;;;;;;;;;;+;+instance Eq (Int,Integer) where {;;;;;;;;;+;;;;;;; a == b = False;;;;;;;;;;;+}+   }
+ tests/examples/ghc710/EmptyMostlyNoSemis.hs view
@@ -0,0 +1,8 @@+module EmptyMostlyNoSemis where++x=let{y=2}in y+class Foo a where {+  (--<>--) :: a -> a -> Int;+  infixl 5 --<>--;+  (--<>--) _ _ = 2 ; -- empty decl at the end.+ }
+ tests/examples/ghc710/Existential.hs view
@@ -0,0 +1,59 @@+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE TypeSynonymInstances #-}+{-# LANGUAGE FlexibleInstances #-}++-- from https://ocharles.org.uk/blog/guest-posts/2014-12-19-existential-quantification.html++data HashMap k v = HM  -- ... -- actual implementation++class Hashable v where+  h :: v -> Int++data HashMapM hm = HashMapM+  { empty  :: forall k v . hm k v+  , lookup :: Hashable k => k -> hm k v -> Maybe v+  , insert :: Hashable k => k -> v -> hm k v -> hm k v+  , union  :: Hashable k => hm k v -> hm k v -> hm k v+  }+++data HashMapE = forall hm . HashMapE (HashMapM hm)++-- public+mkHashMapE :: Int -> HashMapE+mkHashMapE = HashMapE . mkHashMapM++-- private+mkHashMapM :: Int -> HashMapM HashMap+mkHashMapM salt = HashMapM { {- implementation -} }++instance Hashable String where++type Name = String+data Gift = G String++giraffe :: Gift+giraffe = G "giraffe"++addGift :: HashMapM hm -> hm Name Gift -> hm Name Gift+addGift mod gifts =+  let+    HashMapM{..} = mod+  in+    insert "Ollie" giraffe gifts++-- -------------------------------++santa'sSecretSalt = undefined+sendGiftToOllie = undefined+traverse_ = undefined++sendGifts =+  case mkHashMapE santa'sSecretSalt of+    HashMapE (mod@HashMapM{..}) ->+      let+        gifts = addGift mod empty+      in+        traverse_ sendGiftToOllie $ lookup "Ollie" gifts
+ tests/examples/ghc710/ExplicitNamespaces.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE MagicHash #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE TypeFamilies #-}++module CLaSH.Prelude.BitIndex where++import GHC.TypeLits                   (KnownNat, type (+), type (-))
+ tests/examples/ghc710/Expr.hs view
@@ -0,0 +1,132 @@+{-# LANGUAGE DeriveDataTypeable #-}+module Expr where++import Data.Generics+import Language.Haskell.TH as TH+import Language.Haskell.TH.Quote++-- import Text.ParserCombinators.Parsec+-- import Text.ParserCombinators.Parsec.Char++data Expr  =  IntExpr Integer+           |  AntiIntExpr String+           |  BinopExpr BinOp Expr Expr+           |  AntiExpr String+    deriving(Typeable, Data,Show)++data BinOp  =  AddOp+            |  SubOp+            |  MulOp+            |  DivOp+    deriving(Typeable, Data,Show)++eval :: Expr -> Integer+eval (IntExpr n)        = n+eval (BinopExpr op x y) = (opToFun op) (eval x) (eval y)+  where+    opToFun AddOp = (+)+    opToFun SubOp = (-)+    opToFun MulOp = (*)+    opToFun DivOp = (div)++small   = lower <|> char '_'+large   = upper+idchar  = small <|> large <|> digit <|> char '\''++lexeme p    = do{ x <- p; spaces; return x  }+symbol name = lexeme (string name)+parens p    = undefined -- between (symbol "(") (symbol ")") p++_expr :: CharParser st Expr+_expr   = term   `chainl1` mulop++term :: CharParser st Expr+term    = factor `chainl1` addop++factor :: CharParser st Expr+factor  = parens _expr <|> integer <|> anti++mulop   =  undefined+{-+           do{ symbol "*"; return $ BinopExpr MulOp }+        <|> do{ symbol "/"; return $ BinopExpr DivOp }+-}+addop   = undefined+{-+  do{ symbol "+"; return $ BinopExpr AddOp }+        <|> do{ symbol "-"; return $ BinopExpr SubOp }+-}++integer :: CharParser st Expr+integer  = lexeme $ do{ ds <- many1 digit ; return $ IntExpr (read ds) }++anti   = undefined+{-+  lexeme $+         do  symbol "$"+             c <- small+             cs <- many idchar+             return $ AntiIntExpr (c : cs)+-}++parseExpr :: Monad m => TH.Loc -> String -> m Expr+parseExpr (Loc {loc_filename = file, loc_start = (line,col)}) s =+    case runParser p () "" s of+      Left err  -> fail $ "baz"+      Right e   -> return e+  where+    p = do  pos <- getPosition+            setPosition $ setSourceName (setSourceLine (setSourceColumn pos col) line) file+            spaces+            e <- _expr+            eof+            return e++expr = QuasiQuoter { quoteExp = parseExprExp, quotePat = parseExprPat }++parseExprExp :: String -> Q Exp+parseExprExp s =  do  loc <- location+                      expr <- parseExpr loc s+                      dataToExpQ (const Nothing `extQ` antiExprExp) expr++antiExprExp :: Expr -> Maybe (Q Exp)+antiExprExp  (AntiIntExpr v)  = Just $ appE  (conE (mkName "IntExpr"))+                                                (varE (mkName v))+antiExprExp  (AntiExpr v)     = Just $ varE  (mkName v)+antiExprExp  _                = Nothing++parseExprPat :: String -> Q Pat+parseExprPat s =  do  loc <- location+                      expr <- parseExpr loc s+                      dataToPatQ (const Nothing `extQ` antiExprPat) expr++antiExprPat :: Expr -> Maybe (Q Pat)+antiExprPat  (AntiIntExpr v)  = Just $ conP  (mkName "IntExpr")+                                                [varP (mkName v)]+antiExprPat  (AntiExpr v)     = Just $ varP  (mkName v)+antiExprPat  _                = Nothing++-- keep parser happy+runParser = undefined+getPosition = undefined+setPosition = undefined+setSourceName = undefined+setSourceLine = undefined+setSourceColumn = undefined+spaces = undefined+eof = undefined+many = undefined+digit = undefined+many1 = undefined+data CharParser a b = F a b+(<|>) = undefined+chainl1 = undefined+string = undefined+char = undefined+lower = undefined+upper = undefined+between = undefined+instance Monad (CharParser a) where+instance Applicative (CharParser a) where+instance Functor (CharParser a) where+
+ tests/examples/ghc710/ExprPragmas.hs view
@@ -0,0 +1,7 @@+module ExprPragmas where++a = {-# SCC "name"   #-}  0x5++b = {-# SCC foo   #-} 006++c = {-# GENERATED "foobar" 1 : 2  -  3 :   4 #-} 0.00
+ tests/examples/ghc710/ExtraConstraints1.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE PartialTypeSignatures #-}+module ExtraConstraints1 where++arbitCs1 :: _ => a -> String+arbitCs1 x = show (succ x) ++ show (x == x)++arbitCs2 :: (Show a, _) => a -> String+arbitCs2 x = arbitCs1 x++arbitCs3 :: (Show a, Enum a, _) => a -> String+arbitCs3 x = arbitCs1 x++arbitCs4 :: (Eq a, _) => a -> String+arbitCs4 x = arbitCs1 x++arbitCs5 :: (Eq a, Enum a, Show a, _) => a -> String+arbitCs5 x = arbitCs1 x
+ tests/examples/ghc710/FooExpected.hs view
@@ -0,0 +1,8 @@+++main =+ case 1 > 10 of+   True  -> do putStrLn "hello"+               putStrLn "there"+   False -> do putStrLn "blah"+               putStrLn "blah"
+ tests/examples/ghc710/ForAll.hs view
@@ -0,0 +1,7 @@+{-# LANGUAGE RankNTypes #-}+module ForAll where++import Data.Data++foo ::  (forall a. Data a => a -> a) -> forall a. Data a => a -> a+foo a = a
+ tests/examples/ghc710/ForeignDecl.hs view
@@ -0,0 +1,107 @@+{-# LANGUAGE MagicHash, UnliftedFFITypes #-}+{-# LANGUAGE ForeignFunctionInterface #-}++-- Based on ghc/testsuite/tests/ffi/should_compile contents+module ForeignDecl where++import Foreign+import GHC.Exts+import Data.Int+import Data.Word++-- simple functions++foreign import ccall unsafe "a" a :: IO Int++foreign import ccall unsafe "b" b :: Int -> IO Int++foreign import ccall unsafe "c"+  c :: Int -> Char -> Float -> Double -> IO Float++-- simple monadic code++d =     a               >>= \ x ->+        b x             >>= \ y ->+        c y 'f' 1.0 2.0++-- We can't import the same function using both stdcall and ccall+-- calling conventions in the same file when compiling via C (this is a+-- restriction in the C backend caused by the need to emit a prototype+-- for stdcall functions).+foreign import stdcall        "p" m_stdcall :: StablePtr a -> IO (StablePtr b)+foreign import ccall   unsafe "q" m_ccall   :: ByteArray# -> IO Int++-- We can't redefine the calling conventions of certain functions (those from+-- math.h).+foreign import stdcall "my_sin" my_sin :: Double -> IO Double+foreign import stdcall "my_cos" my_cos :: Double -> IO Double++foreign import stdcall "m1" m8  :: IO Int8+foreign import stdcall "m2" m16 :: IO Int16+foreign import stdcall "m3" m32 :: IO Int32+foreign import stdcall "m4" m64 :: IO Int64++foreign import stdcall "dynamic" d8  :: FunPtr (IO Int8) -> IO Int8+foreign import stdcall "dynamic" d16 :: FunPtr (IO Int16) -> IO Int16+foreign import stdcall "dynamic" d32 :: FunPtr (IO Int32) -> IO Int32+foreign import stdcall "dynamic" d64 :: FunPtr (IO Int64) -> IO Int64++foreign import ccall unsafe "safe_qd.h safe_qd_add" c_qd_add :: Ptr CDouble -> Ptr CDouble -> Ptr CDouble -> IO ();++foreign import ccall unsafe "kitchen"+   sink :: Ptr a+        -> ByteArray#+        -> MutableByteArray# RealWorld+        -> Int+        -> Int8+        -> Int16+        -> Int32+        -> Int64+        -> Word8+        -> Word16+        -> Word32+        -> Word64+        -> Float+        -> Double+        -> IO ()+++type Sink2 b = Ptr b+            -> ByteArray#+            -> MutableByteArray# RealWorld+            -> Int+            -> Int8+            -> Int16+            -> Int32+            -> Word8+            -> Word16+            -> Word32+            -> Float+            -> Double+            -> IO ()++foreign import ccall unsafe "dynamic"+  sink2 :: Ptr (Sink2 b) -> Sink2 b++-- exports+foreign export ccall "plusInt" (+) :: Int -> Int -> Int++listToJSArray :: ToJSRef a => [a] -> IO (JSArray a)+listToJSArray = toJSArray deconstr+        where deconstr (x : xs) = Just (x, xs)+              deconstr [] = Nothing++foreign import javascript unsafe "$r = new Float32Array($1);"+        float32Array :: JSArray Float -> IO Float32Array++foreign import javascript unsafe "$r = new Int32Array($1);"+        int32Array :: JSArray Int32 -> IO Int32Array++foreign import javascript unsafe "$r = new Uint16Array($1);"+        uint16Array :: JSArray Word16 -> IO Uint16Array++foreign import javascript unsafe "$r = new Uint8Array($1);"+        uint8Array :: JSArray Word8 -> IO Uint8Array++foreign import javascript unsafe "$r = $1.getContext(\"webgl\");"+        getCtx :: JSRef a -> IO Ctx
+ tests/examples/ghc710/FromUtils.hs view
@@ -0,0 +1,28 @@+{-# LANGUAGE TypeSynonymInstances #-}+{-# LANGUAGE FlexibleInstances #-}++import Data.Data+++-- ---------------------------------------------------------------------++instance AnnotateP RdrName where+  annotateP l n = do+    case rdrName2String n of+      "[]" -> do+        addDeltaAnnotation AnnOpenS -- '['+        addDeltaAnnotation AnnCloseS -- ']'++-- ---------------------------------------------------------------------++class (Typeable ast) => AnnotateP ast where+  annotateP :: SrcSpan -> ast -> IO ()+++type SrcSpan = Int+rdrName2String = undefined+type RdrName = String++data A = AnnOpenS | AnnCloseS++addDeltaAnnotation = undefined
+ tests/examples/ghc710/FunDeps.hs view
@@ -0,0 +1,7 @@+{-# LANGUAGE MultiParamTypeClasses  #-}+{-# LANGUAGE FunctionalDependencies #-}++-- FunDeps example+class Foo a b c | a b -> c where+  bar :: a -> b -> c+
+ tests/examples/ghc710/FunctionalDeps.hs view
@@ -0,0 +1,19 @@+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FunctionalDependencies #-}++-- from https://ocharles.org.uk/blog/posts/2014-12-14-functional-dependencies.html++import Data.Foldable (forM_)+import Data.IORef++class Store store m | store -> m where+ new :: a -> m (store a)+ get :: store a -> m a+ put :: store a -> a -> m ()++instance Store IORef IO where+  new = newIORef+  get = readIORef+  put ioref a = modifyIORef ioref (const a)+
+ tests/examples/ghc710/GADTContext.hs view
@@ -0,0 +1,13 @@+{-# LANGUAGE GADTs              #-}+{-# LANGUAGE RankNTypes         #-}+{-# LANGUAGE StandaloneDeriving #-}++data StackItem a where+  Snum :: forall a. Fractional a => a -> StackItem a+  Sop  :: OpDesc -> StackItem a+deriving instance Show a => Show (StackItem a)++-- AZ added to test Trac #10399+data MaybeDefault v where+    SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v+    SetTo4 :: forall v a. (( Eq v, Show v ) => v -> MaybeDefault v -> a -> MaybeDefault [a])
+ tests/examples/ghc710/GADTRecords.hs view
@@ -0,0 +1,20 @@+{-# LANGUAGE GADTs #-}+module GADTRecords (H1(..)) where++-- | h1+data H1 a b where+  C1 :: H1 a b+  C2 :: Ord a => [a] -> H1 a a+  C3 :: { field :: Int -- ^ hello docs+        } -> H1 Int Int+  C4 :: { field2 :: a -- ^ hello2 docs+        } -> H1 Int a++  FwdDataflowAnalysis :: (Eq f, Monad m) => { analysisTop :: f+                                            , analysisMeet :: f -> f -> f+                                            , analysisTransfer :: f -> Instruction -> m f+                                            , analysisFwdEdgeTransfer :: Maybe (f -> Instruction -> m [(BasicBlock, f)])+                                            } -> DataflowAnalysis m f++data GADT :: * -> * where+      Ctor :: { gadtField :: A } -> GADT A
+ tests/examples/ghc710/GADTRecords2.hs view
@@ -0,0 +1,7 @@+{-# LANGUAGE GADTs #-}+module GADTRecords2 (H1(..)) where++-- | h1+data H1 a b where+  C3 :: (Num a) => { field :: a -- ^ hello docs+                   } -> H1 Int Int
+ tests/examples/ghc710/GHCOrig.hs view
@@ -0,0 +1,211 @@+{-# LANGUAGE Trustworthy #-}+{-# LANGUAGE NoImplicitPrelude, DeriveGeneric #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  GHC.Tuple+-- Copyright   :  (c) The University of Glasgow 2001+-- License     :  BSD-style (see the file libraries/ghc-prim/LICENSE)+--+-- Maintainer  :  libraries@haskell.org+-- Stability   :  experimental+-- Portability :  non-portable (GHC extensions)+--+-- The tuple data types+--+-----------------------------------------------------------------------------++module GHC.Tuple where+++default () -- Double and Integer aren't available yet++-- | The unit datatype @()@ has one non-undefined member, the nullary+-- constructor @()@.+data () = ()++data (,) a b = (,) a b+data (,,) a b c = (,,) a b c+data (,,,) a b c d = (,,,) a b c d+data (,,,,) a b c d e = (,,,,) a b c d e+data (,,,,,) a b c d e f = (,,,,,) a b c d e f+data (,,,,,,) a b c d e f g = (,,,,,,) a b c d e f g+data (,,,,,,,) a b c d e f g h = (,,,,,,,) a b c d e f g h+data (,,,,,,,,) a b c d e f g h i = (,,,,,,,,) a b c d e f g h i+data (,,,,,,,,,) a b c d e f g h i j = (,,,,,,,,,) a b c d e f g h i j+data (,,,,,,,,,,) a b c d e f g h i j k = (,,,,,,,,,,) a b c d e f g h i j k+data (,,,,,,,,,,,) a b c d e f g h i j k l = (,,,,,,,,,,,) a b c d e f g h i j k l+data (,,,,,,,,,,,,) a b c d e f g h i j k l m = (,,,,,,,,,,,,) a b c d e f g h i j k l m+data (,,,,,,,,,,,,,) a b c d e f g h i j k l m n = (,,,,,,,,,,,,,) a b c d e f g h i j k l m n+data (,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o = (,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o+data (,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p = (,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p+data (,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q+ = (,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q+data (,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r+ = (,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r+data (,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s+ = (,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s+data (,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t+ = (,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t+data (,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u+ = (,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u+data (,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v+ = (,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v+data (,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w+ = (,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w+data (,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x+ = (,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x+data (,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y+ = (,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y+data (,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z+ = (,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z+data (,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__++{- Manuel says: Including one more declaration gives a segmentation fault.+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___  u___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___ u___+data (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___  u___ v___+ = (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,) a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_ g_ h_ i_ j_ k_ l_ m_ n_ o_ p_ q_ r_ s_ t_ u_ v_ w_ x_ y_ z_ a__ b__ c__ d__ e__ f__ g__ h__ i__ j__ k__ l__ m__ n__ o__ p__ q__ r__ s__ t__ u__ v__ w__ x__ y__ z__ a___ b___ c___ d___ e___ f___ g___ h___ i___ j___ k___ l___ m___ n___ o___ p___ q___ r___ s___ t___ u___ v___+-}
+ tests/examples/ghc710/GenericDeriving.hs view
@@ -0,0 +1,41 @@+{-# LANGUAGE DeriveGeneric #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE FunctionalDependencies #-}+{-# LANGUAGE TypeOperators #-}+{-# LANGUAGE ViewPatterns #-}+import GHC.Generics++-- from https://ocharles.org.uk/blog/posts/2014-12-16-derive-generic.html++data Valid e a = Error e | OK a+  deriving (Generic)++toEither :: Valid e a -> Either e a+toEither (Error e) = Left e+toEither (OK a) = Right a++fromEither :: Either e a -> Valid e a+fromEither (Left e) = Error e+fromEither (Right a) = OK a++-- ---------------------------------------------------------------------++class GetError rep e | rep -> e where+  getError' :: rep a -> Maybe e++instance GetError f e => GetError (M1 i c f) e where+  getError' (M1 m1) = getError' m1++instance GetError l e => GetError (l :+: r) e where+  getError' (L1 l) = getError' l+  getError' (R1 _) = Nothing++instance GetError (K1 i e) e where+  getError' (K1 e) = Just e++getError :: (Generic (errorLike e a), GetError (Rep (errorLike e a)) e) => errorLike e a -> Maybe e+getError = getError' . from+
+ tests/examples/ghc710/Guards.hs view
@@ -0,0 +1,6 @@+++f x | x > 0, x /= 10 = 1 / x+    | x == 0 = undefined+  where+    y = 4
+ tests/examples/ghc710/Hang.hs view
@@ -0,0 +1,1 @@+(~>) = forall
+ tests/examples/ghc710/HangingRecord.hs view
@@ -0,0 +1,5 @@++data Foo = Foo+  { r1 :: Int+  , r2 :: Int+  }
+ tests/examples/ghc710/HashQQ.hs view
@@ -0,0 +1,44 @@+{-# LANGUAGE QuasiQuotes #-}+{-# LANGUAGE OverloadedStrings #-}++module Web.Maid.ApacheMimeTypes where+++import qualified Data.Text as T+import Air.TH++++apache_mime_types :: T.Text+apache_mime_types = [here|++# This file maps Internet media types to unique file extension(s).+# Although created for httpd, this file is used by many software systems+# and has been placed in the public domain for unlimited redisribution.+#+# The table below contains both registered and (common) unregistered types.+# A type that has no unique extension can be ignored -- they are listed+# here to guide configurations toward known types and to make it easier to+# identify "new" types.  File extensions are also commonly used to indicate+# content languages and encodings, so choose them carefully.+#+# Internet media types should be registered as described in RFC 4288.+# The registry is at .+#+# MIME type (lowercased)      Extensions+# ============================================  ==========+# application/1d-interleaved-parityfec+# application/3gpp-ims+xml+# application/activemessage+application/andrew-inset      ez |]+++testComplex    = assertBool "" ([$istr|+        ok+#{Foo 4 "Great!" : [Foo 3 "Scott!"]}+        then+|] == ("\n" +++    "        ok\n" +++    "[Foo 4 \"Great!\",Foo 3 \"Scott!\"]\n" +++    "        then\n"))+
+ tests/examples/ghc710/HsDo.hs view
@@ -0,0 +1,22 @@+module HsDo where++import qualified Data.Map as Map++moduleGraphNodes drop_hs_boot_nodes summaries = (graphFromEdgedVertices nodes, lookup_node)+  where+    numbered_summaries = zip summaries [1..]++    node_map :: NodeMap SummaryNode+    node_map = Map.fromList [ ((moduleName (ms_mod s), ms_hsc_src s), node)+                            | node@(s, _, _) <- nodes ]+++graphFromEdgedVertices = undefined+nodes = undefined+lookup_node = undefined+type NodeMap a = Map.Map (Int,Int) (Int,Int,Int)+data SummaryNode = SummaryNode+moduleName = undefined+ms_mod = undefined+ms_hsc_src = undefined+
+ tests/examples/ghc710/IfThenElse1.hs view
@@ -0,0 +1,7 @@+-- From http://lpaste.net/81623, courtesy of Albert Y. C. Lai+main = do+  cs <- if True+  then getLine+  else return "computer input"+  putStrLn cs+
+ tests/examples/ghc710/IfThenElse2.hs view
@@ -0,0 +1,5 @@+-- From http://lpaste.net/81623, courtesy of Albert Y. C. Lai+main = if True+then print 12+else print 42+
+ tests/examples/ghc710/IfThenElse3.hs view
@@ -0,0 +1,6 @@+-- From http://lpaste.net/81623, courtesy of Albert Y. C. Lai+main = do+  print 3+  if True then do+    print 5+    else print 7
+ tests/examples/ghc710/ImplicitParams.hs view
@@ -0,0 +1,41 @@+{-# LANGUAGE ImplicitParams #-}++-- From https://ocharles.org.uk/blog/posts/2014-12-11-implicit-params.html++import Data.Char+++type LogFunction = String -> IO ()++type Present = String++queueNewChristmasPresents :: LogFunction -> [Present] -> IO ()+queueNewChristmasPresents logMessage presents = do+  mapM (logMessage . ("Queueing present for delivery: " ++)) presents+  return ()++queueNewChristmasPresents2 :: (?logMessage :: LogFunction) => [Present] -> IO ()+queueNewChristmasPresents2 presents = do+  mapM (?logMessage . ("Queueing present for delivery: " ++)) presents+  return ()+++ex1 :: IO ()+ex1 =+  let ?logMessage = \t -> putStrLn ("[XMAS LOG]: " ++ t)+  in queueNewChristmasPresents2 ["Cuddly Lambda", "Gamma Christmas Pudding"]+++ex2 :: IO ()+ex2 = do+  -- Specifies its own logger+  ex1++  -- We can locally define a new logging function+  let ?logMessage = \t -> putStrLn (zipWith (\i c -> if even i+                                                     then c+                                                     else toUpper c)+                                           [0..]+                                           t)+  queueNewChristmasPresents2 ["Category Theory Books"]+
+ tests/examples/ghc710/ImplicitSemi.hs view
@@ -0,0 +1,4 @@+{-# LANGUAGE ImplicitParams #-}++explicit :: ((?above :: q, ?below :: a -> q) => b) -> q -> (a -> q) -> b+explicit x ab be = x where ?above = ab; ?below = be
+ tests/examples/ghc710/ImplicitTypeSyn.hs view
@@ -0,0 +1,17 @@+{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE EmptyDataDecls #-}+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE ForeignFunctionInterface #-}+{-# LANGUAGE GADTs #-}+{-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE ImplicitParams #-}+{-# LANGUAGE NamedFieldPuns #-}+{-# LANGUAGE RankNTypes #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TemplateHaskell #-}+{-# LANGUAGE TupleSections #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE UnicodeSyntax #-}++type MPI = ?mpi_secret :: MPISecret
+ tests/examples/ghc710/Imports.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE ExplicitNamespaces #-}+module Imports( f, type (+), pattern Single ) where++import GHC.TypeLits++pattern Single x = [x]++f = undefined
+ tests/examples/ghc710/ImportsSemi.hs view
@@ -0,0 +1,6 @@+module ImportsSemi where+{+; ; ; ; ; ;+import Data.List+;;;+}
+ tests/examples/ghc710/IndentedDo.hs view
@@ -0,0 +1,12 @@++++foo =+  parseTestFile "gitlogo-double.ppm" "a multi-image file" $ do+      \res -> case res of+        Right ([ PPM { ppmHeader = h1 }+               , PPM { ppmHeader = h2 }], rest) -> do h1 `shouldBe` PPMHeader P6 220 92+                                                      h2 `shouldBe` PPMHeader P6 220 92+                                                      rest `shouldBe` Nothing+        Right r                                    -> assertFailure $ "parsed unexpected: " ++ show r+        Left e                                     -> assertFailure $ "did not parse: " ++ e
+ tests/examples/ghc710/Infix.hs view
@@ -0,0 +1,8 @@++infix  3 &&&++(&&&) :: (Eq a) => [a] -> [a] -> [a]+(&&& ) [] [] =  []+xs  &&&   [] =  xs+(  &&&) [] ys =  ys+
+ tests/examples/ghc710/InfixPatternSynonyms.hs view
@@ -0,0 +1,18 @@+{-# LANGUAGE PatternSynonyms #-}++-- | The pattern synonym equivalent of 'destIff'.+pattern l :<=> r <- Comb (Comb (Const "=" (TyBool :-> TyBool :-> TyBool)) l) r++-- | Destructor for boolean conjunctions.+destConj :: HOLTerm -> Maybe (HOLTerm, HOLTerm)+destConj = destBinary "/\\"++-- | The pattern synonym equivalent of 'destConj'.+pattern l :/\ r <- Binary "/\\" l r++-- | Destructor for boolean implications.+destImp :: HOLTerm -> Maybe (HOLTerm, HOLTerm)+destImp = destBinary "==>"++-- | The pattern synonym equivalent of 'destImp'.+pattern l :==> r <- Binary "==>" l r
+ tests/examples/ghc710/InlineSemi.hs view
@@ -0,0 +1,1 @@+{-# INLINE (|.) #-}; (|.)::Storable a=>Ptr a -> Int -> IO a         ; (|.) a i   = peekElemOff a i
+ tests/examples/ghc710/Internals.hs view
@@ -0,0 +1,427 @@+{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses,+             CPP #-}+#if __GLASGOW_HASKELL__ >= 708+{-# LANGUAGE RoleAnnotations #-}+#endif++{-# OPTIONS_HADDOCK hide #-}+-----------------------------------------------------------------------------+-- |+-- Module      :  Data.Array.IO.Internal+-- Copyright   :  (c) The University of Glasgow 2001-2012+-- License     :  BSD-style (see the file libraries/base/LICENSE)+--+-- Maintainer  :  libraries@haskell.org+-- Stability   :  experimental+-- Portability :  non-portable (uses Data.Array.Base)+--+-- Mutable boxed and unboxed arrays in the IO monad.+--+-----------------------------------------------------------------------------++module Data.Array.IO.Internals (+    IOArray(..),         -- instance of: Eq, Typeable+    IOUArray(..),        -- instance of: Eq, Typeable+    castIOUArray,        -- :: IOUArray ix a -> IO (IOUArray ix b)+    unsafeThawIOUArray,+  ) where++import Data.Int+import Data.Word+import Data.Typeable++import Control.Monad.ST         ( RealWorld, stToIO )+import Foreign.Ptr              ( Ptr, FunPtr )+import Foreign.StablePtr        ( StablePtr )++#if __GLASGOW_HASKELL__ < 711+import Data.Ix+#endif+import Data.Array.Base++import GHC.IOArray (IOArray(..))++-----------------------------------------------------------------------------+-- Flat unboxed mutable arrays (IO monad)++-- | Mutable, unboxed, strict arrays in the 'IO' monad.  The type+-- arguments are as follows:+--+--  * @i@: the index type of the array (should be an instance of 'Ix')+--+--  * @e@: the element type of the array.  Only certain element types+--    are supported: see "Data.Array.MArray" for a list of instances.+--+newtype IOUArray i e = IOUArray (STUArray RealWorld i e)+                       deriving Typeable+#if __GLASGOW_HASKELL__ >= 708+-- Both parameters have class-based invariants. See also #9220.+type role IOUArray nominal nominal+#endif++instance Eq (IOUArray i e) where+    IOUArray s1 == IOUArray s2  =  s1 == s2++instance MArray IOUArray Bool IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Char IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Int IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Word IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray (Ptr a) IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray (FunPtr a) IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Float IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Double IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray (StablePtr a) IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Int8 IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Int16 IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Int32 IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Int64 IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Word8 IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Word16 IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Word32 IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++instance MArray IOUArray Word64 IO where+    {-# INLINE getBounds #-}+    getBounds (IOUArray arr) = stToIO $ getBounds arr+    {-# INLINE getNumElements #-}+    getNumElements (IOUArray arr) = stToIO $ getNumElements arr+    {-# INLINE newArray #-}+    newArray lu initialValue = stToIO $ do+        marr <- newArray lu initialValue; return (IOUArray marr)+    {-# INLINE unsafeNewArray_ #-}+    unsafeNewArray_ lu = stToIO $ do+        marr <- unsafeNewArray_ lu; return (IOUArray marr)+    {-# INLINE newArray_ #-}+    newArray_ = unsafeNewArray_+    {-# INLINE unsafeRead #-}+    unsafeRead (IOUArray marr) i = stToIO (unsafeRead marr i)+    {-# INLINE unsafeWrite #-}+    unsafeWrite (IOUArray marr) i e = stToIO (unsafeWrite marr i e)++-- | Casts an 'IOUArray' with one element type into one with a+-- different element type.  All the elements of the resulting array+-- are undefined (unless you know what you\'re doing...).+castIOUArray :: IOUArray ix a -> IO (IOUArray ix b)+castIOUArray (IOUArray marr) = stToIO $ do+    marr' <- castSTUArray marr+    return (IOUArray marr')++{-# INLINE unsafeThawIOUArray #-}+#if __GLASGOW_HASKELL__ >= 711+unsafeThawIOUArray :: UArray ix e -> IO (IOUArray ix e)+#else+unsafeThawIOUArray :: Ix ix => UArray ix e -> IO (IOUArray ix e)+#endif+unsafeThawIOUArray arr = stToIO $ do+    marr <- unsafeThawSTUArray arr+    return (IOUArray marr)++{-# RULES+"unsafeThaw/IOUArray" unsafeThaw = unsafeThawIOUArray+    #-}++#if __GLASGOW_HASKELL__ >= 711+thawIOUArray :: UArray ix e -> IO (IOUArray ix e)+#else+thawIOUArray :: Ix ix => UArray ix e -> IO (IOUArray ix e)+#endif+thawIOUArray arr = stToIO $ do+    marr <- thawSTUArray arr+    return (IOUArray marr)++{-# RULES+"thaw/IOUArray" thaw = thawIOUArray+    #-}++{-# INLINE unsafeFreezeIOUArray #-}+#if __GLASGOW_HASKELL__ >= 711+unsafeFreezeIOUArray :: IOUArray ix e -> IO (UArray ix e)+#else+unsafeFreezeIOUArray :: Ix ix => IOUArray ix e -> IO (UArray ix e)+#endif+unsafeFreezeIOUArray (IOUArray marr) = stToIO (unsafeFreezeSTUArray marr)++{-# RULES+"unsafeFreeze/IOUArray" unsafeFreeze = unsafeFreezeIOUArray+    #-}++#if __GLASGOW_HASKELL__ >= 711+freezeIOUArray :: IOUArray ix e -> IO (UArray ix e)+#else+freezeIOUArray :: Ix ix => IOUArray ix e -> IO (UArray ix e)+#endif+freezeIOUArray (IOUArray marr) = stToIO (freezeSTUArray marr)++{-# RULES+"freeze/IOUArray" freeze = freezeIOUArray+    #-}
+ tests/examples/ghc710/Jon.hs view
@@ -0,0 +1,4 @@+{- ___ -}import Data.Char;main=putStr$do{c<-"/1 AA A A;9+ )11929 )1191A 2C9A ";e+{-  |  -}    .(`divMod`8).(+(-32)).ord$c};e(0,0)="\n";e(m,n)=m?"  "++n?"_/"+{-  |  -}n?x=do{[1..n];x}                                    --- obfuscated+{-\_/ on Fairbairn, with apologies to Chris Brown. Above is / Haskell 98 -}
+ tests/examples/ghc710/LambdaCase.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE LambdaCase #-}++foo = f >>= \case+        Just h -> loadTestDB (h ++ "/.testdb")+        Nothing -> fmap S.Right initTestDB++{-| Is the alarm set - i.e. will it go off at some point in the future even if `setAlarm` is not called? -}+isAlarmSetSTM :: AlarmClock -> STM Bool+isAlarmSetSTM AlarmClock{..} = readTVar acNewSetting+  >>= \case { AlarmNotSet -> readTVar acIsSet; _ -> return True }
+ tests/examples/ghc710/LayoutLet.hs view
@@ -0,0 +1,7 @@++foo x =+  let+    a = 1+    b = 2+  in x + a + b+
+ tests/examples/ghc710/LayoutWhere.hs view
@@ -0,0 +1,6 @@++foo x = r+  where+    a = 3+    b = 4+    r = a + a + b
+ tests/examples/ghc710/LetExpr.hs view
@@ -0,0 +1,63 @@+{-# LANGUAGE PatternSynonyms #-}+{-# Language DeriveFoldable #-}+{-# LANGUAGE Safe #-}+{-# options_ghc -w #-}++-- | A simple let expression, to ensure the layout is detected+-- With some haddock in the top+{- And a normal+   multiline comment too -}+  module {- brah -}  LetExpr        ( foo -- foo does ..+                                    , bar -- bar does ..+                                    , Baz () -- baz does ..+                                 , Ba   ( ..),Ca(Cc,Cd)   ,+                                     bbb ,  aaa+                                  , module  Data.List+                                    , pattern  Bar+                                    )+    where++import Data.List+-- A comment in the middle+import {-# SOURCE #-} BootImport ( Foo(..) )+import {-# SoURCE  #-} safe   qualified  BootImport   as    BI+import qualified Data.Map as {- blah -}  Foo.Map++import Control.Monad  (   )+import Data.Word (Word8)+import Data.Tree hiding  (  drawTree   )++import qualified Data.Maybe as M hiding    ( maybe  , isJust  )+++-- comment+foo = let x = 1+          y = 2+      in x + y++bar = 3+bbb x+ | x == 1 = ()+ | otherwise = ()+++aaa [ ] _   = 0+aaa x  _unk = 1++aba () = 0++x `ccc` 1 = x + 1+x `ccc` y = x + y++x !@# y = x + y++data Baz = Baz1 | Baz2++data Ba = Ba | Bb++data Ca = Cc | Cd++pattern Foo a <- RealFoo a+pattern Bar a <- RealBar a++data Thing = RealFoo Thing | RealBar Int
+ tests/examples/ghc710/LetExpr2.hs view
@@ -0,0 +1,4 @@+l z =+  let+    ll = 34+  in ll + z
+ tests/examples/ghc710/LetExprSemi.hs view
@@ -0,0 +1,64 @@+{-# LANGUAGE PatternSynonyms #-}+{-# Language DeriveFoldable #-}+{-# LANGUAGE Safe #-}+{-# options_ghc -w #-}++-- | A simple let expression, to ensure the layout is detected+-- With some haddock in the top+{- And a normal+   multiline comment too -}+  module {- brah -}  LetExprSemi    ( foo -- foo does ..+                                    , bar -- bar does ..+                                    , Baz () -- baz does ..+                                 , Ba   ( ..),Ca(Cc,Cd)   ,+                                     bbb ,  aaa+                                  , module  Data.List+                                    , pattern  Bar+                                    )+    where+{+import Data.List+-- A comment in the middle+; import {-# SOURCE #-} BootImport ( Foo(..) ) ;+import {-# SOURCE  #-} safe   qualified  BootImport   as    BI+;;; import qualified Data.Map as {- blah -}  Foo.Map;++import Control.Monad  (   )  ;+import Data.Word (Word8);+import Data.Tree hiding  (  drawTree   ) ;++  ; import qualified Data.Maybe as M hiding    ( maybe  , isJust  )+;++-- comment+foo = let x = 1+          y = 2+      in x + y+;+bar = 3;+bbb x+ | x == 1 = ()+ | otherwise = ()++;+aaa [] _    = 0;+aaa x  _unk = 1+;+x `ccc` 1 = x + 1;+x `ccc` y = x + y+;+x !@# y = x + y+;+data Baz = Baz1 | Baz2+;+data Ba = Ba | Bb+;+data Ca = Cc | Cd+;+pattern Foo a <- RealFoo a ;+pattern Bar a <- RealBar a+;+data Thing = RealFoo Thing | RealBar Int+}++
+ tests/examples/ghc710/LetStmt.hs view
@@ -0,0 +1,9 @@+-- A simple let statement, to ensure the layout is detected++module Layout.LetStmt where++foo = do+{- ffo -}let x = 1+             y = 2 -- baz+         x+y+
+ tests/examples/ghc710/LiftedConstructors.hs view
@@ -0,0 +1,25 @@+{-# LANGUAGE DataKinds, TypeOperators, GADTs #-}++give :: b -> Pattern '[b] a+give b = Pattern (const (Just $ oneT b))+++pfail :: Pattern '[] a+pfail = is (const False)++(/\) :: Pattern vs1 a -> Pattern vs2 a -> Pattern (vs1 :++: vs2) a+(/\) = mk2 (\a -> Just (a,a))++data Pattern :: [*] -> * where+  Nil :: Pattern '[]+  Cons :: Maybe h -> Pattern t -> Pattern (h ': t)++type Pos = '("vpos", V3 GLfloat)+type Tag = '("tagByte", V1 Word8)++-- | Alias for the 'In' type from the 'Direction' kind, allows users to write+-- the 'BroadcastChan In a' type without enabling DataKinds.+type In = 'In+-- | Alias for the 'Out' type from the 'Direction' kind, allows users to write+-- the 'BroadcastChan Out a' type without enabling DataKinds.+type Out = 'Out
+ tests/examples/ghc710/LiftedInfixConstructor.hs view
@@ -0,0 +1,12 @@+{-# LANGUAGE DataKinds, TemplateHaskell #-}++applicate :: Bool -> [Stmt] -> ExpQ+applicate rawPatterns stmt = do+    return $ foldl (\g e -> VarE '(<**>) `AppE` e `AppE` g)+                    (VarE 'pure `AppE` f')+                    es++tuple :: Int -> ExpQ+tuple n = do+    ns <- replicateM n (newName "x")+    lamE [foldr (\x y -> conP '(:) [varP x,y]) wildP ns] (tupE $ map varE ns)
+ tests/examples/ghc710/LinePragma.hs view
@@ -0,0 +1,36 @@+module UHC.Light.Compiler.Core.SysF.AsTy+( Ty+, ty2TySysfWithEnv, ty2TyC+, ty2TyCforFFI )+where+import UHC.Light.Compiler.Base.Common+import UHC.Light.Compiler.Opts.Base+import UHC.Light.Compiler.Error+import qualified UHC.Light.Compiler.Core as C+import qualified UHC.Light.Compiler.Ty as T+import UHC.Light.Compiler.FinalEnv++{-# LINE 50 "src/ehc/Core/SysF/AsTy.chs" #-}+-- | The type, represented by a term CExpr+type Ty             = C.SysfTy          -- base ty++-- | Binding the bound+type TyBind         = C.SysfTyBind+type TyBound        = C.SysfTyBound++-- | A sequence of parameters (for now just a single type)+type TySeq          = C.SysfTySeq+++{-# LINE 67 "src/ehc/Core/SysF/AsTy.chs" #-}+ty2TySysfWithEnv :: ToSysfEnv -> T.Ty -> Ty+ty2TySysfWithEnv _   t =                                                     t++-- | Construct a type for use by AbstractCore+ty2TyC :: EHCOpts -> ToSysfEnv -> T.Ty -> C.CTy+ty2TyC o env t = C.mkCTy o t (ty2TySysfWithEnv env t)++{-# LINE 93 "src/ehc/Core/SysF/AsTy.chs" #-}+-- | Construct a type for use by AbstractCore, specifically for use by FFI+ty2TyCforFFI :: EHCOpts -> T.Ty -> C.CTy+ty2TyCforFFI o t = C.mkCTy o t                                t
+ tests/examples/ghc710/ListComprehensions.hs view
@@ -0,0 +1,99 @@+{-# LANGUAGE ParallelListComp,+             TransformListComp,+             RecordWildCards #-}+--             MonadComprehensions,++-- From https://ocharles.org.uk/blog/guest-posts/2014-12-07-list-comprehensions.html++import GHC.Exts+import qualified Data.Map as M+import Data.Ord (comparing)+import Data.List (sortBy)++-- Let’s look at a simple, normal list comprehension to start:++regularListComp :: [Int]+regularListComp = [ x + y * z+                  | x <- [0..10]+                  , y <- [10..20]+                  , z <- [20..30]+                  ]++parallelListComp :: [Int]+parallelListComp = [ x + y * z+                   | x <- [0..10]+                   | y <- [10..20]+                   | z <- [20..30]+                   ]++-- fibs :: [Int]+-- fibs = 0 : 1 : zipWith (+) fibs (tail fibs)++fibs :: [Int]+fibs = 0 : 1 : [ x + y+               | x <- fibs+               | y <- tail fibs+               ]++fiblikes :: [Int]+fiblikes = 0 : 1 : [ x + y + z+                   | x <- fibs+                   | y <- tail fibs+                   | z <- tail (tail fibs)+                   ]++-- TransformListComp+data Character = Character+  { firstName :: String+  , lastName :: String+  , birthYear :: Int+  } deriving (Show, Eq)++friends :: [Character]+friends = [ Character "Phoebe" "Buffay" 1963+          , Character "Chandler" "Bing" 1969+          , Character "Rachel" "Green" 1969+          , Character "Joey" "Tribbiani" 1967+          , Character "Monica" "Geller" 1964+          , Character "Ross" "Geller" 1966+          ]++oldest :: Int -> [Character] -> [String]+oldest k tbl = [ firstName ++ " " ++ lastName+               | Character{..} <- tbl+               , then sortWith by birthYear+               , then take k+               ]++groupByLargest :: Ord b => (a -> b) -> [a] -> [[a]]+groupByLargest f = sortBy (comparing (negate . length)) . groupWith f++bestBirthYears :: [Character] -> [(Int, [String])]+bestBirthYears tbl = [ (the birthYear, firstName)+                     | Character{..} <- tbl+                     , then group by birthYear using groupByLargest+                     ]++uniq_fs = [ (n, the p, the d') | (n, Fixity p d) <- fs+                                   , let d' = ppDir d+                                   , then group by Down (p,d') using groupWith ]++legendres :: [Poly Rational]+legendres = one : x :+    [ multPoly+        (poly LE [recip (n' + 1)])+        (addPoly (poly LE [0, 2 * n' + 1] `multPoly` p_n)+                 (poly LE           [-n'] `multPoly` p_nm1)+        )+    | n     <- [1..], let n' = fromInteger n+    | p_n   <- tail legendres+    | p_nm1 <- legendres+    ]++fromGroups' :: (Ord k) => a -> [a] -> Maybe (W.Stack k) -> Groups k -> [a]+                    -> [(Bool,(a, W.Stack k))]+fromGroups' defl defls st gs sls =+    [ (isNew,fromMaybe2 (dl, single w) (l, M.lookup w gs))+        | l <- map Just sls ++ repeat Nothing, let isNew = isNothing l+        | dl <- defls ++ repeat defl+        | w <- W.integrate' $ W.filter (`notElem` unfocs) =<< st ]
+ tests/examples/ghc710/LocalDecls2Expected.hs view
@@ -0,0 +1,6 @@+module LocalDecls2Expected where++foo a = bar a+  where+    nn :: Int+    nn = 2
+ tests/examples/ghc710/MagicHash.hs view
@@ -0,0 +1,29 @@+{-# LANGUAGE MagicHash #-}++module Data.Text.Internal.Builder.Functions+    (+      (<>)+    , i2d+    ) where++import Data.Monoid (mappend)+import Data.Text.Lazy.Builder (Builder)+import GHC.Base++-- | Unsafe conversion for decimal digits.+{-# INLINE i2d #-}+i2d :: Int -> Char+i2d (I# i#) = C# (chr# (ord# '0'# +# i#))++main =+  print (F# (expFloat# 3.45#))++-- | The normal 'mappend' function with right associativity instead of+-- left.+(<>) :: Builder -> Builder -> Builder+(<>) = mappend+{-# INLINE (<>) #-}++infixr 4 <>++
+ tests/examples/ghc710/MangledSemiLet.hs view
@@ -0,0 +1,10 @@+{-# LANGUAGE+    BangPatterns+  #-}+++mtGamma a b =+  let !x_2 = x*x; !x_4 = x_2*x_2+      v3 = v*v*v+      dv = d * v3+  in 5
+ tests/examples/ghc710/Minimal.hs view
@@ -0,0 +1,37 @@+class AwsType a where+    toText :: a -> b+++    {-# MINIMAL toText #-}++class Minimal a where+  toText :: a -> b+  {-# MINIMAL decimal, hexadecimal, realFloat, scientific #-}++class Minimal a where+  toText :: a -> b+  {-# MINIMAL shape, (maskedIndex | maskedLinearIndex) #-}++class Minimal a where+  toText :: a -> b+  {-# MINIMAL (toSample | toSamples) #-}++class ManyOps a where+    aOp :: a -> a -> Bool+    bOp :: a -> a -> Bool+    cOp :: a -> a -> Bool+    dOp :: a -> a -> Bool+    eOp :: a -> a -> Bool+    fOp :: a -> a -> Bool+    {-# MINIMAL  ( aOp)+               | ( bOp   , cOp)+               | ((dOp  |  eOp) , fOp)+      #-}++class Foo a where+    bar :: a -> a -> Bool+    foo :: a -> a -> Bool+    baq :: a -> a -> Bool+    baz :: a -> a -> Bool+    quux :: a -> a -> Bool+    {-# MINIMAL bar, (foo, baq | foo, quux) #-}
+ tests/examples/ghc710/Mixed.hs view

file too large to diff

+ tests/examples/ghc710/MonadComprehensions.hs view

file too large to diff

+ tests/examples/ghc710/Move1.hs view

file too large to diff

+ tests/examples/ghc710/MultiImplicitParams.hs view

file too large to diff

+ tests/examples/ghc710/MultiLineCommentWithPragmas.hs view

file too large to diff

+ tests/examples/ghc710/MultiParamTypeClasses.hs view

file too large to diff

+ tests/examples/ghc710/MultiWayIf.hs view

file too large to diff

+ tests/examples/ghc710/NegLit.hs view

file too large to diff

+ tests/examples/ghc710/NestedDoLambda.hs view

file too large to diff

+ tests/examples/ghc710/NestedLambda.hs view

file too large to diff

+ tests/examples/ghc710/NullaryTypeClasses.hs view

file too large to diff

+ tests/examples/ghc710/Obscure.hs view

file too large to diff

+ tests/examples/ghc710/OptSig.hs view

file too large to diff

+ tests/examples/ghc710/OptSig2.hs view

file too large to diff

+ tests/examples/ghc710/OveridingPrimitives.hs view

file too large to diff

+ tests/examples/ghc710/OverloadedStrings.hs view

file too large to diff

+ tests/examples/ghc710/PArr.hs view

file too large to diff

+ tests/examples/ghc710/ParensAroundContext.hs view

file too large to diff

+ tests/examples/ghc710/PatBind.hs view

file too large to diff

+ tests/examples/ghc710/PatSigBind.hs view

file too large to diff

+ tests/examples/ghc710/PatSynBind.hs view

file too large to diff

+ tests/examples/ghc710/PatternGuards.hs view

file too large to diff

+ tests/examples/ghc710/ProcNotation.hs view

file too large to diff

+ tests/examples/ghc710/Pseudonym.hs view

file too large to diff

+ tests/examples/ghc710/PuncFunctions.hs view

file too large to diff

+ tests/examples/ghc710/QuasiQuote.hs view

file too large to diff

+ tests/examples/ghc710/RSA.hs view

file too large to diff

+ tests/examples/ghc710/RankNTypes.hs view

file too large to diff

+ tests/examples/ghc710/RdrNames.hs view

file too large to diff

+ tests/examples/ghc710/RebindableSyntax.hs view

file too large to diff

+ tests/examples/ghc710/RecordSemi.hs view

file too large to diff

+ tests/examples/ghc710/RecordUpdate.hs view

file too large to diff

+ tests/examples/ghc710/RecordWildcard.hs view

file too large to diff

+ tests/examples/ghc710/RecursiveDo.hs view

file too large to diff

+ tests/examples/ghc710/RedundantDo.hs view

file too large to diff

+ tests/examples/ghc710/Remorse.hs view

file too large to diff

+ tests/examples/ghc710/Roles.hs view

file too large to diff

+ tests/examples/ghc710/Rules.hs view

file too large to diff

+ tests/examples/ghc710/RulesSemi.hs view

file too large to diff

+ tests/examples/ghc710/ScopedTypeVariables.hs view

file too large to diff

+ tests/examples/ghc710/SemiInstance.hs view

file too large to diff

+ tests/examples/ghc710/SemiWorkout.hs view

file too large to diff

+ tests/examples/ghc710/Shebang.hs view

file too large to diff

+ tests/examples/ghc710/ShiftingLambda.hs view

file too large to diff

+ tests/examples/ghc710/Sigs.hs view

file too large to diff

+ tests/examples/ghc710/Simple.hs view

file too large to diff

+ tests/examples/ghc710/SimpleComplexTuple.hs view

file too large to diff

+ tests/examples/ghc710/SimpleDo.hs view

file too large to diff

+ tests/examples/ghc710/SlidingDataClassDecl.hs view

file too large to diff

+ tests/examples/ghc710/SlidingDoClause.hs view

file too large to diff

+ tests/examples/ghc710/SlidingLambda.hs view

file too large to diff

+ tests/examples/ghc710/SlidingListComp.hs view

file too large to diff

+ tests/examples/ghc710/SlidingRecordSetter.hs view

file too large to diff

+ tests/examples/ghc710/SlidingTypeSyn.hs view

file too large to diff

+ tests/examples/ghc710/SpacesSplice.hs view

file too large to diff

+ tests/examples/ghc710/Splice.hs view

file too large to diff

+ tests/examples/ghc710/SpliceSemi.hs view

file too large to diff

+ tests/examples/ghc710/StaticPointers.hs view

file too large to diff

+ tests/examples/ghc710/Stmts.hs view

file too large to diff

+ tests/examples/ghc710/StrangeTypeClass.hs view

file too large to diff

+ tests/examples/ghc710/Stream.hs view

file too large to diff

+ tests/examples/ghc710/StrictLet.hs view

file too large to diff

+ tests/examples/ghc710/StringGap.hs view

file too large to diff

+ tests/examples/ghc710/T10196.hs view

file too large to diff

+ tests/examples/ghc710/T10942.hs view

file too large to diff

+ tests/examples/ghc710/T2388.hs view

file too large to diff

+ tests/examples/ghc710/T3132.hs view

file too large to diff

+ tests/examples/ghc710/T5951.hs view

file too large to diff

+ tests/examples/ghc710/T7918A.hs view

file too large to diff

+ tests/examples/ghc710/TH.hs view

file too large to diff

+ tests/examples/ghc710/THMonadInstance.hs view

file too large to diff

+ tests/examples/ghc710/TemplateHaskell.hs view

file too large to diff

+ tests/examples/ghc710/TransformListComp.hs view

file too large to diff

+ tests/examples/ghc710/Trit.hs view

file too large to diff

+ tests/examples/ghc710/Tuple.hs view

file too large to diff

+ tests/examples/ghc710/TupleSections.hs view

file too large to diff

+ tests/examples/ghc710/TypeBrackets.hs view

file too large to diff

+ tests/examples/ghc710/TypeBrackets2.hs view

file too large to diff

+ tests/examples/ghc710/TypeBrackets4.hs view

file too large to diff

+ tests/examples/ghc710/TypeFamilies.hs view

file too large to diff

+ tests/examples/ghc710/TypeFamilies2.hs view

file too large to diff

+ tests/examples/ghc710/TypeInstance.hs view

file too large to diff

+ tests/examples/ghc710/TypeOperators.hs view

file too large to diff

+ tests/examples/ghc710/TypeSignature.hs view

file too large to diff

+ tests/examples/ghc710/TypeSignatureParens.hs view

file too large to diff

+ tests/examples/ghc710/TypeSynOperator.hs view

file too large to diff

+ tests/examples/ghc710/TypeSynParens.hs view

file too large to diff

+ tests/examples/ghc710/Unboxed.hs view

file too large to diff

+ tests/examples/ghc710/Undefined10.hs view

file too large to diff

+ tests/examples/ghc710/Undefined11.hs view

file too large to diff

+ tests/examples/ghc710/Undefined13.hs view

file too large to diff

+ tests/examples/ghc710/Undefined2.hs view

file too large to diff

+ tests/examples/ghc710/Undefined3.hs view

file too large to diff

+ tests/examples/ghc710/Undefined4.hs view

file too large to diff

+ tests/examples/ghc710/Undefined5.hs view

file too large to diff

+ tests/examples/ghc710/Undefined6.hs view

file too large to diff

+ tests/examples/ghc710/Undefined7.hs view

file too large to diff

+ tests/examples/ghc710/Undefined8.hs view

file too large to diff

+ tests/examples/ghc710/Undefined9.hs view

file too large to diff

+ tests/examples/ghc710/Unicode.hs view

file too large to diff

+ tests/examples/ghc710/UnicodeSyntaxFailure.hs view

file too large to diff

+ tests/examples/ghc710/Utilities.hs view

file too large to diff

+ tests/examples/ghc710/Utils2.hs view

file too large to diff

+ tests/examples/ghc710/Vect.hs view

file too large to diff

+ tests/examples/ghc710/ViewPatterns.hs view

file too large to diff

+ tests/examples/ghc710/Warning.hs view

file too large to diff

+ tests/examples/ghc710/Zipper.hs view

file too large to diff

+ tests/examples/ghc8/A.hs view

file too large to diff

+ tests/examples/ghc8/Associated.hs view

file too large to diff

+ tests/examples/ghc8/AssociatedInternal.hs view

file too large to diff

+ tests/examples/ghc8/B.hs view

file too large to diff

+ tests/examples/ghc8/C.hs view

file too large to diff

+ tests/examples/ghc8/CheckUtils.hs view

file too large to diff

+ tests/examples/ghc8/ClosedFam1a.hs view

file too large to diff

+ tests/examples/ghc8/ClosedFam2a.hs view

file too large to diff

+ tests/examples/ghc8/ClosedFam3a.hs view

file too large to diff

+ tests/examples/ghc8/CmmSwitchTest.hs view

file too large to diff

+ tests/examples/ghc8/CmmSwitchTestGen.hs view

file too large to diff

+ tests/examples/ghc8/D.hs view

file too large to diff

+ tests/examples/ghc8/DataFamilyInstanceLHS.hs view

file too large to diff

+ tests/examples/ghc8/Defer03.hs view

file too large to diff

+ tests/examples/ghc8/DeprM.hs view

file too large to diff

+ tests/examples/ghc8/DeprU.hs view

file too large to diff

+ tests/examples/ghc8/DsStrictData.hs view

file too large to diff

+ tests/examples/ghc8/ExpandSynsFail1.hs view

file too large to diff

+ tests/examples/ghc8/ExpandSynsFail2.hs view

file too large to diff

+ tests/examples/ghc8/ExpandSynsFail3.hs view

file too large to diff

+ tests/examples/ghc8/ExpandSynsFail4.hs view

file too large to diff

+ tests/examples/ghc8/ExportSyntax.hs view

file too large to diff

+ tests/examples/ghc8/ExportSyntaxImport.hs view

file too large to diff

+ tests/examples/ghc8/ExtraConstraintsWildcardInExpressionSignature.hs view

file too large to diff

+ tests/examples/ghc8/ExtraConstraintsWildcardInPatternSignature.hs view

file too large to diff

+ tests/examples/ghc8/ExtraConstraintsWildcardInPatternSplice.hs view

file too large to diff

+ tests/examples/ghc8/ExtraConstraintsWildcardInTypeSplice.hs view

file too large to diff

+ tests/examples/ghc8/ExtraConstraintsWildcardInTypeSplice2.hs view

file too large to diff

+ tests/examples/ghc8/ExtraConstraintsWildcardInTypeSpliceUsed.hs view

file too large to diff

+ tests/examples/ghc8/ExtraConstraintsWildcardTwice.hs view

file too large to diff

+ tests/examples/ghc8/FDsFromGivens2.hs view

file too large to diff

+ tests/examples/ghc8/FooBar.hs view

file too large to diff

+ tests/examples/ghc8/IPLocation.hs view

file too large to diff

+ tests/examples/ghc8/Improvement.hs view

file too large to diff

+ tests/examples/ghc8/ListComprehensions.hs view

file too large to diff

+ tests/examples/ghc8/Main.hs view

file too large to diff

+ tests/examples/ghc8/NamedWildcardInDataFamilyInstanceLHS.hs view

file too large to diff

+ tests/examples/ghc8/NamedWildcardInTypeFamilyInstanceLHS.hs view

file too large to diff

+ tests/examples/ghc8/NamedWildcardInTypeSplice.hs view

file too large to diff

+ tests/examples/ghc8/OutOfHeap.hs view

file too large to diff

+ tests/examples/ghc8/P.hs view

file too large to diff

+ tests/examples/ghc8/PartialClassMethodSignature2.hs view

file too large to diff

+ tests/examples/ghc8/Q.hs view

file too large to diff

+ tests/examples/ghc8/QQ.hs view

file too large to diff

+ tests/examples/ghc8/RandomPGC.hs view

file too large to diff

+ tests/examples/ghc8/RepArrow.hs view

file too large to diff

+ tests/examples/ghc8/Roles12a.hs view

file too large to diff

+ tests/examples/ghc8/RuleDefiningPlugin.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap1.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap10.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap10_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap10_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap11.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap11_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap11_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap1_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap1_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap2.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap2_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap2_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap3.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap3_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap3_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap4.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap4_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap4_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap5.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap5_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap5_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap6.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap6_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap6_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap7.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap7_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap7_B.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap8.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap8_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap9.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap9_A.hs view

file too large to diff

+ tests/examples/ghc8/SH_Overlap9_B.hs view

file too large to diff

+ tests/examples/ghc8/SayAnnNames.hs view

file too large to diff

+ tests/examples/ghc8/Setup.hs view

file too large to diff

+ tests/examples/ghc8/ShouldFail.hs view

file too large to diff

+ tests/examples/ghc8/Splices.hs view

file too large to diff

+ tests/examples/ghc8/SplicesUsed.hs view

file too large to diff

+ tests/examples/ghc8/StackOverflow.hs view

file too large to diff

+ tests/examples/ghc8/T10009.hs view

file too large to diff

+ tests/examples/ghc8/T10030.hs view

file too large to diff

+ tests/examples/ghc8/T10041.hs view

file too large to diff

+ tests/examples/ghc8/T10047.hs view

file too large to diff

+ tests/examples/ghc8/T10052-input.hs view

file too large to diff

+ tests/examples/ghc8/T10052.hs view

file too large to diff

+ tests/examples/ghc8/T10083.hs view

file too large to diff

+ tests/examples/ghc8/T10083a.hs view

file too large to diff

+ tests/examples/ghc8/T10100.hs view

file too large to diff

+ tests/examples/ghc8/T10104.hs view

file too large to diff

+ tests/examples/ghc8/T10109.hs view

file too large to diff

+ tests/examples/ghc8/T10110A.hs view

file too large to diff

+ tests/examples/ghc8/T10110B.hs view

file too large to diff

+ tests/examples/ghc8/T10110C.hs view

file too large to diff

+ tests/examples/ghc8/T10112.hs view

file too large to diff

+ tests/examples/ghc8/T10134.hs view

file too large to diff

+ tests/examples/ghc8/T10134a.hs view

file too large to diff

+ tests/examples/ghc8/T10139.hs view

file too large to diff

+ tests/examples/ghc8/T10141.hs view

file too large to diff

+ tests/examples/ghc8/T10148.hs view

file too large to diff

+ tests/examples/ghc8/T10156.hs view

file too large to diff

+ tests/examples/ghc8/T10180.hs view

file too large to diff

+ tests/examples/ghc8/T10181.hs view

file too large to diff

+ tests/examples/ghc8/T10182.hs view

file too large to diff

+ tests/examples/ghc8/T10182a.hs view

file too large to diff

+ tests/examples/ghc8/T10184.hs view

file too large to diff

+ tests/examples/ghc8/T10185.hs view

file too large to diff

+ tests/examples/ghc8/T10188.hs view

file too large to diff

+ tests/examples/ghc8/T10194.hs view

file too large to diff

+ tests/examples/ghc8/T10195.hs view

file too large to diff

+ tests/examples/ghc8/T10196.hs view

file too large to diff

+ tests/examples/ghc8/T10196Fail1.hs view

file too large to diff

+ tests/examples/ghc8/T10196Fail2.hs view

file too large to diff

+ tests/examples/ghc8/T10196Fail3.hs view

file too large to diff

+ tests/examples/ghc8/T10218.hs view

file too large to diff

+ tests/examples/ghc8/T10220B.hs view

file too large to diff

+ tests/examples/ghc8/T10226.hs view

file too large to diff

+ tests/examples/ghc8/T10233.hs view

file too large to diff

+ tests/examples/ghc8/T10233a.hs view

file too large to diff

+ tests/examples/ghc8/T10245.hs view

file too large to diff

+ tests/examples/ghc8/T10246.hs view

file too large to diff

+ tests/examples/ghc8/T10251.hs view

file too large to diff

+ tests/examples/ghc8/T10263.hs view

file too large to diff

+ tests/examples/ghc8/T10279.hs view

file too large to diff

+ tests/examples/ghc8/T10283.hs view

file too large to diff

+ tests/examples/ghc8/T10284.hs view

file too large to diff

+ tests/examples/ghc8/T10285.hs view

file too large to diff

+ tests/examples/ghc8/T10285a.hs view

file too large to diff

+ tests/examples/ghc8/T10294.hs view

file too large to diff

+ tests/examples/ghc8/T10294a.hs view

file too large to diff

+ tests/examples/ghc8/T10306.hs view

file too large to diff

+ tests/examples/ghc8/T10321.hs view

file too large to diff

+ tests/examples/ghc8/T10322A.hs view

file too large to diff

+ tests/examples/ghc8/T10322B.hs view

file too large to diff

+ tests/examples/ghc8/T10322C.hs view

file too large to diff

+ tests/examples/ghc8/T10335.hs view

file too large to diff

+ tests/examples/ghc8/T10340.hs view

file too large to diff

+ tests/examples/ghc8/T10348.hs view

file too large to diff

+ tests/examples/ghc8/T10351.hs view

file too large to diff

+ tests/examples/ghc8/T10359.hs view

file too large to diff

+ tests/examples/ghc8/T10384.hs view

file too large to diff

+ tests/examples/ghc8/T10390.hs view

file too large to diff

+ tests/examples/ghc8/T10398.hs view

file too large to diff

+ tests/examples/ghc8/T10403.hs view

file too large to diff

+ tests/examples/ghc8/T10414.hs view

file too large to diff

+ tests/examples/ghc8/T10420.hs view

file too large to diff

+ tests/examples/ghc8/T10420a.hs view

file too large to diff

+ tests/examples/ghc8/T10423.hs view

file too large to diff

+ tests/examples/ghc8/T10428.hs view

file too large to diff

+ tests/examples/ghc8/T10438.hs view

file too large to diff

+ tests/examples/ghc8/T10447.hs view

file too large to diff

+ tests/examples/ghc8/T10451.hs view

file too large to diff

+ tests/examples/ghc8/T10460.hs view

file too large to diff

+ tests/examples/ghc8/T10461.hs view

file too large to diff

+ tests/examples/ghc8/T10463.hs view

file too large to diff

+ tests/examples/ghc8/T10481.hs view

file too large to diff

+ tests/examples/ghc8/T10482.hs view

file too large to diff

+ tests/examples/ghc8/T10482a.hs view

file too large to diff

+ tests/examples/ghc8/T10489.hs view

file too large to diff

+ tests/examples/ghc8/T10493.hs view

file too large to diff

+ tests/examples/ghc8/T10494.hs view

file too large to diff

+ tests/examples/ghc8/T10495.hs view

file too large to diff

+ tests/examples/ghc8/T10503.hs view

file too large to diff

+ tests/examples/ghc8/T10507.hs view

file too large to diff

+ tests/examples/ghc8/T10508_api.hs view

file too large to diff

+ tests/examples/ghc8/T10516.hs view

file too large to diff

+ tests/examples/ghc8/T10519.hs view

file too large to diff

+ tests/examples/ghc8/T10521.hs view

file too large to diff

+ tests/examples/ghc8/T10521b.hs view

file too large to diff

+ tests/examples/ghc8/T10524.hs view

file too large to diff

+ tests/examples/ghc8/T10534.hs view

file too large to diff

+ tests/examples/ghc8/T10534a.hs view

file too large to diff

+ tests/examples/ghc8/T10549.hs view

file too large to diff

+ tests/examples/ghc8/T10561.hs view

file too large to diff

+ tests/examples/ghc8/T10562.hs view

file too large to diff

+ tests/examples/ghc8/T10564.hs view

file too large to diff

+ tests/examples/ghc8/T10570.hs view

file too large to diff

+ tests/examples/ghc8/T10582.hs view

file too large to diff

+ tests/examples/ghc8/T10590.hs view

file too large to diff

+ tests/examples/ghc8/T10596.hs view

file too large to diff

+ tests/examples/ghc8/T10602.hs view

file too large to diff

+ tests/examples/ghc8/T10602b.hs view

file too large to diff

+ tests/examples/ghc8/T10615.hs view

file too large to diff

+ tests/examples/ghc8/T10618.hs view

file too large to diff

+ tests/examples/ghc8/T10620.hs view

file too large to diff

+ tests/examples/ghc8/T10627.hs view

file too large to diff

+ tests/examples/ghc8/T10632.hs view

file too large to diff

+ tests/examples/ghc8/T10634.hs view

file too large to diff

+ tests/examples/ghc8/T10637.hs view

file too large to diff

+ tests/examples/ghc8/T10638.hs view

file too large to diff

+ tests/examples/ghc8/T10642.hs view

file too large to diff

+ tests/examples/ghc8/T10668.hs view

file too large to diff

+ tests/examples/ghc8/T10670.hs view

file too large to diff

+ tests/examples/ghc8/T10670a.hs view

file too large to diff

+ tests/examples/ghc8/T10689.hs view

file too large to diff

+ tests/examples/ghc8/T10689a.hs view

file too large to diff

+ tests/examples/ghc8/T10694.hs view

file too large to diff

+ tests/examples/ghc8/T10698.hs view

file too large to diff

+ tests/examples/ghc8/T10704.hs view

file too large to diff

+ tests/examples/ghc8/T10704a.hs view

file too large to diff

+ tests/examples/ghc8/T10713.hs view

file too large to diff

+ tests/examples/ghc8/T10742.hs view

file too large to diff

+ tests/examples/ghc8/T10744.hs view

file too large to diff

+ tests/examples/ghc8/T10753.hs view

file too large to diff

+ tests/examples/ghc8/T10781.hs view

file too large to diff

+ tests/examples/ghc8/T10806.hs view

file too large to diff

+ tests/examples/ghc8/T10815.hs view

file too large to diff

+ tests/examples/ghc8/T10826.hs view

file too large to diff

+ tests/examples/ghc8/T10830.hs view

file too large to diff

+ tests/examples/ghc8/T10836.hs view

file too large to diff

+ tests/examples/ghc8/T10895.hs view

file too large to diff

+ tests/examples/ghc8/T1133Aa.hs view

file too large to diff

+ tests/examples/ghc8/T1133a.hs view

file too large to diff

+ tests/examples/ghc8/T17a.hs view

file too large to diff

+ tests/examples/ghc8/T17b.hs view

file too large to diff

+ tests/examples/ghc8/T17c.hs view

file too large to diff

+ tests/examples/ghc8/T17d.hs view

file too large to diff

+ tests/examples/ghc8/T17e.hs view

file too large to diff

+ tests/examples/ghc8/T2632.hs view

file too large to diff

+ tests/examples/ghc8/T2931.hs view

file too large to diff

+ tests/examples/ghc8/T2991.hs view

file too large to diff

+ tests/examples/ghc8/T3468a.hs view

file too large to diff

+ tests/examples/ghc8/T3572.hs view

file too large to diff

+ tests/examples/ghc8/T4056.hs view

file too large to diff

+ tests/examples/ghc8/T4169.hs view

file too large to diff

+ tests/examples/ghc8/T4170.hs view

file too large to diff

+ tests/examples/ghc8/T5001b.hs view

file too large to diff

+ tests/examples/ghc8/T5333.hs view

file too large to diff

+ tests/examples/ghc8/T5721.hs view

file too large to diff

+ tests/examples/ghc8/T5821.hs view

file too large to diff

+ tests/examples/ghc8/T5884Other.hs view

file too large to diff

+ tests/examples/ghc8/T5908.hs view

file too large to diff

+ tests/examples/ghc8/T6018.hs view

file too large to diff

+ tests/examples/ghc8/T6018Afail.hs view

file too large to diff

+ tests/examples/ghc8/T6018Bfail.hs view

file too large to diff

+ tests/examples/ghc8/T6018Cfail.hs view

file too large to diff

+ tests/examples/ghc8/T6018Dfail.hs view

file too large to diff

+ tests/examples/ghc8/T6018a.hs view

file too large to diff

+ tests/examples/ghc8/T6018fail.hs view

file too large to diff

+ tests/examples/ghc8/T6018failclosed.hs view

file too large to diff

+ tests/examples/ghc8/T6018failclosed2.hs view

file too large to diff

+ tests/examples/ghc8/T6018rnfail.hs view

file too large to diff

+ tests/examples/ghc8/T6018th.hs view

file too large to diff

+ tests/examples/ghc8/T6062.hs view

file too large to diff

+ tests/examples/ghc8/T7411.hs view

file too large to diff

+ tests/examples/ghc8/T7672.hs view

file too large to diff

+ tests/examples/ghc8/T7672a.hs view

file too large to diff

+ tests/examples/ghc8/T7765.hs view

file too large to diff

+ tests/examples/ghc8/T7788.hs view

file too large to diff

+ tests/examples/ghc8/T8030.hs view

file too large to diff

+ tests/examples/ghc8/T8034.hs view

file too large to diff

+ tests/examples/ghc8/T8101b.hs view

file too large to diff

+ tests/examples/ghc8/T8131b.hs view

file too large to diff

+ tests/examples/ghc8/T8274.hs view

file too large to diff

+ tests/examples/ghc8/T8455.hs view

file too large to diff

+ tests/examples/ghc8/T8550.hs view

file too large to diff

+ tests/examples/ghc8/T8555.hs view

file too large to diff

+ tests/examples/ghc8/T8633.hs view

file too large to diff

+ tests/examples/ghc8/T8743a.hs view

file too large to diff

+ tests/examples/ghc8/T8759a.hs view

file too large to diff

+ tests/examples/ghc8/T8799.hs view

file too large to diff

+ tests/examples/ghc8/T9177a.hs view

file too large to diff

+ tests/examples/ghc8/T9204a.hs view

file too large to diff

+ tests/examples/ghc8/T9204b.hs view

file too large to diff

+ tests/examples/ghc8/T9204b2.hs view

file too large to diff

+ tests/examples/ghc8/T9225.hs view

file too large to diff

+ tests/examples/ghc8/T9233.hs view

file too large to diff

+ tests/examples/ghc8/T9233a.hs view

file too large to diff

+ tests/examples/ghc8/T9260.hs view

file too large to diff

+ tests/examples/ghc8/T9430.hs view

file too large to diff

+ tests/examples/ghc8/T9554.hs view

file too large to diff

+ tests/examples/ghc8/T9600-1.hs view

file too large to diff

+ tests/examples/ghc8/T9600.hs view

file too large to diff

+ tests/examples/ghc8/T9723a.hs view

file too large to diff

+ tests/examples/ghc8/T9723b.hs view

file too large to diff

+ tests/examples/ghc8/T9824.hs view

file too large to diff

+ tests/examples/ghc8/T9839_02.hs view

file too large to diff

+ tests/examples/ghc8/T9839_03.hs view

file too large to diff

+ tests/examples/ghc8/T9839_04.hs view

file too large to diff

+ tests/examples/ghc8/T9839_05.hs view

file too large to diff

+ tests/examples/ghc8/T9839_06.hs view

file too large to diff

+ tests/examples/ghc8/T9840.hs view

file too large to diff

+ tests/examples/ghc8/T9840a.hs view

file too large to diff

+ tests/examples/ghc8/T9858a.hs view

file too large to diff

+ tests/examples/ghc8/T9858b.hs view

file too large to diff

+ tests/examples/ghc8/T9858c.hs view

file too large to diff

+ tests/examples/ghc8/T9858d.hs view

file too large to diff

+ tests/examples/ghc8/T9858e.hs view

file too large to diff

+ tests/examples/ghc8/T9867.hs view

file too large to diff

+ tests/examples/ghc8/T9878b.hs view

file too large to diff

+ tests/examples/ghc8/T9938.hs view

file too large to diff

+ tests/examples/ghc8/T9938B.hs view

file too large to diff

+ tests/examples/ghc8/T9939.hs view

file too large to diff

+ tests/examples/ghc8/T9964.hs view

file too large to diff

+ tests/examples/ghc8/T9973.hs view

file too large to diff

+ tests/examples/ghc8/T9975a.hs view

file too large to diff

+ tests/examples/ghc8/T9975b.hs view

file too large to diff

+ tests/examples/ghc8/TH_abstractFamily.hs view

file too large to diff

+ tests/examples/ghc8/TH_bracket1.hs view

file too large to diff

+ tests/examples/ghc8/TH_bracket2.hs view

file too large to diff

+ tests/examples/ghc8/TH_bracket3.hs view

file too large to diff

+ tests/examples/ghc8/TH_localname.hs view

file too large to diff

+ tests/examples/ghc8/TH_namePackage.hs view

file too large to diff

+ tests/examples/ghc8/TH_ppr1.hs view

file too large to diff

+ tests/examples/ghc8/TH_reifyType1.hs view

file too large to diff

+ tests/examples/ghc8/TH_reifyType2.hs view

file too large to diff

+ tests/examples/ghc8/TH_repE1.hs view

file too large to diff

+ tests/examples/ghc8/TH_repE3.hs view

file too large to diff

+ tests/examples/ghc8/TH_scope.hs view

file too large to diff

+ tests/examples/ghc8/TH_tf2.hs view

file too large to diff

+ tests/examples/ghc8/TcCustomSolverSuper.hs view

file too large to diff

+ tests/examples/ghc8/Test.hs view

file too large to diff

+ tests/examples/ghc8/Test10255.hs view

file too large to diff

+ tests/examples/ghc8/Test10268.hs view

file too large to diff

+ tests/examples/ghc8/Test10269.hs view

file too large to diff

+ tests/examples/ghc8/Test10278.hs view

file too large to diff

+ tests/examples/ghc8/Test10280.hs view

file too large to diff

+ tests/examples/ghc8/Test10307.hs view

file too large to diff

+ tests/examples/ghc8/Test10309.hs view

file too large to diff

+ tests/examples/ghc8/Test10312.hs view

file too large to diff

+ tests/examples/ghc8/Test10313.hs view

file too large to diff

+ tests/examples/ghc8/Test10354.hs view

file too large to diff

+ tests/examples/ghc8/Test10357.hs view

file too large to diff

+ tests/examples/ghc8/Test10358.hs view

file too large to diff

+ tests/examples/ghc8/Test10396.hs view

file too large to diff

+ tests/examples/ghc8/Test10399.hs view

file too large to diff

+ tests/examples/ghc8/TestBoolFormula.hs view

file too large to diff

+ tests/examples/ghc8/Trac10045.hs view

file too large to diff

+ tests/examples/ghc8/TransAssociated.hs view

file too large to diff

+ tests/examples/ghc8/TypeFamilyInstanceLHS.hs view

file too large to diff

+ tests/examples/ghc8/TypedSplice.hs view

file too large to diff

+ tests/examples/ghc8/ado001.hs view

file too large to diff

+ tests/examples/ghc8/ado002.hs view

file too large to diff

+ tests/examples/ghc8/ado003.hs view

file too large to diff

+ tests/examples/ghc8/ado004.hs view

file too large to diff

+ tests/examples/ghc8/ado005.hs view

file too large to diff

+ tests/examples/ghc8/ado006.hs view

file too large to diff

+ tests/examples/ghc8/ado007.hs view

file too large to diff

+ tests/examples/ghc8/boolFormula.hs view

file too large to diff

+ tests/examples/ghc8/export-class.hs view

file too large to diff

+ tests/examples/ghc8/export-super-class-fail.hs view

file too large to diff

+ tests/examples/ghc8/export-super-class.hs view

file too large to diff

+ tests/examples/ghc8/export-syntax.hs view

file too large to diff

+ tests/examples/ghc8/export-type.hs view

file too large to diff

+ tests/examples/ghc8/haddockA034.hs view

file too large to diff

+ tests/examples/ghc8/import-syntax.hs view

file too large to diff

+ tests/examples/ghc8/listcomps.hs view

file too large to diff

+ tests/examples/ghc8/multi-export.hs view

file too large to diff

+ tests/examples/ghc8/performGC.hs view

file too large to diff

+ tests/examples/ghc8/plugins07.hs view

file too large to diff

+ tests/examples/ghc8/poly-export-fail2.hs view

file too large to diff

+ tests/examples/ghc8/poly-export.hs view

file too large to diff

+ tests/examples/ghc8/poly-export2.hs view

file too large to diff

+ tests/examples/ghc8/poly-export3.hs view

file too large to diff

+ tests/examples/ghc8/stringSource.hs view

file too large to diff

+ tests/examples/ghc8/t10255.hs view

file too large to diff

+ tests/examples/ghc8/t10268.hs view

file too large to diff

+ tests/examples/ghc8/t10269.hs view

file too large to diff

+ tests/examples/ghc8/t10278.hs view

file too large to diff

+ tests/examples/ghc8/t10280.hs view

file too large to diff

+ tests/examples/ghc8/t10307.hs view

file too large to diff

+ tests/examples/ghc8/t10309.hs view

file too large to diff

+ tests/examples/ghc8/t10312.hs view

file too large to diff

+ tests/examples/ghc8/t10354.hs view

file too large to diff

+ tests/examples/ghc8/t10357.hs view

file too large to diff

+ tests/examples/ghc8/t10358.hs view

file too large to diff

+ tests/examples/ghc8/t10396.hs view

file too large to diff

+ tests/examples/ghc8/t10399.hs view

file too large to diff

+ tests/examples/ghc8/tc265.hs view

file too large to diff

+ tests/examples/ghc8/tcfail223.hs view

file too large to diff

+ tests/examples/ghc8/update-existential.hs view

file too large to diff

+ tests/examples/transform/AddDecl.hs view

file too large to diff

+ tests/examples/transform/AddDecl.hs.expected view

file too large to diff

+ tests/examples/transform/AddHiding1.hs view

file too large to diff

+ tests/examples/transform/AddHiding1.hs.expected view

file too large to diff

+ tests/examples/transform/AddHiding2.hs view

file too large to diff

+ tests/examples/transform/AddHiding2.hs.expected view

file too large to diff

+ tests/examples/transform/AddLocalDecl1.hs view

file too large to diff

+ tests/examples/transform/AddLocalDecl1.hs.expected view

file too large to diff

+ tests/examples/transform/AddLocalDecl2.hs view

file too large to diff

+ tests/examples/transform/AddLocalDecl2.hs.expected view

file too large to diff

+ tests/examples/transform/AddLocalDecl3.hs view

file too large to diff

+ tests/examples/transform/AddLocalDecl3.hs.expected view

file too large to diff

+ tests/examples/transform/AddLocalDecl4.hs view

file too large to diff

+ tests/examples/transform/AddLocalDecl4.hs.expected view

file too large to diff

+ tests/examples/transform/AddLocalDecl5.hs view

file too large to diff

+ tests/examples/transform/AddLocalDecl5.hs.expected view

file too large to diff

+ tests/examples/transform/AddLocalDecl6.hs view

file too large to diff

+ tests/examples/transform/AddLocalDecl6.hs.expected view

file too large to diff

+ tests/examples/transform/C.hs view

file too large to diff

+ tests/examples/transform/C.hs.expected view

file too large to diff

+ tests/examples/transform/CloneDecl1.hs view

file too large to diff

+ tests/examples/transform/CloneDecl1.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutIn1.hs view

file too large to diff

+ tests/examples/transform/LayoutIn1.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutIn3.hs view

file too large to diff

+ tests/examples/transform/LayoutIn3.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutIn3a.hs view

file too large to diff

+ tests/examples/transform/LayoutIn3a.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutIn3b.hs view

file too large to diff

+ tests/examples/transform/LayoutIn3b.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutIn4.hs view

file too large to diff

+ tests/examples/transform/LayoutIn4.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutLet2.hs view

file too large to diff

+ tests/examples/transform/LayoutLet2.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutLet3.hs view

file too large to diff

+ tests/examples/transform/LayoutLet3.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutLet4.hs view

file too large to diff

+ tests/examples/transform/LayoutLet4.hs.expected view

file too large to diff

+ tests/examples/transform/LayoutLet5.hs view

file too large to diff

+ tests/examples/transform/LayoutLet5.hs.expected view

file too large to diff

+ tests/examples/transform/LetIn1.hs view

file too large to diff

+ tests/examples/transform/LetIn1.hs.expected view

file too large to diff

+ tests/examples/transform/LocToName.hs view

file too large to diff

+ tests/examples/transform/LocToName.hs.expected view

file too large to diff

+ tests/examples/transform/LocalDecls.hs view

file too large to diff

+ tests/examples/transform/LocalDecls.hs.expected view

file too large to diff

+ tests/examples/transform/LocalDecls2.hs view

file too large to diff

+ tests/examples/transform/LocalDecls2.hs.expected view

file too large to diff

+ tests/examples/transform/NormaliseLayout.hs view

file too large to diff

+ tests/examples/transform/NormaliseLayout.hs.expected view

file too large to diff

+ tests/examples/transform/Rename1.hs view

file too large to diff

+ tests/examples/transform/Rename1.hs.expected view

file too large to diff

+ tests/examples/transform/Rename2.hs view

file too large to diff

+ tests/examples/transform/Rename2.hs.expected view

file too large to diff

+ tests/examples/transform/RenameCase1.hs view

file too large to diff

+ tests/examples/transform/RenameCase1.hs.expected view

file too large to diff

+ tests/examples/transform/RenameCase2.hs view

file too large to diff

+ tests/examples/transform/RenameCase2.hs.expected view

file too large to diff

+ tests/examples/transform/RmDecl1.hs view

file too large to diff

+ tests/examples/transform/RmDecl1.hs.expected view

file too large to diff

+ tests/examples/transform/RmDecl2.hs view

file too large to diff

+ tests/examples/transform/RmDecl2.hs.expected view

file too large to diff

+ tests/examples/transform/RmDecl3.hs view

file too large to diff

+ tests/examples/transform/RmDecl3.hs.expected view

file too large to diff

+ tests/examples/transform/RmDecl4.hs view

file too large to diff

+ tests/examples/transform/RmDecl4.hs.expected view

file too large to diff

+ tests/examples/transform/RmDecl5.hs view

file too large to diff

+ tests/examples/transform/RmDecl5.hs.expected view

file too large to diff

+ tests/examples/transform/RmDecl6.hs view

file too large to diff

+ tests/examples/transform/RmDecl6.hs.expected view

file too large to diff

+ tests/examples/transform/RmDecl7.hs view

file too large to diff

+ tests/examples/transform/RmDecl7.hs.expected view

file too large to diff

+ tests/examples/transform/RmTypeSig1.hs view

file too large to diff

+ tests/examples/transform/RmTypeSig1.hs.expected view

file too large to diff

+ tests/examples/transform/RmTypeSig2.hs view

file too large to diff

+ tests/examples/transform/RmTypeSig2.hs.expected view

file too large to diff

+ tests/examples/transform/WhereIn3.hs view

file too large to diff

+ tests/examples/transform/WhereIn3.hs.expected view

file too large to diff

+ tests/examples/transform/WhereIn3a.hs view

file too large to diff

+ tests/examples/transform/WhereIn3a.hs.expected view

file too large to diff

+ tests/examples/transform/WhereIn4.hs view

file too large to diff

+ tests/examples/transform/WhereIn4.hs.expected view

file too large to diff