[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Show dynamic object files (#16062)
Marge Bot
gitlab at gitlab.haskell.org
Wed Apr 17 17:28:49 UTC 2019
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
57eb5bc6 by erthalion at 2019-04-16T19:40:36Z
Show dynamic object files (#16062)
Closes #16062. When -dynamic-too is specified, reflect that in the
progress message, like:
$ ghc Main.hs -dynamic-too
[1 of 1] Compiling Lib ( Main.hs, Main.o, Main.dyn_o )
instead of:
$ ghc Main.hs -dynamic-too
[1 of 1] Compiling Lib ( Main.hs, Main.o )
- - - - -
894ec447 by Andrey Mokhov at 2019-04-16T19:46:44Z
Hadrian: Generate GHC wrapper scripts
This is a temporary workaround for #16534. We generate wrapper scripts
<build-root>/ghc-stage1 and <build-root>/ghc-stage2 that can be used to
run Stage1 and Stage2 GHCs with the right arguments.
See https://gitlab.haskell.org/ghc/ghc/issues/16534.
- - - - -
1dea0fe6 by Sven Tennie at 2019-04-17T17:28:40Z
Typeset Big-O complexities with Tex-style notation (#16090)
E.g. use `\(\mathcal{O}(n^2)\)` instead of `/O(n^2)/`.
- - - - -
97a41cd9 by klebinger.andreas at gmx.at at 2019-04-17T17:28:42Z
Add an Outputable instance for SDoc with ppr = id.
When printf debugging this can be helpful.
- - - - -
17 changed files:
- compiler/main/DynFlags.hs
- compiler/main/HscTypes.hs
- compiler/utils/Outputable.hs
- hadrian/src/Rules.hs
- hadrian/src/Rules/Generate.hs
- libraries/base/Data/Foldable.hs
- libraries/base/Data/OldList.hs
- libraries/base/Data/Semigroup/Internal.hs
- libraries/base/GHC/Base.hs
- libraries/base/GHC/List.hs
- libraries/base/GHC/StableName.hs
- libraries/base/System/Mem/StableName.hs
- + testsuite/tests/driver/dynamicToo/dynamicToo006/Main.hs
- + testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile
- + testsuite/tests/driver/dynamicToo/dynamicToo006/all.T
- + testsuite/tests/driver/dynamicToo/dynamicToo006/dynamicToo006.stdout
- testsuite/tests/safeHaskell/safeInfered/UnsafeInfered02.stderr
Changes:
=====================================
compiler/main/DynFlags.hs
=====================================
@@ -41,6 +41,7 @@ module DynFlags (
whenGeneratingDynamicToo, ifGeneratingDynamicToo,
whenCannotGenerateDynamicToo,
dynamicTooMkDynamicDynFlags,
+ dynamicOutputFile,
DynFlags(..),
FlagSpec(..),
HasDynFlags(..), ContainsDynFlags(..),
@@ -1823,6 +1824,12 @@ dynamicTooMkDynamicDynFlags dflags0
dflags4 = gopt_unset dflags3 Opt_BuildDynamicToo
in dflags4
+-- | Compute the path of the dynamic object corresponding to an object file.
+dynamicOutputFile :: DynFlags -> FilePath -> FilePath
+dynamicOutputFile dflags outputFile = dynOut outputFile
+ where
+ dynOut = flip addExtension (dynObjectSuf dflags) . dropExtension
+
-----------------------------------------------------------------------------
-- | Used by 'GHC.runGhc' to partially initialize a new 'DynFlags' value
@@ -2772,11 +2779,11 @@ parseDynamicFlagsFull activeFlags cmdline dflags0 args = do
let chooseOutput
| isJust (outputFile dflags3) -- Only iff user specified -o ...
, not (isJust (dynOutputFile dflags3)) -- but not -dyno
- = return $ dflags3 { dynOutputFile = Just $ dynOut (fromJust $ outputFile dflags3) }
+ = return $ dflags3 { dynOutputFile = Just $ dynamicOutputFile dflags3 outFile }
| otherwise
= return dflags3
where
- dynOut = flip addExtension (dynObjectSuf dflags3) . dropExtension
+ outFile = fromJust $ outputFile dflags3
dflags4 <- ifGeneratingDynamicToo dflags3 chooseOutput (return dflags3)
let (dflags5, consistency_warnings) = makeDynFlagsConsistent dflags4
=====================================
compiler/main/HscTypes.hs
=====================================
@@ -2805,6 +2805,9 @@ msHsFilePath ms = expectJust "msHsFilePath" (ml_hs_file (ms_location ms))
msHiFilePath ms = ml_hi_file (ms_location ms)
msObjFilePath ms = ml_obj_file (ms_location ms)
+msDynObjFilePath :: ModSummary -> DynFlags -> FilePath
+msDynObjFilePath ms dflags = dynamicOutputFile dflags (msObjFilePath ms)
+
-- | Did this 'ModSummary' originate from a hs-boot file?
isBootSummary :: ModSummary -> Bool
isBootSummary ms = ms_hsc_src ms == HsBootFile
@@ -2824,20 +2827,26 @@ showModMsg :: DynFlags -> HscTarget -> Bool -> ModSummary -> String
showModMsg dflags target recomp mod_summary = showSDoc dflags $
if gopt Opt_HideSourcePaths dflags
then text mod_str
- else hsep
+ else hsep $
[ text (mod_str ++ replicate (max 0 (16 - length mod_str)) ' ')
, char '('
, text (op $ msHsFilePath mod_summary) <> char ','
- , case target of
- HscInterpreted | recomp -> text "interpreted"
- HscNothing -> text "nothing"
- _ -> text (op $ msObjFilePath mod_summary)
- , char ')'
- ]
+ ] ++
+ if gopt Opt_BuildDynamicToo dflags
+ then [ text obj_file <> char ','
+ , text dyn_file
+ , char ')'
+ ]
+ else [ text obj_file, char ')' ]
where
- op = normalise
- mod = moduleName (ms_mod mod_summary)
- mod_str = showPpr dflags mod ++ hscSourceString (ms_hsc_src mod_summary)
+ op = normalise
+ mod = moduleName (ms_mod mod_summary)
+ mod_str = showPpr dflags mod ++ hscSourceString (ms_hsc_src mod_summary)
+ dyn_file = op $ msDynObjFilePath mod_summary dflags
+ obj_file = case target of
+ HscInterpreted | recomp -> "interpreted"
+ HscNothing -> "nothing"
+ _ -> (op $ msObjFilePath mod_summary)
{-
************************************************************************
=====================================
compiler/utils/Outputable.hs
=====================================
@@ -327,6 +327,10 @@ data SDocContext = SDC
instance IsString SDoc where
fromString = text
+-- The lazy programmer's friend.
+instance Outputable SDoc where
+ ppr = id
+
initSDocContext :: DynFlags -> PprStyle -> SDocContext
initSDocContext dflags sty = SDC
{ sdocStyle = sty
=====================================
hadrian/src/Rules.hs
=====================================
@@ -83,7 +83,12 @@ topLevelTargets = action $ do
targets <- concatForM buildStages $ \stage -> do
packages <- stagePackages stage
mapM (path stage) packages
- need targets
+
+ -- Why we need wrappers: https://gitlab.haskell.org/ghc/ghc/issues/16534.
+ root <- buildRoot
+ let wrappers = [ root -/- ("ghc-" ++ stageString s) | s <- [Stage1 ..]
+ , s < finalStage ]
+ need (targets ++ wrappers)
where
-- either the package database config file for libraries or
-- the programPath for programs. However this still does
=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -170,6 +170,10 @@ copyRules = do
generateRules :: Rules ()
generateRules = do
root <- buildRootRules
+
+ (root -/- "ghc-stage1") <~ ghcWrapper Stage1
+ (root -/- "ghc-stage2") <~ ghcWrapper Stage2
+
priority 2.0 $ (root -/- generatedDir -/- "ghcautoconf.h") <~ generateGhcAutoconfH
priority 2.0 $ (root -/- generatedDir -/- "ghcplatform.h") <~ generateGhcPlatformH
priority 2.0 $ (root -/- generatedDir -/- "ghcversion.h") <~ generateGhcVersionH
@@ -190,6 +194,17 @@ emptyTarget = vanillaContext (error "Rules.Generate.emptyTarget: unknown stage")
-- Generators
+-- | GHC wrapper scripts used for passing the path to the right package database
+-- when invoking in-tree GHC executables.
+ghcWrapper :: Stage -> Expr String
+ghcWrapper Stage0 = error "Stage0 GHC does not require a wrapper script to run."
+ghcWrapper stage = do
+ dbPath <- expr $ packageDbPath stage
+ ghcPath <- expr $ programPath (vanillaContext (pred stage) ghc)
+ return $ unwords $ map show $ [ ghcPath ]
+ ++ [ "-package-db " ++ dbPath | stage == Stage1 ]
+ ++ [ "$@" ]
+
-- | Given a 'String' replace charaters '.' and '-' by underscores ('_') so that
-- the resulting 'String' is a valid C preprocessor identifier.
cppify :: String -> String
=====================================
libraries/base/Data/Foldable.hs
=====================================
@@ -181,8 +181,8 @@ class Foldable t where
-- use 'foldl'' instead of 'foldl'. The reason for this is that latter does
-- not force the "inner" results (e.g. @z \`f\` x1@ in the above example)
-- before applying them to the operator (e.g. to @(\`f\` x2)@). This results
- -- in a thunk chain @O(n)@ elements long, which then must be evaluated from
- -- the outside-in.
+ -- in a thunk chain \(\mathcal{O}(n)\) elements long, which then must be
+ -- evaluated from the outside-in.
--
-- For a general 'Foldable' structure this should be semantically identical
-- to,
=====================================
libraries/base/Data/OldList.hs
=====================================
@@ -241,9 +241,9 @@ infix 5 \\ -- comment to fool cpp: https://downloads.haskell.org/~ghc/latest/doc
dropWhileEnd :: (a -> Bool) -> [a] -> [a]
dropWhileEnd p = foldr (\x xs -> if p x && null xs then [] else x : xs) []
--- | /O(min(m,n))/. The 'stripPrefix' function drops the given prefix from a
--- list. It returns 'Nothing' if the list did not start with the prefix given,
--- or 'Just' the list after the prefix, if it does.
+-- | \(\mathcal{O}(min(m,n))\). The 'stripPrefix' function drops the given
+-- prefix from a list. It returns 'Nothing' if the list did not start with the
+-- prefix given, or 'Just' the list after the prefix, if it does.
--
-- >>> stripPrefix "foo" "foobar"
-- Just "bar"
@@ -319,8 +319,8 @@ findIndices p ls = build $ \c n ->
in foldr go (\_ -> n) ls 0#
#endif /* USE_REPORT_PRELUDE */
--- | /O(min(m,n))/. The 'isPrefixOf' function takes two lists and returns 'True'
--- iff the first list is a prefix of the second.
+-- | \(\mathcal{O}(min(m,n))\). The 'isPrefixOf' function takes two lists and
+-- returns 'True' iff the first list is a prefix of the second.
--
-- >>> "Hello" `isPrefixOf` "Hello World!"
-- True
@@ -388,11 +388,10 @@ dropLengthMaybe (_:x') (_:y') = dropLengthMaybe x' y'
isInfixOf :: (Eq a) => [a] -> [a] -> Bool
isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack)
--- | /O(n^2)/. The 'nub' function removes duplicate elements from a list.
--- In particular, it keeps only the first occurrence of each element.
--- (The name 'nub' means \`essence\'.)
--- It is a special case of 'nubBy', which allows the programmer to supply
--- their own equality test.
+-- | \(\mathcal{O}(n^2)\). The 'nub' function removes duplicate elements from a
+-- list. In particular, it keeps only the first occurrence of each element. (The
+-- name 'nub' means \`essence\'.) It is a special case of 'nubBy', which allows
+-- the programmer to supply their own equality test.
--
-- >>> nub [1,2,3,4,3,2,1,2,4,3,5]
-- [1,2,3,4,5]
@@ -431,8 +430,8 @@ elem_by eq y (x:xs) = x `eq` y || elem_by eq y xs
#endif
--- | /O(n)/. 'delete' @x@ removes the first occurrence of @x@ from its list
--- argument. For example,
+-- | \(\mathcal{O}(n)\). 'delete' @x@ removes the first occurrence of @x@ from
+-- its list argument. For example,
--
-- >>> delete 'a' "banana"
-- "bnana"
@@ -442,8 +441,8 @@ elem_by eq y (x:xs) = x `eq` y || elem_by eq y xs
delete :: (Eq a) => a -> [a] -> [a]
delete = deleteBy (==)
--- | /O(n)/. The 'deleteBy' function behaves like 'delete', but takes a
--- user-supplied equality predicate.
+-- | \(\mathcal{O}(n)\). The 'deleteBy' function behaves like 'delete', but
+-- takes a user-supplied equality predicate.
--
-- >>> deleteBy (<=) 4 [1..10]
-- [1,2,3,5,6,7,8,9,10]
@@ -509,9 +508,9 @@ intersectBy _ [] _ = []
intersectBy _ _ [] = []
intersectBy eq xs ys = [x | x <- xs, any (eq x) ys]
--- | /O(n)/. The 'intersperse' function takes an element and a list and
--- \`intersperses\' that element between the elements of the list.
--- For example,
+-- | \(\mathcal{O}(n)\). The 'intersperse' function takes an element and a list
+-- and \`intersperses\' that element between the elements of the list. For
+-- example,
--
-- >>> intersperse ',' "abcde"
-- "a,b,c,d,e"
@@ -618,18 +617,18 @@ mapAccumR f s (x:xs) = (s'', y:ys)
where (s'',y ) = f s' x
(s', ys) = mapAccumR f s xs
--- | /O(n)/. The 'insert' function takes an element and a list and inserts the
--- element into the list at the first position where it is less than or equal to
--- the next element. In particular, if the list is sorted before the call, the
--- result will also be sorted. It is a special case of 'insertBy', which allows
--- the programmer to supply their own comparison function.
+-- | \(\mathcal{O}(n)\). The 'insert' function takes an element and a list and
+-- inserts the element into the list at the first position where it is less than
+-- or equal to the next element. In particular, if the list is sorted before the
+-- call, the result will also be sorted. It is a special case of 'insertBy',
+-- which allows the programmer to supply their own comparison function.
--
-- >>> insert 4 [1,2,3,5,6,7]
-- [1,2,3,4,5,6,7]
insert :: Ord a => a -> [a] -> [a]
insert e ls = insertBy (compare) e ls
--- | /O(n)/. The non-overloaded version of 'insert'.
+-- | \(\mathcal{O}(n)\). The non-overloaded version of 'insert'.
insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
insertBy _ x [] = [x]
insertBy cmp x ys@(y:ys')
@@ -669,9 +668,10 @@ minimumBy cmp xs = foldl1 minBy xs
GT -> y
_ -> x
--- | /O(n)/. The 'genericLength' function is an overloaded version of 'length'.
--- In particular, instead of returning an 'Int', it returns any type which is an
--- instance of 'Num'. It is, however, less efficient than 'length'.
+-- | \(\mathcal{O}(n)\). The 'genericLength' function is an overloaded version
+-- of 'length'. In particular, instead of returning an 'Int', it returns any
+-- type which is an instance of 'Num'. It is, however, less efficient than
+-- 'length'.
--
-- >>> genericLength [1, 2, 3] :: Int
-- 3
@@ -1029,8 +1029,8 @@ inits = map toListSB . scanl' snocSB emptySB
-- if it fuses with a consumer, and it would generally lead to serious
-- loss of sharing if allowed to fuse with a producer.
--- | /O(n)/. The 'tails' function returns all final segments of the argument,
--- longest first. For example,
+-- | \(\mathcal{O}(n)\). The 'tails' function returns all final segments of the
+-- argument, longest first. For example,
--
-- >>> tails "abc"
-- ["abc","bc","c",""]
=====================================
libraries/base/Data/Semigroup/Internal.hs
=====================================
@@ -31,7 +31,7 @@ import GHC.Real
-- | This is a valid definition of 'stimes' for an idempotent 'Semigroup'.
--
-- When @x <> x = x@, this definition should be preferred, because it
--- works in /O(1)/ rather than /O(log n)/.
+-- works in \(\mathcal{O}(1)\) rather than \(\mathcal{O}(\log n)\).
stimesIdempotent :: Integral b => b -> a -> a
stimesIdempotent n x
| n <= 0 = errorWithoutStackTrace "stimesIdempotent: positive multiplier expected"
@@ -40,7 +40,7 @@ stimesIdempotent n x
-- | This is a valid definition of 'stimes' for an idempotent 'Monoid'.
--
-- When @mappend x x = x@, this definition should be preferred, because it
--- works in /O(1)/ rather than /O(log n)/
+-- works in \(\mathcal{O}(1)\) rather than \(\mathcal{O}(\log n)\)
stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a
stimesIdempotentMonoid n x = case compare n 0 of
LT -> errorWithoutStackTrace "stimesIdempotentMonoid: negative multiplier"
=====================================
libraries/base/GHC/Base.hs
=====================================
@@ -239,7 +239,7 @@ class Semigroup a where
-- will do so.
--
-- By making this a member of the class, idempotent semigroups
- -- and monoids can upgrade this to execute in /O(1)/ by
+ -- and monoids can upgrade this to execute in \(\mathcal{O}(1)\) by
-- picking @stimes = 'Data.Semigroup.stimesIdempotent'@ or @stimes =
-- 'stimesIdempotentMonoid'@ respectively.
stimes :: Integral b => b -> a -> a
@@ -1083,8 +1083,8 @@ augment g xs = g (:) xs
-- map
----------------------------------------------
--- | /O(n)/. 'map' @f xs@ is the list obtained by applying @f@ to each element
--- of @xs@, i.e.,
+-- | \(\mathcal{O}(n)\). 'map' @f xs@ is the list obtained by applying @f@ to
+-- each element of @xs@, i.e.,
--
-- > map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
-- > map f [x1, x2, ...] == [f x1, f x2, ...]
=====================================
libraries/base/GHC/List.hs
=====================================
@@ -44,7 +44,7 @@ infix 4 `elem`, `notElem`
-- List-manipulation functions
--------------------------------------------------------------
--- | /O(1)/. Extract the first element of a list, which must be non-empty.
+-- | \(\mathcal{O}(1)\). Extract the first element of a list, which must be non-empty.
head :: [a] -> a
head (x:_) = x
head [] = badHead
@@ -62,8 +62,8 @@ badHead = errorEmptyList "head"
head (augment g xs) = g (\x _ -> x) (head xs)
#-}
--- | /O(1)/. Decompose a list into its head and tail. If the list is empty,
--- returns 'Nothing'. If the list is non-empty, returns @'Just' (x, xs)@,
+-- | \(\mathcal{O}(1)\). Decompose a list into its head and tail. If the list is
+-- empty, returns 'Nothing'. If the list is non-empty, returns @'Just' (x, xs)@,
-- where @x@ is the head of the list and @xs@ its tail.
--
-- @since 4.8.0.0
@@ -71,14 +71,14 @@ uncons :: [a] -> Maybe (a, [a])
uncons [] = Nothing
uncons (x:xs) = Just (x, xs)
--- | /O(1)/. Extract the elements after the head of a list, which must be
--- non-empty.
+-- | \(\mathcal{O}(1)\). Extract the elements after the head of a list, which
+-- must be non-empty.
tail :: [a] -> [a]
tail (_:xs) = xs
tail [] = errorEmptyList "tail"
--- | /O(n)/. Extract the last element of a list, which must be finite and
--- non-empty.
+-- | \(\mathcal{O}(n)\). Extract the last element of a list, which must be
+-- finite and non-empty.
last :: [a] -> a
#if defined(USE_REPORT_PRELUDE)
last [x] = x
@@ -96,7 +96,7 @@ lastError :: a
lastError = errorEmptyList "last"
#endif
--- | /O(n)/. Return all the elements of a list except the last one.
+-- | \(\mathcal{O}(n)\). Return all the elements of a list except the last one.
-- The list must be non-empty.
init :: [a] -> [a]
#if defined(USE_REPORT_PRELUDE)
@@ -111,14 +111,14 @@ init (x:xs) = init' x xs
init' y (z:zs) = y : init' z zs
#endif
--- | /O(1)/. Test whether a list is empty.
+-- | \(\mathcal{O}(1)\). Test whether a list is empty.
null :: [a] -> Bool
null [] = True
null (_:_) = False
--- | /O(n)/. 'length' returns the length of a finite list as an 'Int'.
--- It is an instance of the more general 'Data.List.genericLength',
--- the result type of which may be any kind of number.
+-- | \(\mathcal{O}(n)\). 'length' returns the length of a finite list as an
+-- 'Int'. It is an instance of the more general 'Data.List.genericLength', the
+-- result type of which may be any kind of number.
{-# NOINLINE [1] length #-}
length :: [a] -> Int
length xs = lenAcc xs 0
@@ -142,8 +142,8 @@ lengthFB _ r = \ !a -> r (a + 1)
idLength :: Int -> Int
idLength = id
--- | /O(n)/. 'filter', applied to a predicate and a list, returns the list of
--- those elements that satisfy the predicate; i.e.,
+-- | \(\mathcal{O}(n)\). 'filter', applied to a predicate and a list, returns
+-- the list of those elements that satisfy the predicate; i.e.,
--
-- > filter p xs = [ x | x <- xs, p x]
--
@@ -262,8 +262,8 @@ product :: (Num a) => [a] -> a
{-# INLINE product #-}
product = foldl (*) 1
--- | /O(n)/. 'scanl' is similar to 'foldl', but returns a list of successive
--- reduced values from the left:
+-- | \(\mathcal{O}(n)\). 'scanl' is similar to 'foldl', but returns a list of
+-- successive reduced values from the left:
--
-- > scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
--
@@ -300,8 +300,8 @@ constScanl :: a -> b -> a
constScanl = const
--- | /O(n)/. 'scanl1' is a variant of 'scanl' that has no starting value
--- argument:
+-- | \(\mathcal{O}(n)\). 'scanl1' is a variant of 'scanl' that has no starting
+-- value argument:
--
-- > scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
@@ -309,7 +309,7 @@ scanl1 :: (a -> a -> a) -> [a] -> [a]
scanl1 f (x:xs) = scanl f x xs
scanl1 _ [] = []
--- | /O(n)/. A strictly accumulating version of 'scanl'
+-- | \(\mathcal{O}(n)\). A strictly accumulating version of 'scanl'
{-# NOINLINE [1] scanl' #-}
scanl' :: (b -> a -> b) -> b -> [a] -> [b]
-- This peculiar form is needed to prevent scanl' from being rewritten
@@ -381,7 +381,7 @@ foldr1 f = go
go [] = errorEmptyList "foldr1"
{-# INLINE [0] foldr1 #-}
--- | /O(n)/. 'scanr' is the right-to-left dual of 'scanl'.
+-- | \(\mathcal{O}(n)\). 'scanr' is the right-to-left dual of 'scanl'.
-- Note that
--
-- > head (scanr f z xs) == foldr f z xs.
@@ -408,8 +408,8 @@ scanrFB f c = \x (r, est) -> (f x r, r `c` est)
scanr f q0 ls
#-}
--- | /O(n)/. 'scanr1' is a variant of 'scanr' that has no starting value
--- argument.
+-- | \(\mathcal{O}(n)\). 'scanr1' is a variant of 'scanr' that has no starting
+-- value argument.
scanr1 :: (a -> a -> a) -> [a] -> [a]
scanr1 _ [] = []
scanr1 _ [x] = [x]
@@ -852,7 +852,8 @@ notElem x (y:ys)= x /= y && notElem x ys
#-}
#endif
--- | /O(n)/. 'lookup' @key assocs@ looks up a key in an association list.
+-- | \(\mathcal{O}(n)\). 'lookup' @key assocs@ looks up a key in an association
+-- list.
--
-- >>> lookup 2 [(1, "first"), (2, "second"), (3, "third")]
-- Just "second"
@@ -1012,8 +1013,8 @@ NB: Zips for larger tuples are in the List module.
-}
----------------------------------------------
--- | /O(min(m,n))/. 'zip' takes two lists and returns a list of corresponding
--- pairs.
+-- | \(\mathcal{O}(min(m,n))\). 'zip' takes two lists and returns a list of
+-- corresponding pairs.
--
-- > zip [1, 2] ['a', 'b'] = [(1, 'a'), (2, 'b')]
--
@@ -1070,10 +1071,10 @@ zip3FB cons = \a b c r -> (a,b,c) `cons` r
-- function given as the first argument, instead of a tupling function.
----------------------------------------------
--- | /O(min(m,n))/. 'zipWith' generalises 'zip' by zipping with the function
--- given as the first argument, instead of a tupling function. For example,
--- @'zipWith' (+)@ is applied to two lists to produce the list of corresponding
--- sums:
+-- | \(\mathcal{O}(min(m,n))\). 'zipWith' generalises 'zip' by zipping with the
+-- function given as the first argument, instead of a tupling function. For
+-- example, @'zipWith' (+)@ is applied to two lists to produce the list of
+-- corresponding sums:
--
-- >>> zipWith (+) [1, 2, 3] [4, 5, 6]
-- [5,7,9]
=====================================
libraries/base/GHC/StableName.hs
=====================================
@@ -13,8 +13,8 @@
-- Stability : experimental
-- Portability : non-portable
--
--- Stable names are a way of performing fast (O(1)), not-quite-exact
--- comparison between objects.
+-- Stable names are a way of performing fast ( \(\mathcal{O}(1)\) ),
+-- not-quite-exact comparison between objects.
--
-- Stable names solve the following problem: suppose you want to build
-- a hash table with Haskell objects as keys, but you want to use
=====================================
libraries/base/System/Mem/StableName.hs
=====================================
@@ -10,8 +10,8 @@
-- Stability : experimental
-- Portability : non-portable
--
--- Stable names are a way of performing fast (O(1)), not-quite-exact
--- comparison between objects.
+-- Stable names are a way of performing fast ( \(\mathcal{O}(1)\) ),
+-- not-quite-exact comparison between objects.
--
-- Stable names solve the following problem: suppose you want to build
-- a hash table with Haskell objects as keys, but you want to use
=====================================
testsuite/tests/driver/dynamicToo/dynamicToo006/Main.hs
=====================================
@@ -0,0 +1 @@
+main = print "a"
=====================================
testsuite/tests/driver/dynamicToo/dynamicToo006/Makefile
=====================================
@@ -0,0 +1,16 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+clean:
+ rm -f *.o
+ rm -f *.hi
+ rm -f Main
+
+# check that the compilation progress message will contain
+# *.dyn_o file with -dynamic-too
+main:
+ rm -f *.o
+ rm -f *.hi
+ rm -f Main
+ '$(TEST_HC)' $(TEST_HC_OPTS) -dynamic-too Main.hs
=====================================
testsuite/tests/driver/dynamicToo/dynamicToo006/all.T
=====================================
@@ -0,0 +1,2 @@
+test('dynamicToo006', [normalise_slashes, extra_files(['Main.hs'])],
+ run_command, ['$MAKE -s main --no-print-director'])
=====================================
testsuite/tests/driver/dynamicToo/dynamicToo006/dynamicToo006.stdout
=====================================
@@ -0,0 +1,2 @@
+[1 of 1] Compiling Main ( Main.hs, Main.o, Main.dyn_o )
+Linking Main ...
=====================================
testsuite/tests/safeHaskell/safeInfered/UnsafeInfered02.stderr
=====================================
@@ -1,5 +1,5 @@
-[1 of 2] Compiling UnsafeInfered02_A ( UnsafeInfered02_A.hs, UnsafeInfered02_A.o )
-[2 of 2] Compiling UnsafeInfered02 ( UnsafeInfered02.hs, UnsafeInfered02.o )
+[1 of 2] Compiling UnsafeInfered02_A ( UnsafeInfered02_A.hs, UnsafeInfered02_A.o, UnsafeInfered02_A.dyn_o )
+[2 of 2] Compiling UnsafeInfered02 ( UnsafeInfered02.hs, UnsafeInfered02.o, UnsafeInfered02.dyn_o )
UnsafeInfered02.hs:4:1: error:
UnsafeInfered02_A: Can't be safely imported!
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/82668e8eeed294d4ffdd1599192e3574907dd0ed...97a41cd9813dc98efb44d27684a6d98cf5f5168f
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/compare/82668e8eeed294d4ffdd1599192e3574907dd0ed...97a41cd9813dc98efb44d27684a6d98cf5f5168f
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190417/6f8385c5/attachment-0001.html>
More information about the ghc-commits
mailing list