@@ -73,16 +73,16 @@ module Data.Array
7373 , foldM
7474 ) where
7575
76+ import Prelude
7677import Control.Alt (Alt , (<|>))
7778import Control.Alternative (Alternative )
7879import Control.Lazy (Lazy , defer )
7980import Control.MonadPlus (MonadPlus )
8081import Control.Plus (Plus )
81- import Data.Foldable (Foldable , foldr )
8282import Data.Functor.Invariant (Invariant , imapF )
8383import Data.Maybe (Maybe (..), maybe , isJust )
8484import Data.Monoid (Monoid , mempty )
85- import Data.Traversable (Traversable , traverse , sequence )
85+ import Data.Traversable (sequence )
8686import Data.Tuple (Tuple (..))
8787
8888-- ------------------------------------------------------------------------------
@@ -481,29 +481,3 @@ foldM f a = uncons' (\_ -> return a) (\b bs -> f a b >>= \a' -> foldM f a' bs)
481481foreign import foldrArray :: forall a b . (a -> b -> b ) -> b -> Array a -> b
482482
483483foreign import foldlArray :: forall a b . (b -> a -> b ) -> b -> Array a -> b
484-
485- -- ------------------------------------------------------------------------------
486- -- Non-Prelude instances -------------------------------------------------------
487- -- ------------------------------------------------------------------------------
488-
489- instance altArray :: Alt Array where
490- alt = append
491-
492- instance plusArray :: Plus Array where
493- empty = []
494-
495- instance alternativeArray :: Alternative Array
496-
497- instance monadPlusArray :: MonadPlus Array
498-
499- instance foldableArray :: Foldable Array where
500- foldr f z xs = foldrArray f z xs
501- foldl f z xs = foldlArray f z xs
502- foldMap f xs = foldr (\x acc -> f x <> acc) mempty xs
503-
504- instance traversableArray :: Traversable Array where
505- traverse f = uncons' (\_ -> pure [] ) (\x xs -> (:) <$> (f x) <*> traverse f xs)
506- sequence = uncons' (\_ -> pure [] ) (\x xs -> (:) <$> x <*> sequence xs)
507-
508- instance invariantArray :: Invariant Array where
509- imap = imapF
0 commit comments