Commit 536bf829 authored by Finn Teegen's avatar Finn Teegen
Browse files

Remove monadlist dependency

parent c94cb66c
...@@ -48,7 +48,6 @@ Library ...@@ -48,7 +48,6 @@ Library
, directory , directory
, extra >= 1.4.6 , extra >= 1.4.6
, filepath , filepath
, monadlist
, mtl , mtl
, pretty , pretty
, process , process
...@@ -147,7 +146,6 @@ Executable curry-frontend ...@@ -147,7 +146,6 @@ Executable curry-frontend
, directory , directory
, extra >= 1.4.6 , extra >= 1.4.6
, filepath , filepath
, monadlist
, mtl , mtl
, pretty , pretty
, process , process
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
Description : Auxiliary functions Description : Auxiliary functions
Copyright : (c) 2001 - 2003 Wolfgang Lux Copyright : (c) 2001 - 2003 Wolfgang Lux
2011 - 2015 Björn Peemöler 2011 - 2015 Björn Peemöler
2016 Finn Teegen 2016 - 2017 Finn Teegen
License : BSD-3-clause License : BSD-3-clause
Maintainer : bjp@informatik.uni-kiel.de Maintainer : fte@informatik.uni-kiel.de
Stability : experimental Stability : experimental
Portability : portable Portability : portable
...@@ -17,10 +17,12 @@ ...@@ -17,10 +17,12 @@
module Base.Utils module Base.Utils
( fst3, snd3, thd3, curry3, uncurry3 ( fst3, snd3, thd3, curry3, uncurry3
, (++!), foldr2, findDouble, findMultiples , (++!), foldr2, mapAccumM, findDouble, findMultiples
) where ) where
import Data.List (partition) import Control.Monad (MonadPlus, mzero, mplus)
import Data.List (partition)
infixr 5 ++! infixr 5 ++!
...@@ -65,6 +67,14 @@ foldr2 _ z [] _ = z ...@@ -65,6 +67,14 @@ foldr2 _ z [] _ = z
foldr2 _ z _ [] = z foldr2 _ z _ [] = z
foldr2 f z (x : xs) (y : ys) = f x y (foldr2 f z xs ys) foldr2 f z (x : xs) (y : ys) = f x y (foldr2 f z xs ys)
mapAccumM :: (Monad m, MonadPlus p) => (acc -> x -> m (acc, y)) -> acc -> [x]
-> m (acc, p y)
mapAccumM _ z [] = return (z, mzero)
mapAccumM f z (x:xs) = do
(z', y) <- f z x
(z'', ys) <- mapAccumM f z' xs
return (z'', return y `mplus` ys)
-- The function 'findDouble' checks whether a list of entities is linear, -- The function 'findDouble' checks whether a list of entities is linear,
-- i.e., if every entity in the list occurs only once. If it is non-linear, -- i.e., if every entity in the list occurs only once. If it is non-linear,
-- the first offending object is returned. -- the first offending object is returned.
......
...@@ -42,7 +42,6 @@ import Control.Applicative ((<$>), (<*>)) ...@@ -42,7 +42,6 @@ import Control.Applicative ((<$>), (<*>))
import Control.Monad.Extra ( (&&^), allM, filterM, foldM import Control.Monad.Extra ( (&&^), allM, filterM, foldM
, liftM, notM, replicateM, unless , liftM, notM, replicateM, unless
, unlessM ) , unlessM )
import Control.Monad.ListM (mapAccumM)
import qualified Control.Monad.State as S (State, runState, gets, modify) import qualified Control.Monad.State as S (State, runState, gets, modify)
import Data.List (nub, nubBy, partition, sortBy) import Data.List (nub, nubBy, partition, sortBy)
import Data.Function (on) import Data.Function (on)
...@@ -68,7 +67,7 @@ import Base.TopEnv ...@@ -68,7 +67,7 @@ import Base.TopEnv
import Base.TypeExpansion import Base.TypeExpansion
import Base.Types import Base.Types
import Base.TypeSubst import Base.TypeSubst
import Base.Utils (foldr2, fst3, snd3, thd3, uncurry3) import Base.Utils (foldr2, fst3, snd3, thd3, uncurry3, mapAccumM)
import Env.Class import Env.Class
import Env.Instance import Env.Instance
......
...@@ -16,7 +16,6 @@ module Transformations.Derive (derive) where ...@@ -16,7 +16,6 @@ module Transformations.Derive (derive) where
#if __GLASGOW_HASKELL__ < 710 #if __GLASGOW_HASKELL__ < 710
import Control.Applicative ((<$>)) import Control.Applicative ((<$>))
#endif #endif
import Control.Monad.ListM (mapAccumM)
import qualified Control.Monad.State as S (State, evalState, gets, modify) import qualified Control.Monad.State as S (State, evalState, gets, modify)
import Data.List (intercalate, intersperse) import Data.List (intercalate, intersperse)
import Data.Maybe (fromJust, isJust) import Data.Maybe (fromJust, isJust)
...@@ -31,7 +30,7 @@ import Base.Messages (internalError) ...@@ -31,7 +30,7 @@ import Base.Messages (internalError)
import Base.Types import Base.Types
import Base.TypeSubst (instanceType) import Base.TypeSubst (instanceType)
import Base.Typing (typeOf) import Base.Typing (typeOf)
import Base.Utils (snd3) import Base.Utils (snd3, mapAccumM)
import Env.Instance import Env.Instance
import Env.OpPrec import Env.OpPrec
......
...@@ -61,7 +61,6 @@ import Control.Applicative ((<$>), (<*>)) ...@@ -61,7 +61,6 @@ import Control.Applicative ((<$>), (<*>))
import Control.Arrow (first, second) import Control.Arrow (first, second)
import Control.Monad (liftM2) import Control.Monad (liftM2)
import Control.Monad.Extra (concatMapM) import Control.Monad.Extra (concatMapM)
import Control.Monad.ListM (mapAccumM)
import qualified Control.Monad.State as S (State, runState, gets, modify) import qualified Control.Monad.State as S (State, runState, gets, modify)
import Data.Foldable (foldrM) import Data.Foldable (foldrM)
import Data.List ( (\\), elemIndex, nub, partition import Data.List ( (\\), elemIndex, nub, partition
...@@ -80,7 +79,7 @@ import Base.TypeExpansion ...@@ -80,7 +79,7 @@ import Base.TypeExpansion
import Base.Types import Base.Types
import Base.TypeSubst import Base.TypeSubst
import Base.Typing import Base.Typing
import Base.Utils (fst3) import Base.Utils (fst3, mapAccumM)
import Env.TypeConstructor (TCEnv, TypeInfo (..), qualLookupTypeInfo) import Env.TypeConstructor (TCEnv, TypeInfo (..), qualLookupTypeInfo)
import Env.Value (ValueEnv, ValueInfo (..), qualLookupValue) import Env.Value (ValueEnv, ValueInfo (..), qualLookupValue)
......
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