@@ -73,16 +73,16 @@ module Data.Array
73
73
, foldM
74
74
) where
75
75
76
+ import Prelude
76
77
import Control.Alt (Alt , (<|>))
77
78
import Control.Alternative (Alternative )
78
79
import Control.Lazy (Lazy , defer )
79
80
import Control.MonadPlus (MonadPlus )
80
81
import Control.Plus (Plus )
81
- import Data.Foldable (Foldable , foldr )
82
82
import Data.Functor.Invariant (Invariant , imapF )
83
83
import Data.Maybe (Maybe (..), maybe , isJust )
84
84
import Data.Monoid (Monoid , mempty )
85
- import Data.Traversable (Traversable , traverse , sequence )
85
+ import Data.Traversable (sequence )
86
86
import Data.Tuple (Tuple (..))
87
87
88
88
-- ------------------------------------------------------------------------------
@@ -481,29 +481,3 @@ foldM f a = uncons' (\_ -> return a) (\b bs -> f a b >>= \a' -> foldM f a' bs)
481
481
foreign import foldrArray :: forall a b . (a -> b -> b ) -> b -> Array a -> b
482
482
483
483
foreign 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