ref: 27f1f15f69287a31fc95e5c15831fd6be487c88a
parent: e9f8af0dee004784c8cfac547f04100b192c4034
author: Lennart Augustsson <lennart@augustsson.net>
date: Wed Sep 18 18:24:25 EDT 2024
Move Const around to be GHC compatible.
--- a/lib/Control/Applicative.hs
+++ b/lib/Control/Applicative.hs
@@ -4,6 +4,7 @@
liftA, liftA3,
Alternative(..),
guard, asum, optional,
+ module Data.Functor.Const_Type,
) where
import Prelude() -- do not import Prelude
import Primitives -- for fixity
@@ -12,6 +13,7 @@
import Data.Function
import Data.List_Type
import Data.Maybe_Type
+import Data.Functor.Const_Type
infixl 4 <*>, *>, <*, <**>
--- a/lib/Data/Functor/Const.hs
+++ b/lib/Data/Functor/Const.hs
@@ -9,17 +9,11 @@
import Data.Eq
import Data.Function
import Data.Functor
+import Data.Functor.Const_Type
import Data.Int
import Data.Monoid
import Data.Ord
import Text.Show
-
-type Const :: forall k . Type -> k -> Type
-newtype Const a b = Const a
- deriving (Eq, Ord, Show)
-
-getConst :: forall a b . Const a b -> a
-getConst (Const a) = a
instance forall a . Functor (Const a) where
fmap _ (Const a) = Const a
--- /dev/null
+++ b/lib/Data/Functor/Const_Type.hs
@@ -1,0 +1,19 @@
+-- Copyright 2023 Lennart Augustsson
+-- See LICENSE file for full license.
+module Data.Functor.Const_Type(Const(..), getConst) where
+import Prelude() -- do not import Prelude
+import Primitives
+import Data.Bool
+import Data.Eq
+import Data.Function
+import Data.Functor
+import Data.Int
+import Data.Ord
+import Text.Show
+
+type Const :: forall k . Type -> k -> Type
+newtype Const a b = Const a
+ deriving (Eq, Ord, Show)
+
+getConst :: forall a b . Const a b -> a
+getConst (Const a) = a
--
⑨