Skip to content

Commit cefcfb0

Browse files
committed
Fix warnings generated by purescript 0.8.0
1 parent e47d505 commit cefcfb0

File tree

2 files changed

+15
-28
lines changed

2 files changed

+15
-28
lines changed

src/Data/Array.purs

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module Data.Array
8989
, delete
9090
, deleteBy
9191

92-
, (\\)
92+
, (\\), difference
9393
, intersect
9494
, intersectBy
9595

@@ -101,21 +101,17 @@ module Data.Array
101101
, foldM
102102
) where
103103

104-
import Prelude
104+
import Prelude (class Monad, class Applicative, class Eq, class Ord, Unit, Ordering(LT, EQ, GT), (>>=), return, eq, const, otherwise, ($), flip, (++), (==), not, (<<<), negate, compare, id, bind, pure, one, (-), zero, (+), (<*>), (<$>), (<))
105105

106-
import Control.Alt (Alt, (<|>))
107-
import Control.Alternative (Alternative)
108-
import Control.Lazy (Lazy, defer)
109-
import Control.MonadPlus (MonadPlus)
110-
import Control.Plus (Plus)
106+
import Control.Alt ((<|>))
107+
import Control.Alternative (class Alternative)
108+
import Control.Lazy (class Lazy, defer)
111109

112110
import Data.Foldable (foldl)
113-
import Data.Functor.Invariant (Invariant)
114111
import Data.Maybe (Maybe(..), maybe, isJust)
115-
import Data.Monoid (Monoid)
116112
import Data.Traversable (sequence)
117113
import Data.Tuple (Tuple(..))
118-
import qualified Data.Maybe.Unsafe as U
114+
import Data.Maybe.Unsafe as U
119115

120116
-- | Create an array of one element
121117
singleton :: forall a. a -> Array a
@@ -124,11 +120,8 @@ singleton a = [a]
124120
-- | Create an array containing a range of integers, including both endpoints.
125121
foreign import range :: Int -> Int -> Array Int
126122

127-
infix 8 ..
128-
129123
-- | An infix synonym for `range`.
130-
(..) :: Int -> Int -> Array Int
131-
(..) = range
124+
infix 8 range as ..
132125

133126
-- | Create an array with repeated instances of a value.
134127
foreign import replicate :: forall a. Int -> a -> Array a
@@ -177,13 +170,10 @@ foreign import length :: forall a. Array a -> Int
177170
-- | Note, the running time of this function is `O(n)`.
178171
foreign import cons :: forall a. a -> Array a -> Array a
179172

180-
infixr 6 :
181-
182173
-- | An infix alias for `cons`.
183174
-- |
184175
-- | Note, the running time of this function is `O(n)`.
185-
(:) :: forall a. a -> Array a -> Array a
186-
(:) = cons
176+
infixr 6 cons as :
187177

188178
-- | Append an element to the end of an array, creating a new array.
189179
foreign import snoc :: forall a. Array a -> a -> Array a
@@ -265,11 +255,8 @@ foreign import indexImpl :: forall a. (forall r. r -> Maybe r)
265255
-> Int
266256
-> Maybe a
267257

268-
infixl 8 !!
269-
270258
-- | An infix version of `index`.
271-
(!!) :: forall a. Array a -> Int -> Maybe a
272-
(!!) = index
259+
infixl 8 index as !!
273260

274261
-- | Find the index of the first element equal to the specified element.
275262
elemIndex :: forall a. (Eq a) => a -> Array a -> Maybe Int
@@ -524,13 +511,13 @@ deleteBy :: forall a. (a -> a -> Boolean) -> a -> Array a -> Array a
524511
deleteBy _ _ [] = []
525512
deleteBy eq x ys = maybe ys (\i -> U.fromJust $ deleteAt i ys) (findIndex (eq x) ys)
526513

527-
infix 5 \\
528-
529514
-- | Delete the first occurrence of each element in the second array from the
530515
-- | first array, creating a new array.
531-
(\\) :: forall a. (Eq a) => Array a -> Array a -> Array a
532-
(\\) xs ys | null xs = []
533-
| otherwise = uncons' (const xs) (\y ys -> delete y xs \\ ys) ys
516+
difference :: forall a. (Eq a) => Array a -> Array a -> Array a
517+
difference xs ys | null xs = []
518+
| otherwise = uncons' (const xs) (\z zs -> delete z xs \\ zs) ys
519+
520+
infix 5 difference as \\
534521

535522
-- | Calculate the intersection of two arrays, creating a new array.
536523
intersect :: forall a. (Eq a) => Array a -> Array a -> Array a

src/Data/Array/Unsafe.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
module Data.Array.Unsafe where
77

8-
import Prelude
8+
import Prelude ((-))
99

1010
import Data.Array (length, slice)
1111

0 commit comments

Comments
 (0)