aports/testing/klfc/ghc9-002.patch
2022-08-18 01:19:42 +00:00

42 lines
1.4 KiB
Diff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

From fee9bdeb76cc1f9e9e36b91764aff665c9164164 Mon Sep 17 00:00:00 2001
From: Aldo Gunsing <dev@aldogunsing.nl>
Date: Thu, 16 Dec 2021 22:38:09 +0100
Subject: [PATCH] Fix compilation with GHC 9.0 (#40)
See https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0#simplified-subsumption
for the required eta-expansion in lensWithDefault'
Hiding singleton from BasePrelude gives a warning for previous GHC versions,
but this is a minor issue
---
src/Util.hs | 2 +-
src/WithPlus.hs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Util.hs b/src/Util.hs
index 0dc0884..dc096db 100644
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -80,7 +80,7 @@ lensWithDefault guess setter getter f x =
(\y → setter (Just y) x) <$> f (fromMaybe (guess x) (getter x))
lensWithDefault' ∷ α → (Maybe ασσ) → (σ → Maybe α) → Lens' σ α
-lensWithDefault' = lensWithDefault ∘ const
+lensWithDefault' x = lensWithDefault (const x)
(!?) ∷ [α] → Int → Maybe α
(!?) xs i =
diff --git a/src/WithPlus.hs b/src/WithPlus.hs
index 1a46faf..558591d 100644
--- a/src/WithPlus.hs
+++ b/src/WithPlus.hs
@@ -9,7 +9,7 @@ module WithPlus
, parseString
) where
-import BasePrelude hiding (toList, fromList)
+import BasePrelude hiding (toList, fromList, singleton)
import Prelude.Unicode
import Data.Monoid.Unicode ((∅))
import Util (HumanReadable, split)