Skip to content

Commit b43e8c7

Browse files
committed
Fix warnings generated by purescript-0.8.0
1 parent 83c9dab commit b43e8c7

File tree

4 files changed

+44
-60
lines changed

4 files changed

+44
-60
lines changed

src/Data/List.purs

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module Data.List
2222
, null
2323
, length
2424

25-
, (:)
25+
, (:), cons
2626
, snoc
2727
, insert
2828
, insertBy
@@ -71,7 +71,7 @@ module Data.List
7171
, unionBy
7272
, delete
7373
, deleteBy
74-
, (\\)
74+
, (\\), difference
7575
, intersect
7676
, intersectBy
7777

@@ -88,20 +88,20 @@ module Data.List
8888
, fromList
8989
) where
9090

91-
import Prelude
91+
import Prelude (class Monad, class Bind, class Applicative, class Apply, class Functor, class Semigroup, class Ord, class Eq, class Show, Ordering(EQ, GT, LT), append, flip, (<*>), (<$>), (<>), pure, (<<<), ($), compare, (==), (&&), show, (++), (>>=), return, not, eq, (-), otherwise, (/=), id, bind, (+), one, (<), (<=), negate, (>))
9292

93-
import Control.Alt (Alt, (<|>))
94-
import Control.Alternative (Alternative)
95-
import Control.Lazy (Lazy, defer)
96-
import Control.MonadPlus (MonadPlus)
97-
import Control.Plus (Plus)
93+
import Control.Alt (class Alt, (<|>))
94+
import Control.Alternative (class Alternative)
95+
import Control.Lazy (class Lazy, defer)
96+
import Control.MonadPlus (class MonadPlus)
97+
import Control.Plus (class Plus)
9898

99-
import Data.Foldable (Foldable, foldl, foldr, any)
99+
import Data.Foldable (class Foldable, foldl, foldr, any)
100100
import Data.Maybe (Maybe(..))
101-
import Data.Monoid (Monoid, mempty)
102-
import Data.Traversable (Traversable, traverse, sequence)
101+
import Data.Monoid (class Monoid, mempty)
102+
import Data.Traversable (class Traversable, traverse, sequence)
103103
import Data.Tuple (Tuple(..))
104-
import Data.Unfoldable (Unfoldable, unfoldr)
104+
import Data.Unfoldable (class Unfoldable, unfoldr)
105105

106106
-- | A strict linked list.
107107
-- |
@@ -132,11 +132,8 @@ fromFoldable = foldr Cons Nil
132132
singleton :: forall a. a -> List a
133133
singleton a = Cons a Nil
134134

135-
infix 8 ..
136-
137135
-- | An infix synonym for `range`.
138-
(..) :: Int -> Int -> List Int
139-
(..) = range
136+
infix 8 range as ..
140137

141138
-- | Create a list containing a range of integers, including both endpoints.
142139
range :: Int -> Int -> List Int
@@ -196,14 +193,13 @@ length = foldl (\acc _ -> acc + 1) 0
196193
-- Extending arrays ------------------------------------------------------------
197194
--------------------------------------------------------------------------------
198195

199-
infixr 6 :
200-
201196
-- | An infix alias for `Cons`; attaches an element to the front of
202197
-- | a list.
203198
-- |
204199
-- | Running time: `O(1)`
205-
(:) :: forall a. a -> List a -> List a
206-
(:) = Cons
200+
cons :: forall a. a -> List a -> List a
201+
cons = Cons
202+
infixr 6 cons as :
207203

208204
-- | Append an element to the end of an array, creating a new array.
209205
-- |
@@ -285,11 +281,8 @@ index Nil _ = Nothing
285281
index (Cons a _) 0 = Just a
286282
index (Cons _ as) i = index as (i - 1)
287283

288-
infixl 8 !!
289-
290284
-- | An infix synonym for `index`.
291-
(!!) :: forall a. List a -> Int -> Maybe a
292-
(!!) = index
285+
infixl 8 index as !!
293286

294287
-- | Find the index of the first element equal to the specified element.
295288
elemIndex :: forall a. (Eq a) => a -> List a -> Maybe Int
@@ -614,13 +607,13 @@ deleteBy _ _ Nil = Nil
614607
deleteBy (==) x (Cons y ys) | x == y = ys
615608
deleteBy (==) x (Cons y ys) = Cons y (deleteBy (==) x ys)
616609

617-
infix 5 \\
610+
infix 5 difference as \\
618611

619612
-- | Delete the first occurrence of each element in the second list from the first list.
620613
-- |
621614
-- | Running time: `O(n^2)`
622-
(\\) :: forall a. (Eq a) => List a -> List a -> List a
623-
(\\) = foldl (flip delete)
615+
difference :: forall a. (Eq a) => List a -> List a -> List a
616+
difference = foldl (flip delete)
624617

625618
-- | Calculate the intersection of two lists.
626619
-- |

src/Data/List/Lazy.purs

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ module Data.List.Lazy
7878
, unionBy
7979
, delete
8080
, deleteBy
81-
, (\\)
81+
, (\\), difference
8282
, intersect
8383
, intersectBy
8484

@@ -94,21 +94,21 @@ module Data.List.Lazy
9494
, fromList
9595
) where
9696

97-
import Prelude
97+
import Prelude (class Monad, class Bind, class Applicative, class Apply, class Functor, class Semigroup, class Ord, class Eq, class Show, Ordering(EQ, GT, LT), append, flip, ap, (<*>), (<$>), pure, (<>), (<<<), ($), compare, (==), (++), show, otherwise, not, eq, (-), id, (>>=), (+), negate, (>))
9898

99-
import Control.Alt (Alt)
100-
import Control.Alternative (Alternative)
101-
import Control.MonadPlus (MonadPlus)
102-
import Control.Plus (Plus)
103-
import qualified Control.Lazy as Z
99+
import Control.Alt (class Alt)
100+
import Control.Alternative (class Alternative)
101+
import Control.MonadPlus (class MonadPlus)
102+
import Control.Plus (class Plus)
103+
import Control.Lazy as Z
104104

105-
import Data.Foldable (Foldable, foldMap, foldl, foldr, any)
105+
import Data.Foldable (class Foldable, foldMap, foldl, foldr, any)
106106
import Data.Lazy (Lazy(), defer, force)
107107
import Data.Maybe (Maybe(..), isNothing)
108-
import Data.Monoid (Monoid, mempty)
109-
import Data.Traversable (Traversable, traverse, sequence)
108+
import Data.Monoid (class Monoid, mempty)
109+
import Data.Traversable (class Traversable, traverse, sequence)
110110
import Data.Tuple (Tuple(..))
111-
import Data.Unfoldable (Unfoldable, unfoldr)
111+
import Data.Unfoldable (class Unfoldable, unfoldr)
112112

113113

114114
-- | A lazy linked list.
@@ -159,8 +159,7 @@ singleton :: forall a. a -> List a
159159
singleton a = cons a nil
160160

161161
-- | An infix synonym for `range`.
162-
(..) :: Int -> Int -> List Int
163-
(..) = range
162+
infix 8 range as ..
164163

165164
-- | Create a list containing a range of integers, including both endpoints.
166165
range :: Int -> Int -> List Int
@@ -211,14 +210,11 @@ length xs = go (step xs)
211210
cons :: forall a. a -> List a -> List a
212211
cons x xs = List $ defer \_ -> Cons x xs
213212

214-
infixr 6 :
215-
216213
-- | An infix alias for `cons`; attaches an element to the front of
217214
-- | a list.
218215
-- |
219216
-- | Running time: `O(1)`
220-
(:) :: forall a. a -> List a -> List a
221-
(:) = cons
217+
infixr 6 cons as :
222218

223219
-- | Insert an element into a sorted list.
224220
-- |
@@ -299,11 +295,8 @@ index xs = go (step xs)
299295
go (Cons a _) 0 = Just a
300296
go (Cons _ as) i = go (step as) (i - 1)
301297

302-
infixl 8 !!
303-
304298
-- | An infix synonym for `index`.
305-
(!!) :: forall a. List a -> Int -> Maybe a
306-
(!!) = index
299+
infixl 8 index as !!
307300

308301
-- | Insert an element into a list at the specified index, returning a new
309302
-- | list or `Nothing` if the index is out-of-bounds.
@@ -574,13 +567,12 @@ deleteBy eq x xs = List (go <$> runList xs)
574567
go (Cons y ys) | eq x y = step ys
575568
| otherwise = Cons y (deleteBy eq x ys)
576569

577-
infix 5 \\
578-
579570
-- | Delete the first occurrence of each element in the second list from the first list.
580571
-- |
581572
-- | Running time: `O(n^2)`
582-
(\\) :: forall a. (Eq a) => List a -> List a -> List a
583-
(\\) = foldl (flip delete)
573+
difference :: forall a. (Eq a) => List a -> List a -> List a
574+
difference = foldl (flip delete)
575+
infix 5 difference as \\
584576

585577
-- | Calculate the intersection of two lists.
586578
-- |

src/Data/List/Unsafe.purs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ module Data.List.Unsafe
1010
, init
1111
) where
1212

13-
import Prelude
1413
import Data.List (List(..))
1514

1615
-- | Get the first element of a non-empty list.

src/Data/List/ZipList.purs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ module Data.List.ZipList
66
, runZipList
77
) where
88

9-
import Prelude
9+
import Prelude (class Applicative, class Apply, class Functor, class Semigroup, class Ord, class Eq, class Show, append, (<<<), ($), map, (<$>), (++), compare, eq, show)
1010

11-
import Control.Alt (Alt)
12-
import Control.Alternative (Alternative)
13-
import Control.Plus (Plus)
11+
import Control.Alt (class Alt)
12+
import Control.Alternative (class Alternative)
13+
import Control.Plus (class Plus)
1414

15-
import Data.Foldable (Foldable, foldMap, foldl, foldr)
15+
import Data.Foldable (class Foldable, foldMap, foldl, foldr)
1616
import Data.List.Lazy (List(), repeat, zipWith)
17-
import Data.Monoid (Monoid, mempty)
18-
import Data.Traversable (Traversable, traverse, sequence)
17+
import Data.Monoid (class Monoid, mempty)
18+
import Data.Traversable (class Traversable, traverse, sequence)
1919

2020
-- | `ZipList` is a newtype around `List` which provides a zippy
2121
-- | `Applicative` instance.

0 commit comments

Comments
 (0)