Verified Commit 3ff8a53f authored by Camil Staps's avatar Camil Staps 🚀

Remove some functions from class macros to prevent import issues

parent 2ba2e4ee
Pipeline #14920 failed with stage
in 1 minute and 2 seconds
implementation module Control.Monad.State
import StdFunctions
import StdTuple
import Control.Monad
import Data.Functor
......
......@@ -12,7 +12,6 @@ from Data.Monoid import class Monoid, class Semigroup
from Data.Foldable import class Foldable
from Data.Traversable import class Traversable
from Data.Bifunctor import class Bifunctor
from Data.GenEq import generic gEq
:: Either a b = Left a | Right b
......@@ -34,8 +33,6 @@ instance Bifunctor Either
instance Alternative (Either m) | Monoid m
derive gEq Either
either :: .(.a -> .c) .(.b -> .c) !(Either .a .b) -> .c
lefts :: .[Either .a .b] -> .[.a]
rights :: .[Either .a .b] -> .[.b]
......
implementation module Data.Either
from StdEnv import flip, id, o
from StdEnv import flip, id, o, const
from StdMisc import abort
import Control.Applicative
import Control.Monad
......@@ -12,7 +12,6 @@ from Data.Foldable import class Foldable(foldMap,foldl,foldr)
from Data.Traversable import class Traversable(traverse)
import qualified Data.Traversable as T
import Data.Bifunctor
import Data.GenEq
instance Functor (Either a) where
fmap f (Left l) = Left l
......@@ -81,8 +80,6 @@ where
empty = Left mempty
(<|>) fa fb = either (\e->either (Left o mappend e) Right fb) Right fa
derive gEq Either
either :: .(.a -> .c) .(.b -> .c) !(Either .a .b) -> .c
either f _ (Left x) = f x
either _ g (Right y) = g y
......
definition module Data.Functor
from StdFunc import const
class Functor f
where
fmap :: (a -> b) !(f a) -> f b
......@@ -10,7 +8,7 @@ where
(<$>) f fa :== fmap f fa
(<$) infixl 4 :: a !(f b) -> f a | Functor f
(<$) x fa :== fmap (const x) fa
(<$) x fa :== fmap (\_ -> x) fa
($>) infixl 4 :: !(f b) a -> f a | Functor f
($>) fa x :== x <$ fa
......
......@@ -16,7 +16,10 @@ where
mempty :: a
mconcat :: !.[a] -> a | Monoid a
mconcat xs :== 'StdList'.foldr mappend mempty xs
mconcat xs :== mconcat xs
where
mconcat [] = mempty
mconcat [a:x] = mconcat a (mconcat x)
instance Semigroup ()
instance Monoid ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment