Skip to content

Commit 109954f

Browse files
committed
Fix build on 9.0
1 parent 840141d commit 109954f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} dir = do
517517
-- compilation but these are the true source of
518518
-- information.
519519
new_deps = fmap (\(df, targets) -> RawComponentInfo (homeUnitId_ df) df targets cfp opts dep_info) newTargetDfs
520-
all_deps = new_deps `NE.appendList` maybe [] id oldDeps
520+
all_deps = new_deps `appendListToNonEmpty` maybe [] id oldDeps
521521
-- Get all the unit-ids for things in this component
522522
inplace = map rawComponentUnitId $ NE.toList all_deps
523523

@@ -1204,3 +1204,11 @@ showPackageSetupException (PackageCheckFailed BasePackageAbiMismatch{..}) = unwo
12041204
renderPackageSetupException :: FilePath -> PackageSetupException -> (NormalizedFilePath, ShowDiagnostic, Diagnostic)
12051205
renderPackageSetupException fp e =
12061206
ideErrorWithSource (Just "cradle") (Just DiagnosticSeverity_Error) (toNormalizedFilePath' fp) (T.pack $ showPackageSetupException e)
1207+
1208+
1209+
appendListToNonEmpty :: NE.NonEmpty a -> [a] -> NE.NonEmpty a
1210+
#if MIN_VERSION_base(4,16,0)
1211+
appendListToNonEmpty = NE.appendList
1212+
#else
1213+
appendListToNonEmpty (x NE.:| xs) ys = x NE.:| (xs ++ ys)
1214+
#endif

0 commit comments

Comments
 (0)