Wolfgang Jeltsch pushed to branch wip/jeltsch/system-io-uncovering at Glasgow Haskell Compiler / GHC
Commits:
-
15bd2bd8
by Wolfgang Jeltsch at 2026-02-25T16:55:06+02:00
-
70ce3d90
by Wolfgang Jeltsch at 2026-02-25T16:55:40+02:00
-
f942818b
by Wolfgang Jeltsch at 2026-02-25T16:55:40+02:00
-
a666d58f
by Wolfgang Jeltsch at 2026-02-25T16:55:40+02:00
-
d549f9ea
by Wolfgang Jeltsch at 2026-02-25T16:55:40+02:00
19 changed files:
- libraries/base/src/Control/Monad/Fix.hs
- libraries/base/src/Data/String.hs
- libraries/base/src/GHC/ResponseFile.hs
- libraries/base/src/Prelude.hs
- libraries/ghc-heap/GHC/Exts/Heap/Closures.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Control/Monad/Fix.hs
- libraries/ghc-internal/src/GHC/Internal/Data/String.hs
- libraries/ghc-internal/src/GHC/Internal/Heap/Closures.hs
- − libraries/ghc-internal/src/GHC/Internal/ResponseFile.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- testsuite/tests/plugins/plugins10.stdout
- testsuite/tests/typecheck/should_fail/T12921.stderr
Changes:
| ... | ... | @@ -119,3 +119,9 @@ module Control.Monad.Fix |
| 119 | 119 | ) where
|
| 120 | 120 | |
| 121 | 121 | import GHC.Internal.Control.Monad.Fix
|
| 122 | + |
|
| 123 | +import GHC.Internal.System.IO
|
|
| 124 | + |
|
| 125 | +-- | @since base-2.01
|
|
| 126 | +instance MonadFix IO where
|
|
| 127 | + mfix = fixIO |
| 1 | -{-# LANGUAGE Safe #-}
|
|
| 1 | +{-# LANGUAGE Trustworthy #-}
|
|
| 2 | + |
|
| 3 | +{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
|
| 4 | +{-# LANGUAGE PolyKinds #-}
|
|
| 5 | +{-# LANGUAGE StandaloneDeriving #-}
|
|
| 2 | 6 | |
| 3 | 7 | -- |
|
| 4 | 8 | --
|
| ... | ... | @@ -23,4 +27,13 @@ module Data.String |
| 23 | 27 | unwords
|
| 24 | 28 | ) where
|
| 25 | 29 | |
| 26 | -import GHC.Internal.Data.String |
|
| \ No newline at end of file | ||
| 30 | +import GHC.Internal.Data.String
|
|
| 31 | + |
|
| 32 | +import GHC.Internal.Data.Functor.Const (Const (Const))
|
|
| 33 | +import GHC.Internal.Data.Functor.Identity (Identity (Identity))
|
|
| 34 | + |
|
| 35 | +-- | @since base-4.9.0.0
|
|
| 36 | +deriving instance IsString a => IsString (Const a (b :: k))
|
|
| 37 | + |
|
| 38 | +-- | @since base-4.9.0.0
|
|
| 39 | +deriving instance IsString a => IsString (Identity a) |
| 1 | -{-# LANGUAGE Safe #-}
|
|
| 1 | +{-# LANGUAGE ScopedTypeVariables #-}
|
|
| 2 | +{-# LANGUAGE Trustworthy #-}
|
|
| 2 | 3 | |
| 3 | 4 | -- |
|
| 4 | 5 | -- Module : GHC.ResponseFile
|
| ... | ... | @@ -19,4 +20,140 @@ module GHC.ResponseFile ( |
| 19 | 20 | expandResponse
|
| 20 | 21 | ) where
|
| 21 | 22 | |
| 22 | -import GHC.Internal.ResponseFile |
|
| 23 | +import GHC.Internal.Control.Exception
|
|
| 24 | +import GHC.Internal.Data.Foldable (Foldable(..))
|
|
| 25 | +import GHC.Internal.Base
|
|
| 26 | +import GHC.Internal.Unicode (isSpace)
|
|
| 27 | +import GHC.Internal.Data.List (filter, unlines, concat, reverse)
|
|
| 28 | +import GHC.Internal.Text.Show (show)
|
|
| 29 | +import GHC.Internal.System.Environment (getArgs)
|
|
| 30 | +import GHC.Internal.System.Exit (exitFailure)
|
|
| 31 | +import GHC.Internal.System.IO
|
|
| 32 | + |
|
| 33 | +{-|
|
|
| 34 | +Like 'getArgs', but can also read arguments supplied via response files.
|
|
| 35 | + |
|
| 36 | + |
|
| 37 | +For example, consider a program @foo@:
|
|
| 38 | + |
|
| 39 | +@
|
|
| 40 | +main :: IO ()
|
|
| 41 | +main = do
|
|
| 42 | + args <- getArgsWithResponseFiles
|
|
| 43 | + putStrLn (show args)
|
|
| 44 | +@
|
|
| 45 | + |
|
| 46 | + |
|
| 47 | +And a response file @args.txt@:
|
|
| 48 | + |
|
| 49 | +@
|
|
| 50 | +--one 1
|
|
| 51 | +--\'two\' 2
|
|
| 52 | +--"three" 3
|
|
| 53 | +@
|
|
| 54 | + |
|
| 55 | +Then the result of invoking @foo@ with @args.txt@ is:
|
|
| 56 | + |
|
| 57 | +> > ./foo @args.txt
|
|
| 58 | +> ["--one","1","--two","2","--three","3"]
|
|
| 59 | + |
|
| 60 | +-}
|
|
| 61 | +getArgsWithResponseFiles :: IO [String]
|
|
| 62 | +getArgsWithResponseFiles = getArgs >>= expandResponse
|
|
| 63 | + |
|
| 64 | +-- | Given a string of concatenated strings, separate each by removing
|
|
| 65 | +-- a layer of /quoting/ and\/or /escaping/ of certain characters.
|
|
| 66 | +--
|
|
| 67 | +-- These characters are: any whitespace, single quote, double quote,
|
|
| 68 | +-- and the backslash character. The backslash character always
|
|
| 69 | +-- escapes (i.e., passes through without further consideration) the
|
|
| 70 | +-- character which follows. Characters can also be escaped in blocks
|
|
| 71 | +-- by quoting (i.e., surrounding the blocks with matching pairs of
|
|
| 72 | +-- either single- or double-quotes which are not themselves escaped).
|
|
| 73 | +--
|
|
| 74 | +-- Any whitespace which appears outside of either of the quoting and
|
|
| 75 | +-- escaping mechanisms, is interpreted as having been added by this
|
|
| 76 | +-- special concatenation process to designate where the boundaries
|
|
| 77 | +-- are between the original, un-concatenated list of strings. These
|
|
| 78 | +-- added whitespace characters are removed from the output.
|
|
| 79 | +--
|
|
| 80 | +-- > unescapeArgs "hello\\ \\\"world\\\"\n" == ["hello \"world\""]
|
|
| 81 | +unescapeArgs :: String -> [String]
|
|
| 82 | +unescapeArgs = filter (not . null) . unescape
|
|
| 83 | + |
|
| 84 | +-- | Given a list of strings, concatenate them into a single string
|
|
| 85 | +-- with escaping of certain characters, and the addition of a newline
|
|
| 86 | +-- between each string. The escaping is done by adding a single
|
|
| 87 | +-- backslash character before any whitespace, single quote, double
|
|
| 88 | +-- quote, or backslash character, so this escaping character must be
|
|
| 89 | +-- removed. Unescaped whitespace (in this case, newline) is part
|
|
| 90 | +-- of this "transport" format to indicate the end of the previous
|
|
| 91 | +-- string and the start of a new string.
|
|
| 92 | +--
|
|
| 93 | +-- While 'unescapeArgs' allows using quoting (i.e., convenient
|
|
| 94 | +-- escaping of many characters) by having matching sets of single- or
|
|
| 95 | +-- double-quotes,'escapeArgs' does not use the quoting mechanism,
|
|
| 96 | +-- and thus will always escape any whitespace, quotes, and
|
|
| 97 | +-- backslashes.
|
|
| 98 | +--
|
|
| 99 | +-- > escapeArgs ["hello \"world\""] == "hello\\ \\\"world\\\"\n"
|
|
| 100 | +escapeArgs :: [String] -> String
|
|
| 101 | +escapeArgs = unlines . map escapeArg
|
|
| 102 | + |
|
| 103 | +-- | Arguments which look like @\@foo@ will be replaced with the
|
|
| 104 | +-- contents of file @foo@. A gcc-like syntax for response files arguments
|
|
| 105 | +-- is expected. This must re-constitute the argument list by doing an
|
|
| 106 | +-- inverse of the escaping mechanism done by the calling-program side.
|
|
| 107 | +--
|
|
| 108 | +-- We quit if the file is not found or reading somehow fails.
|
|
| 109 | +-- (A convenience routine for haddock or possibly other clients)
|
|
| 110 | +expandResponse :: [String] -> IO [String]
|
|
| 111 | +expandResponse = fmap concat . mapM expand
|
|
| 112 | + where
|
|
| 113 | + expand :: String -> IO [String]
|
|
| 114 | + expand ('@':f) = readFileExc f >>= return . unescapeArgs
|
|
| 115 | + expand x = return [x]
|
|
| 116 | + |
|
| 117 | + readFileExc f =
|
|
| 118 | + readFile f `catch` \(e :: IOException) -> do
|
|
| 119 | + hPutStrLn stderr $ "Error while expanding response file: " ++ show e
|
|
| 120 | + exitFailure
|
|
| 121 | + |
|
| 122 | +data Quoting = NoneQ | SngQ | DblQ
|
|
| 123 | + |
|
| 124 | +unescape :: String -> [String]
|
|
| 125 | +unescape args = reverse . map reverse $ go args NoneQ False [] []
|
|
| 126 | + where
|
|
| 127 | + -- n.b., the order of these cases matters; these are cribbed from gcc
|
|
| 128 | + -- case 1: end of input
|
|
| 129 | + go [] _q _bs a as = a:as
|
|
| 130 | + -- case 2: back-slash escape in progress
|
|
| 131 | + go (c:cs) q True a as = go cs q False (c:a) as
|
|
| 132 | + -- case 3: no back-slash escape in progress, but got a back-slash
|
|
| 133 | + go (c:cs) q False a as
|
|
| 134 | + | '\\' == c = go cs q True a as
|
|
| 135 | + -- case 4: single-quote escaping in progress
|
|
| 136 | + go (c:cs) SngQ False a as
|
|
| 137 | + | '\'' == c = go cs NoneQ False a as
|
|
| 138 | + | otherwise = go cs SngQ False (c:a) as
|
|
| 139 | + -- case 5: double-quote escaping in progress
|
|
| 140 | + go (c:cs) DblQ False a as
|
|
| 141 | + | '"' == c = go cs NoneQ False a as
|
|
| 142 | + | otherwise = go cs DblQ False (c:a) as
|
|
| 143 | + -- case 6: no escaping is in progress
|
|
| 144 | + go (c:cs) NoneQ False a as
|
|
| 145 | + | isSpace c = go cs NoneQ False [] (a:as)
|
|
| 146 | + | '\'' == c = go cs SngQ False a as
|
|
| 147 | + | '"' == c = go cs DblQ False a as
|
|
| 148 | + | otherwise = go cs NoneQ False (c:a) as
|
|
| 149 | + |
|
| 150 | +escapeArg :: String -> String
|
|
| 151 | +escapeArg = reverse . foldl' escape []
|
|
| 152 | + |
|
| 153 | +escape :: String -> Char -> String
|
|
| 154 | +escape cs c
|
|
| 155 | + | isSpace c
|
|
| 156 | + || '\\' == c
|
|
| 157 | + || '\'' == c
|
|
| 158 | + || '"' == c = c:'\\':cs -- n.b., our caller must reverse the result
|
|
| 159 | + | otherwise = c:cs |
| ... | ... | @@ -183,3 +183,5 @@ import GHC.Internal.Num |
| 183 | 183 | import GHC.Internal.Real
|
| 184 | 184 | import GHC.Internal.Float
|
| 185 | 185 | import GHC.Internal.Show
|
| 186 | + |
|
| 187 | +import Control.Monad.Fix () |
| 1 | 1 | {-# LANGUAGE CPP #-}
|
| 2 | -{-# LANGUAGE ForeignFunctionInterface #-}
|
|
| 3 | -{-# LANGUAGE GHCForeignImportPrim #-}
|
|
| 4 | -{-# LANGUAGE MagicHash #-}
|
|
| 5 | -{-# LANGUAGE RecordWildCards #-}
|
|
| 6 | -{-# LANGUAGE UnliftedFFITypes #-}
|
|
| 7 | -{-# LANGUAGE DeriveGeneric #-}
|
|
| 2 | +{-# LANGUAGE StandaloneDeriving #-}
|
|
| 8 | 3 | {-# LANGUAGE DeriveTraversable #-}
|
| 9 | 4 | -- Late cost centres introduce a thunk in the asBox function, which leads to
|
| 10 | 5 | -- an additional wrapper being added to any value placed inside a box.
|
| ... | ... | @@ -42,3 +37,23 @@ module GHC.Exts.Heap.Closures ( |
| 42 | 37 | ) where
|
| 43 | 38 | |
| 44 | 39 | import GHC.Internal.Heap.Closures
|
| 40 | + |
|
| 41 | +import GHC.Internal.Data.Functor
|
|
| 42 | +import GHC.Internal.Data.Foldable
|
|
| 43 | +import GHC.Internal.Data.Traversable
|
|
| 44 | + |
|
| 45 | +deriving instance Functor GenClosure
|
|
| 46 | +deriving instance Foldable GenClosure
|
|
| 47 | +deriving instance Traversable GenClosure
|
|
| 48 | + |
|
| 49 | +deriving instance Functor GenStgStackClosure
|
|
| 50 | +deriving instance Foldable GenStgStackClosure
|
|
| 51 | +deriving instance Traversable GenStgStackClosure
|
|
| 52 | + |
|
| 53 | +deriving instance Functor GenStackField
|
|
| 54 | +deriving instance Foldable GenStackField
|
|
| 55 | +deriving instance Traversable GenStackField
|
|
| 56 | + |
|
| 57 | +deriving instance Functor GenStackFrame
|
|
| 58 | +deriving instance Foldable GenStackFrame
|
|
| 59 | +deriving instance Traversable GenStackFrame |
| ... | ... | @@ -284,7 +284,6 @@ Library |
| 284 | 284 | GHC.Internal.Read
|
| 285 | 285 | GHC.Internal.Real
|
| 286 | 286 | GHC.Internal.Records
|
| 287 | - GHC.Internal.ResponseFile
|
|
| 288 | 287 | GHC.Internal.RTS.Flags
|
| 289 | 288 | GHC.Internal.RTS.Flags.Test
|
| 290 | 289 | GHC.Internal.ST
|
| ... | ... | @@ -39,7 +39,6 @@ import GHC.Internal.Base ( Monad, errorWithoutStackTrace, (.) ) |
| 39 | 39 | import GHC.Internal.Generics
|
| 40 | 40 | import GHC.Internal.List ( head, drop )
|
| 41 | 41 | import GHC.Internal.Control.Monad.ST.Imp
|
| 42 | -import GHC.Internal.System.IO
|
|
| 43 | 42 | |
| 44 | 43 | -- | Monads having fixed points with a \'knot-tying\' semantics.
|
| 45 | 44 | -- Instances of 'MonadFix' should satisfy the following laws:
|
| ... | ... | @@ -98,10 +97,6 @@ instance MonadFix NonEmpty where |
| 98 | 97 | neHead ~(a :| _) = a
|
| 99 | 98 | neTail ~(_ :| as) = as
|
| 100 | 99 | |
| 101 | --- | @since base-2.01
|
|
| 102 | -instance MonadFix IO where
|
|
| 103 | - mfix = fixIO
|
|
| 104 | - |
|
| 105 | 100 | -- | @since base-2.01
|
| 106 | 101 | instance MonadFix ((->) r) where
|
| 107 | 102 | mfix f = \ r -> let a = f a r in a
|
| 1 | 1 | {-# LANGUAGE FlexibleInstances #-}
|
| 2 | -{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
|
| 3 | 2 | {-# LANGUAGE NoImplicitPrelude #-}
|
| 4 | -{-# LANGUAGE PolyKinds #-}
|
|
| 5 | -{-# LANGUAGE StandaloneDeriving #-}
|
|
| 6 | 3 | {-# LANGUAGE Trustworthy #-}
|
| 7 | 4 | {-# LANGUAGE TypeFamilies #-}
|
| 8 | 5 | {-# LANGUAGE TypeOperators #-}
|
| ... | ... | @@ -33,8 +30,6 @@ module GHC.Internal.Data.String ( |
| 33 | 30 | ) where
|
| 34 | 31 | |
| 35 | 32 | import GHC.Internal.Base
|
| 36 | -import GHC.Internal.Data.Functor.Const (Const (Const))
|
|
| 37 | -import GHC.Internal.Data.Functor.Identity (Identity (Identity))
|
|
| 38 | 33 | import GHC.Internal.Data.List (lines, words, unlines, unwords)
|
| 39 | 34 | |
| 40 | 35 | -- | `IsString` is used in combination with the @-XOverloadedStrings@
|
| ... | ... | @@ -105,9 +100,3 @@ ensure the good behavior of the above example remains in the future. |
| 105 | 100 | instance (a ~ Char) => IsString [a] where
|
| 106 | 101 | -- See Note [IsString String]
|
| 107 | 102 | fromString xs = xs |
| 108 | - |
|
| 109 | --- | @since base-4.9.0.0
|
|
| 110 | -deriving instance IsString a => IsString (Const a (b :: k))
|
|
| 111 | - |
|
| 112 | --- | @since base-4.9.0.0
|
|
| 113 | -deriving instance IsString a => IsString (Identity a) |
| ... | ... | @@ -5,7 +5,6 @@ |
| 5 | 5 | {-# LANGUAGE RecordWildCards #-}
|
| 6 | 6 | {-# LANGUAGE UnliftedFFITypes #-}
|
| 7 | 7 | {-# LANGUAGE DeriveGeneric #-}
|
| 8 | -{-# LANGUAGE DeriveTraversable #-}
|
|
| 9 | 8 | -- Late cost centres introduce a thunk in the asBox function, which leads to
|
| 10 | 9 | -- an additional wrapper being added to any value placed inside a box.
|
| 11 | 10 | -- This can be removed once our boot compiler is no longer affected by #25212
|
| ... | ... | @@ -69,8 +68,7 @@ in the profiling way. (#15197) |
| 69 | 68 | import GHC.Internal.Heap.ProfInfo.Types
|
| 70 | 69 | |
| 71 | 70 | import GHC.Internal.Data.Bits
|
| 72 | -import GHC.Internal.Data.Foldable (Foldable, toList)
|
|
| 73 | -import GHC.Internal.Data.Traversable (Traversable)
|
|
| 71 | +import GHC.Internal.Data.Foldable (toList)
|
|
| 74 | 72 | import GHC.Internal.Int
|
| 75 | 73 | import GHC.Internal.Num
|
| 76 | 74 | import GHC.Internal.Real
|
| ... | ... | @@ -383,7 +381,7 @@ data GenClosure b |
| 383 | 381 | -- or an Int#).
|
| 384 | 382 | | UnknownTypeWordSizedPrimitive
|
| 385 | 383 | { wordVal :: !Word }
|
| 386 | - deriving (Show, Generic, Functor, Foldable, Traversable)
|
|
| 384 | + deriving (Show, Generic)
|
|
| 387 | 385 | |
| 388 | 386 | -- | Get the info table for a heap closure, or Nothing for a prim value
|
| 389 | 387 | --
|
| ... | ... | @@ -500,7 +498,7 @@ data GenStgStackClosure b = GenStgStackClosure |
| 500 | 498 | , ssc_stack_size :: !Word32 -- ^ stack size in *words*
|
| 501 | 499 | , ssc_stack :: ![GenStackFrame b]
|
| 502 | 500 | }
|
| 503 | - deriving (Foldable, Functor, Generic, Show, Traversable)
|
|
| 501 | + deriving (Generic, Show)
|
|
| 504 | 502 | |
| 505 | 503 | type StackField = GenStackField Box
|
| 506 | 504 | |
| ... | ... | @@ -510,7 +508,7 @@ data GenStackField b |
| 510 | 508 | = StackWord !Word
|
| 511 | 509 | -- | A pointer field
|
| 512 | 510 | | StackBox !b
|
| 513 | - deriving (Foldable, Functor, Generic, Show, Traversable)
|
|
| 511 | + deriving (Generic, Show)
|
|
| 514 | 512 | |
| 515 | 513 | type StackFrame = GenStackFrame Box
|
| 516 | 514 | |
| ... | ... | @@ -579,7 +577,7 @@ data GenStackFrame b = |
| 579 | 577 | { info_tbl :: !StgInfoTable
|
| 580 | 578 | , annotation :: !b
|
| 581 | 579 | }
|
| 582 | - deriving (Foldable, Functor, Generic, Show, Traversable)
|
|
| 580 | + deriving (Generic, Show)
|
|
| 583 | 581 | |
| 584 | 582 | data PrimType
|
| 585 | 583 | = PInt
|
| 1 | -{-# LANGUAGE ScopedTypeVariables #-}
|
|
| 2 | -{-# LANGUAGE Trustworthy #-}
|
|
| 3 | - |
|
| 4 | ------------------------------------------------------------------------------
|
|
| 5 | --- |
|
|
| 6 | --- Module : GHC.Internal.ResponseFile
|
|
| 7 | --- License : BSD-style (see the file LICENSE)
|
|
| 8 | ---
|
|
| 9 | --- Maintainer : libraries@haskell.org
|
|
| 10 | --- Stability : internal
|
|
| 11 | --- Portability : portable
|
|
| 12 | ---
|
|
| 13 | --- GCC style response files.
|
|
| 14 | ---
|
|
| 15 | --- @since base-4.12.0.0
|
|
| 16 | -----------------------------------------------------------------------------
|
|
| 17 | - |
|
| 18 | --- Migrated from Haddock.
|
|
| 19 | - |
|
| 20 | -module GHC.Internal.ResponseFile (
|
|
| 21 | - getArgsWithResponseFiles,
|
|
| 22 | - unescapeArgs,
|
|
| 23 | - escapeArgs, escapeArg,
|
|
| 24 | - expandResponse
|
|
| 25 | - ) where
|
|
| 26 | - |
|
| 27 | -import GHC.Internal.Control.Exception
|
|
| 28 | -import GHC.Internal.Data.Foldable (Foldable(..))
|
|
| 29 | -import GHC.Internal.Base
|
|
| 30 | -import GHC.Internal.Unicode (isSpace)
|
|
| 31 | -import GHC.Internal.Data.List (filter, unlines, concat, reverse)
|
|
| 32 | -import GHC.Internal.Text.Show (show)
|
|
| 33 | -import GHC.Internal.System.Environment (getArgs)
|
|
| 34 | -import GHC.Internal.System.Exit (exitFailure)
|
|
| 35 | -import GHC.Internal.System.IO
|
|
| 36 | - |
|
| 37 | -{-|
|
|
| 38 | -Like 'getArgs', but can also read arguments supplied via response files.
|
|
| 39 | - |
|
| 40 | - |
|
| 41 | -For example, consider a program @foo@:
|
|
| 42 | - |
|
| 43 | -@
|
|
| 44 | -main :: IO ()
|
|
| 45 | -main = do
|
|
| 46 | - args <- getArgsWithResponseFiles
|
|
| 47 | - putStrLn (show args)
|
|
| 48 | -@
|
|
| 49 | - |
|
| 50 | - |
|
| 51 | -And a response file @args.txt@:
|
|
| 52 | - |
|
| 53 | -@
|
|
| 54 | ---one 1
|
|
| 55 | ---\'two\' 2
|
|
| 56 | ---"three" 3
|
|
| 57 | -@
|
|
| 58 | - |
|
| 59 | -Then the result of invoking @foo@ with @args.txt@ is:
|
|
| 60 | - |
|
| 61 | -> > ./foo @args.txt
|
|
| 62 | -> ["--one","1","--two","2","--three","3"]
|
|
| 63 | - |
|
| 64 | --}
|
|
| 65 | -getArgsWithResponseFiles :: IO [String]
|
|
| 66 | -getArgsWithResponseFiles = getArgs >>= expandResponse
|
|
| 67 | - |
|
| 68 | --- | Given a string of concatenated strings, separate each by removing
|
|
| 69 | --- a layer of /quoting/ and\/or /escaping/ of certain characters.
|
|
| 70 | ---
|
|
| 71 | --- These characters are: any whitespace, single quote, double quote,
|
|
| 72 | --- and the backslash character. The backslash character always
|
|
| 73 | --- escapes (i.e., passes through without further consideration) the
|
|
| 74 | --- character which follows. Characters can also be escaped in blocks
|
|
| 75 | --- by quoting (i.e., surrounding the blocks with matching pairs of
|
|
| 76 | --- either single- or double-quotes which are not themselves escaped).
|
|
| 77 | ---
|
|
| 78 | --- Any whitespace which appears outside of either of the quoting and
|
|
| 79 | --- escaping mechanisms, is interpreted as having been added by this
|
|
| 80 | --- special concatenation process to designate where the boundaries
|
|
| 81 | --- are between the original, un-concatenated list of strings. These
|
|
| 82 | --- added whitespace characters are removed from the output.
|
|
| 83 | ---
|
|
| 84 | --- > unescapeArgs "hello\\ \\\"world\\\"\n" == ["hello \"world\""]
|
|
| 85 | -unescapeArgs :: String -> [String]
|
|
| 86 | -unescapeArgs = filter (not . null) . unescape
|
|
| 87 | - |
|
| 88 | --- | Given a list of strings, concatenate them into a single string
|
|
| 89 | --- with escaping of certain characters, and the addition of a newline
|
|
| 90 | --- between each string. The escaping is done by adding a single
|
|
| 91 | --- backslash character before any whitespace, single quote, double
|
|
| 92 | --- quote, or backslash character, so this escaping character must be
|
|
| 93 | --- removed. Unescaped whitespace (in this case, newline) is part
|
|
| 94 | --- of this "transport" format to indicate the end of the previous
|
|
| 95 | --- string and the start of a new string.
|
|
| 96 | ---
|
|
| 97 | --- While 'unescapeArgs' allows using quoting (i.e., convenient
|
|
| 98 | --- escaping of many characters) by having matching sets of single- or
|
|
| 99 | --- double-quotes,'escapeArgs' does not use the quoting mechanism,
|
|
| 100 | --- and thus will always escape any whitespace, quotes, and
|
|
| 101 | --- backslashes.
|
|
| 102 | ---
|
|
| 103 | --- > escapeArgs ["hello \"world\""] == "hello\\ \\\"world\\\"\n"
|
|
| 104 | -escapeArgs :: [String] -> String
|
|
| 105 | -escapeArgs = unlines . map escapeArg
|
|
| 106 | - |
|
| 107 | --- | Arguments which look like @\@foo@ will be replaced with the
|
|
| 108 | --- contents of file @foo@. A gcc-like syntax for response files arguments
|
|
| 109 | --- is expected. This must re-constitute the argument list by doing an
|
|
| 110 | --- inverse of the escaping mechanism done by the calling-program side.
|
|
| 111 | ---
|
|
| 112 | --- We quit if the file is not found or reading somehow fails.
|
|
| 113 | --- (A convenience routine for haddock or possibly other clients)
|
|
| 114 | -expandResponse :: [String] -> IO [String]
|
|
| 115 | -expandResponse = fmap concat . mapM expand
|
|
| 116 | - where
|
|
| 117 | - expand :: String -> IO [String]
|
|
| 118 | - expand ('@':f) = readFileExc f >>= return . unescapeArgs
|
|
| 119 | - expand x = return [x]
|
|
| 120 | - |
|
| 121 | - readFileExc f =
|
|
| 122 | - readFile f `catch` \(e :: IOException) -> do
|
|
| 123 | - hPutStrLn stderr $ "Error while expanding response file: " ++ show e
|
|
| 124 | - exitFailure
|
|
| 125 | - |
|
| 126 | -data Quoting = NoneQ | SngQ | DblQ
|
|
| 127 | - |
|
| 128 | -unescape :: String -> [String]
|
|
| 129 | -unescape args = reverse . map reverse $ go args NoneQ False [] []
|
|
| 130 | - where
|
|
| 131 | - -- n.b., the order of these cases matters; these are cribbed from gcc
|
|
| 132 | - -- case 1: end of input
|
|
| 133 | - go [] _q _bs a as = a:as
|
|
| 134 | - -- case 2: back-slash escape in progress
|
|
| 135 | - go (c:cs) q True a as = go cs q False (c:a) as
|
|
| 136 | - -- case 3: no back-slash escape in progress, but got a back-slash
|
|
| 137 | - go (c:cs) q False a as
|
|
| 138 | - | '\\' == c = go cs q True a as
|
|
| 139 | - -- case 4: single-quote escaping in progress
|
|
| 140 | - go (c:cs) SngQ False a as
|
|
| 141 | - | '\'' == c = go cs NoneQ False a as
|
|
| 142 | - | otherwise = go cs SngQ False (c:a) as
|
|
| 143 | - -- case 5: double-quote escaping in progress
|
|
| 144 | - go (c:cs) DblQ False a as
|
|
| 145 | - | '"' == c = go cs NoneQ False a as
|
|
| 146 | - | otherwise = go cs DblQ False (c:a) as
|
|
| 147 | - -- case 6: no escaping is in progress
|
|
| 148 | - go (c:cs) NoneQ False a as
|
|
| 149 | - | isSpace c = go cs NoneQ False [] (a:as)
|
|
| 150 | - | '\'' == c = go cs SngQ False a as
|
|
| 151 | - | '"' == c = go cs DblQ False a as
|
|
| 152 | - | otherwise = go cs NoneQ False (c:a) as
|
|
| 153 | - |
|
| 154 | -escapeArg :: String -> String
|
|
| 155 | -escapeArg = reverse . foldl' escape []
|
|
| 156 | - |
|
| 157 | -escape :: String -> Char -> String
|
|
| 158 | -escape cs c
|
|
| 159 | - | isSpace c
|
|
| 160 | - || '\\' == c
|
|
| 161 | - || '\'' == c
|
|
| 162 | - || '"' == c = c:'\\':cs -- n.b., our caller must reverse the result
|
|
| 163 | - | otherwise = c:cs |
| ... | ... | @@ -32,7 +32,6 @@ import Control.Monad.Fix (MonadFix (..)) |
| 32 | 32 | import Control.Exception (BlockedIndefinitelyOnMVar (..), catch, throwIO)
|
| 33 | 33 | import Control.Exception.Base (FixIOException (..))
|
| 34 | 34 | import Control.Concurrent.MVar (newEmptyMVar, readMVar, putMVar)
|
| 35 | -import System.IO ( hPutStrLn, stderr )
|
|
| 36 | 35 | import qualified Data.Kind as Kind (Type)
|
| 37 | 36 | import GHC.IO.Unsafe ( unsafeDupableInterleaveIO )
|
| 38 | 37 | import GHC.Types (TYPE, RuntimeRep(..))
|
| ... | ... | @@ -41,7 +40,6 @@ import GHC.Internal.Base hiding (NonEmpty(..),Type, Module, sequence) |
| 41 | 40 | import GHC.Internal.Data.Data hiding (Fixity(..))
|
| 42 | 41 | import GHC.Internal.Data.Traversable
|
| 43 | 42 | import GHC.Internal.IORef
|
| 44 | -import GHC.Internal.System.IO
|
|
| 45 | 43 | import GHC.Internal.Data.Foldable
|
| 46 | 44 | import GHC.Internal.Data.Typeable
|
| 47 | 45 | import GHC.Internal.Control.Monad.IO.Class
|
| ... | ... | @@ -54,6 +52,10 @@ import GHC.Internal.MVar |
| 54 | 52 | import GHC.Internal.IO.Exception
|
| 55 | 53 | import qualified GHC.Internal.Types as Kind (Type)
|
| 56 | 54 | #endif
|
| 55 | +import GHC.Internal.IO (FilePath)
|
|
| 56 | +import GHC.Internal.IO.Handle.Text (hPutStr, hPutStrLn)
|
|
| 57 | +import GHC.Internal.IO.IOMode (IOMode (WriteMode))
|
|
| 58 | +import GHC.Internal.IO.StdHandles (stderr, withFile)
|
|
| 57 | 59 | import GHC.Internal.ForeignSrcLang
|
| 58 | 60 | import GHC.Internal.LanguageExtensions
|
| 59 | 61 | import GHC.Internal.TH.Syntax
|
| ... | ... | @@ -875,6 +877,15 @@ addForeignSource lang src = do |
| 875 | 877 | path <- addTempFile suffix
|
| 876 | 878 | runIO $ writeFile path src
|
| 877 | 879 | addForeignFilePath lang path
|
| 880 | + where
|
|
| 881 | + |
|
| 882 | + {-
|
|
| 883 | + This is a copy of the implementation of 'System.IO.writeFile', which we
|
|
| 884 | + use to avoid forcing 'System.IO.writeFile' being implemented in
|
|
| 885 | + @ghc-internal@.
|
|
| 886 | + -}
|
|
| 887 | + writeFile :: FilePath -> String -> IO ()
|
|
| 888 | + writeFile f txt = withFile f WriteMode (\ hdl -> hPutStr hdl txt)
|
|
| 878 | 889 | |
| 879 | 890 | -- | Same as 'addForeignSource', but expects to receive a path pointing to the
|
| 880 | 891 | -- foreign file instead of a 'String' of its contents. Consider using this in
|
| ... | ... | @@ -1673,7 +1673,7 @@ module Data.Semigroup where |
| 1673 | 1673 | stimesMonoid :: forall b a. (GHC.Internal.Real.Integral b, GHC.Internal.Base.Monoid a) => b -> a -> a
|
| 1674 | 1674 | |
| 1675 | 1675 | module Data.String where
|
| 1676 | - -- Safety: Safe
|
|
| 1676 | + -- Safety: Trustworthy
|
|
| 1677 | 1677 | type IsString :: * -> Constraint
|
| 1678 | 1678 | class IsString a where
|
| 1679 | 1679 | fromString :: String -> a
|
| ... | ... | @@ -11544,6 +11544,7 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH |
| 11544 | 11544 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
|
| 11545 | 11545 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
|
| 11546 | 11546 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
|
| 11547 | +instance [safe] GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘Control.Monad.Fix’
|
|
| 11547 | 11548 | instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11548 | 11549 | instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11549 | 11550 | instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| ... | ... | @@ -11552,7 +11553,6 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Int |
| 11552 | 11553 | instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Either.Either e) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11553 | 11554 | instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11554 | 11555 | instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11555 | -instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
|
| 11556 | 11556 | instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11557 | 11557 | instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11558 | 11558 | instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| ... | ... | @@ -11778,8 +11778,8 @@ instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.First -- Defined in |
| 11778 | 11778 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
|
| 11779 | 11779 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Max -- Defined in ‘Data.Semigroup’
|
| 11780 | 11780 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Min -- Defined in ‘Data.Semigroup’
|
| 11781 | -instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11782 | -instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11781 | +instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘Data.String’
|
|
| 11782 | +instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘Data.String’
|
|
| 11783 | 11783 | instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
|
| 11784 | 11784 | instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
|
| 11785 | 11785 | instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Traversable’
|
| ... | ... | @@ -1673,7 +1673,7 @@ module Data.Semigroup where |
| 1673 | 1673 | stimesMonoid :: forall b a. (GHC.Internal.Real.Integral b, GHC.Internal.Base.Monoid a) => b -> a -> a
|
| 1674 | 1674 | |
| 1675 | 1675 | module Data.String where
|
| 1676 | - -- Safety: Safe
|
|
| 1676 | + -- Safety: Trustworthy
|
|
| 1677 | 1677 | type IsString :: * -> Constraint
|
| 1678 | 1678 | class IsString a where
|
| 1679 | 1679 | fromString :: String -> a
|
| ... | ... | @@ -11571,6 +11571,7 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH |
| 11571 | 11571 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
|
| 11572 | 11572 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
|
| 11573 | 11573 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
|
| 11574 | +instance [safe] GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘Control.Monad.Fix’
|
|
| 11574 | 11575 | instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11575 | 11576 | instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11576 | 11577 | instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| ... | ... | @@ -11579,7 +11580,6 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Int |
| 11579 | 11580 | instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Either.Either e) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11580 | 11581 | instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11581 | 11582 | instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11582 | -instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
|
| 11583 | 11583 | instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11584 | 11584 | instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11585 | 11585 | instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| ... | ... | @@ -11805,8 +11805,8 @@ instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.First -- Defined in |
| 11805 | 11805 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
|
| 11806 | 11806 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Max -- Defined in ‘Data.Semigroup’
|
| 11807 | 11807 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Min -- Defined in ‘Data.Semigroup’
|
| 11808 | -instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11809 | -instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11808 | +instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘Data.String’
|
|
| 11809 | +instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘Data.String’
|
|
| 11810 | 11810 | instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
|
| 11811 | 11811 | instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
|
| 11812 | 11812 | instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Traversable’
|
| ... | ... | @@ -1673,7 +1673,7 @@ module Data.Semigroup where |
| 1673 | 1673 | stimesMonoid :: forall b a. (GHC.Internal.Real.Integral b, GHC.Internal.Base.Monoid a) => b -> a -> a
|
| 1674 | 1674 | |
| 1675 | 1675 | module Data.String where
|
| 1676 | - -- Safety: Safe
|
|
| 1676 | + -- Safety: Trustworthy
|
|
| 1677 | 1677 | type IsString :: * -> Constraint
|
| 1678 | 1678 | class IsString a where
|
| 1679 | 1679 | fromString :: String -> a
|
| ... | ... | @@ -11802,6 +11802,7 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH |
| 11802 | 11802 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
|
| 11803 | 11803 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
|
| 11804 | 11804 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
|
| 11805 | +instance [safe] GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘Control.Monad.Fix’
|
|
| 11805 | 11806 | instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11806 | 11807 | instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11807 | 11808 | instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| ... | ... | @@ -11810,7 +11811,6 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Int |
| 11810 | 11811 | instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Either.Either e) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11811 | 11812 | instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11812 | 11813 | instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11813 | -instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
|
| 11814 | 11814 | instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11815 | 11815 | instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11816 | 11816 | instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| ... | ... | @@ -12036,8 +12036,8 @@ instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.First -- Defined in |
| 12036 | 12036 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
|
| 12037 | 12037 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Max -- Defined in ‘Data.Semigroup’
|
| 12038 | 12038 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Min -- Defined in ‘Data.Semigroup’
|
| 12039 | -instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 12040 | -instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 12039 | +instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘Data.String’
|
|
| 12040 | +instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘Data.String’
|
|
| 12041 | 12041 | instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
|
| 12042 | 12042 | instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
|
| 12043 | 12043 | instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Traversable’
|
| ... | ... | @@ -1673,7 +1673,7 @@ module Data.Semigroup where |
| 1673 | 1673 | stimesMonoid :: forall b a. (GHC.Internal.Real.Integral b, GHC.Internal.Base.Monoid a) => b -> a -> a
|
| 1674 | 1674 | |
| 1675 | 1675 | module Data.String where
|
| 1676 | - -- Safety: Safe
|
|
| 1676 | + -- Safety: Trustworthy
|
|
| 1677 | 1677 | type IsString :: * -> Constraint
|
| 1678 | 1678 | class IsString a where
|
| 1679 | 1679 | fromString :: String -> a
|
| ... | ... | @@ -11544,6 +11544,7 @@ instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fail.MonadFail f => GH |
| 11544 | 11544 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.P -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
|
| 11545 | 11545 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadP.ReadP -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadP’
|
| 11546 | 11546 | instance GHC.Internal.Control.Monad.Fail.MonadFail GHC.Internal.Text.ParserCombinators.ReadPrec.ReadPrec -- Defined in ‘GHC.Internal.Text.ParserCombinators.ReadPrec’
|
| 11547 | +instance [safe] GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘Control.Monad.Fix’
|
|
| 11547 | 11548 | instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Control.Monad.Fix.MonadFix f, GHC.Internal.Control.Monad.Fix.MonadFix g) => GHC.Internal.Control.Monad.Fix.MonadFix (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11548 | 11549 | instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Semigroup.Internal.Alt f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11549 | 11550 | instance forall (f :: * -> *). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Monoid.Ap f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| ... | ... | @@ -11552,7 +11553,6 @@ instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Semigroup.Int |
| 11552 | 11553 | instance forall e. GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Data.Either.Either e) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11553 | 11554 | instance forall r. GHC.Internal.Control.Monad.Fix.MonadFix ((->) r) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11554 | 11555 | instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.First -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11555 | -instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Types.IO -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
|
| 11556 | 11556 | instance GHC.Internal.Control.Monad.Fix.MonadFix GHC.Internal.Data.Monoid.Last -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11557 | 11557 | instance GHC.Internal.Control.Monad.Fix.MonadFix [] -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| 11558 | 11558 | instance forall (f :: * -> *) i (c :: GHC.Internal.Generics.Meta). GHC.Internal.Control.Monad.Fix.MonadFix f => GHC.Internal.Control.Monad.Fix.MonadFix (GHC.Internal.Generics.M1 i c f) -- Defined in ‘GHC.Internal.Control.Monad.Fix’
|
| ... | ... | @@ -11778,8 +11778,8 @@ instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.First -- Defined in |
| 11778 | 11778 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Last -- Defined in ‘Data.Semigroup’
|
| 11779 | 11779 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Max -- Defined in ‘Data.Semigroup’
|
| 11780 | 11780 | instance GHC.Internal.Data.Foldable.Foldable Data.Semigroup.Min -- Defined in ‘Data.Semigroup’
|
| 11781 | -instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11782 | -instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11781 | +instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘Data.String’
|
|
| 11782 | +instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘Data.String’
|
|
| 11783 | 11783 | instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
|
| 11784 | 11784 | instance GHC.Internal.Data.Traversable.Traversable GHC.Internal.Functor.ZipList.ZipList -- Defined in ‘GHC.Internal.Functor.ZipList’
|
| 11785 | 11785 | instance forall (f :: * -> *) (g :: * -> *). (GHC.Internal.Data.Traversable.Traversable f, GHC.Internal.Data.Traversable.Traversable g) => GHC.Internal.Data.Traversable.Traversable (f GHC.Internal.Generics.:*: g) -- Defined in ‘GHC.Internal.Data.Traversable’
|
| ... | ... | @@ -11188,8 +11188,6 @@ instance forall a. GHC.Internal.Classes.Ord (GHC.Internal.Ptr.FunPtr a) -- Defin |
| 11188 | 11188 | instance forall a. GHC.Internal.Classes.Ord (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’
|
| 11189 | 11189 | instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’
|
| 11190 | 11190 | instance GHC.Internal.Classes.Ord GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Base’
|
| 11191 | -instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11192 | -instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11193 | 11191 | instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
|
| 11194 | 11192 | instance forall a. GHC.Internal.Enum.Bounded a => GHC.Internal.Enum.Bounded (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
|
| 11195 | 11193 | instance forall a. (GHC.Internal.Enum.Enum a, GHC.Internal.Enum.Bounded a, GHC.Internal.Classes.Eq a) => GHC.Internal.Enum.Enum (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
|
| ... | ... | @@ -11191,8 +11191,6 @@ instance forall a. GHC.Internal.Classes.Ord (GHC.Internal.Ptr.FunPtr a) -- Defin |
| 11191 | 11191 | instance forall a. GHC.Internal.Classes.Ord (GHC.Internal.Ptr.Ptr a) -- Defined in ‘GHC.Internal.Ptr’
|
| 11192 | 11192 | instance forall a. GHC.Internal.Classes.Ord a => GHC.Internal.Classes.Ord (GHC.Internal.Base.NonEmpty a) -- Defined in ‘GHC.Internal.Base’
|
| 11193 | 11193 | instance GHC.Internal.Classes.Ord GHC.Internal.Base.Void -- Defined in ‘GHC.Internal.Base’
|
| 11194 | -instance forall a k (b :: k). GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Const.Const a b) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11195 | -instance forall a. GHC.Internal.Data.String.IsString a => GHC.Internal.Data.String.IsString (GHC.Internal.Data.Functor.Identity.Identity a) -- Defined in ‘GHC.Internal.Data.String’
|
|
| 11196 | 11194 | instance forall a. (a ~ GHC.Internal.Types.Char) => GHC.Internal.Data.String.IsString [a] -- Defined in ‘GHC.Internal.Data.String’
|
| 11197 | 11195 | instance forall a. GHC.Internal.Enum.Bounded a => GHC.Internal.Enum.Bounded (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
|
| 11198 | 11196 | instance forall a. (GHC.Internal.Enum.Enum a, GHC.Internal.Enum.Bounded a, GHC.Internal.Classes.Eq a) => GHC.Internal.Enum.Enum (GHC.Internal.Data.Ord.Down a) -- Defined in ‘GHC.Internal.Data.Ord’
|
| ... | ... | @@ -2,6 +2,7 @@ parsePlugin() |
| 2 | 2 | interfacePlugin: Prelude
|
| 3 | 3 | interfacePlugin: Language.Haskell.TH
|
| 4 | 4 | interfacePlugin: Language.Haskell.TH.Quote
|
| 5 | +interfacePlugin: Data.List
|
|
| 5 | 6 | interfacePlugin: GHC.Internal.Base
|
| 6 | 7 | interfacePlugin: GHC.Internal.Data.NonEmpty
|
| 7 | 8 | interfacePlugin: GHC.Internal.Float
|
| ... | ... | @@ -24,8 +24,6 @@ T12921.hs:4:16: error: [GHC-39999] |
| 24 | 24 | Potentially matching instance:
|
| 25 | 25 | instance (a ~ Char) => GHC.Internal.Data.String.IsString [a]
|
| 26 | 26 | -- Defined in ‘GHC.Internal.Data.String’
|
| 27 | - ...plus two instances involving out-of-scope types
|
|
| 28 | - (use -fprint-potential-instances to see them all)
|
|
| 29 | 27 | • In the annotation:
|
| 30 | 28 | {-# ANN module "HLint: ignore Reduce duplication" #-}
|
| 31 | 29 |