lude

Haskell prelude alternative
git clone git://git.rr3.xyz/lude | git clone gits://git.rr3.xyz/lude
Log | Files | Refs | README | LICENSE

commit 9400c550dc27c17893c1e454cef9c1d7b7089e61
parent e6f249e06ca946d1bd99c0e2b754e1906e267984
Author: Robert Russell <robert@rr3.xyz>
Date:   Wed, 16 Sep 2026 13:18:55 -0700

Rename some qualified imports

Diffstat:
Msrc/Lude/Algebra/Category/Core.hs | 6+++---
Msrc/Lude/Algebra/Category/Monad.hs | 10+++++-----
Msrc/Lude/Haskell.hs | 2++
Msrc/Lude/Haskell/Category.hs | 6+++---
4 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/Lude/Algebra/Category/Core.hs b/src/Lude/Algebra/Category/Core.hs @@ -30,7 +30,7 @@ module Lude.Algebra.Category.Core ( ) where import Data.Coerce -import Data.Functor qualified +import Prelude qualified as Base import Lude.Constraint.Predicate import Lude.Haskell @@ -250,10 +250,10 @@ instance Functorial Given where type InteropFunctor :: Endo (Endo Type) newtype InteropFunctor f a = MkInteropFunctor {unInteropFunctor :: f a} -instance (Data.Functor.Functor f) => Functorial (InteropFunctor f) where +instance (Base.Functor f) => Functorial (InteropFunctor f) where type Dom (InteropFunctor f) = Function type Cod (InteropFunctor f) = Function - map = coerce Data.Functor.fmap + map = coerce Base.fmap deriving via InteropFunctor IO instance Functorial IO deriving via InteropFunctor List instance Functorial List diff --git a/src/Lude/Algebra/Category/Monad.hs b/src/Lude/Algebra/Category/Monad.hs @@ -11,7 +11,7 @@ module Lude.Algebra.Category.Monad ( ) where import Data.Coerce -import Prelude qualified +import Prelude qualified as Base import Lude.Algebra.Category.Core import Lude.Function (const, flip) @@ -73,10 +73,10 @@ fa << fb = bind (\a -> fb >> pure a) fa -------------------------------------------------------------------------------- -- Interop -instance (Prelude.Monad f) => Monadic (InteropFunctor f) where - pure = coerce Prelude.return - join = coerce (Prelude.>>= unInteropFunctor) - bind = coerce (Prelude.=<<) +instance (Base.Monad f) => Monadic (InteropFunctor f) where + pure = coerce Base.return + join = coerce (Base.>>= unInteropFunctor) + bind = coerce (Base.=<<) deriving via InteropFunctor IO instance Monadic IO deriving via InteropFunctor List instance Monadic List diff --git a/src/Lude/Haskell.hs b/src/Lude/Haskell.hs @@ -12,3 +12,5 @@ import Lude.Haskell.Generic as X hiding (Rep, Rep1, from, from1, to, to1) import Lude.Haskell.Kind as X import Lude.Haskell.Repr as X (Repr) import Lude.Haskell.Type as X + +-- TODO: Data.Coerce diff --git a/src/Lude/Haskell/Category.hs b/src/Lude/Haskell/Category.hs @@ -50,8 +50,8 @@ module Lude.Haskell.Category ( tautology, ) where -import Data.Function qualified import GHC.Exts qualified as GHC +import Prelude qualified as Base import Lude.Haskell.Constraint import Lude.Haskell.Kind @@ -84,10 +84,10 @@ type (~~>) :: forall i j r. Cat (i -> j -> Type @r) type f ~~> g = forall x y. f x y -> g x y identityFunction :: forall a. a -> a -identityFunction = Data.Function.id +identityFunction = Base.id composeFunction :: forall a b c. (b -> c) -> (a -> b) -> (a -> c) -composeFunction = (Data.Function..) +composeFunction = (Base..) -- | Entailments between two constraints (which form a category) type Entailment :: Cat Constraint