Skip to content

Commit d7a3fa2

Browse files
committed
Updates for 0.12
1 parent 12fdaf1 commit d7a3fa2

File tree

10 files changed

+59
-66
lines changed

10 files changed

+59
-66
lines changed

bower.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-bifunctors": "^3.0.0",
21-
"purescript-maybe": "^3.0.0",
22-
"purescript-orders": "^3.0.0"
20+
"purescript-bifunctors": "#compiler/0.12",
21+
"purescript-maybe": "#compiler/0.12",
22+
"purescript-orders": "#compiler/0.12"
2323
},
2424
"devDependencies": {
25-
"purescript-assert": "^3.0.0",
26-
"purescript-console": "^3.0.0",
27-
"purescript-integers": "^3.0.0",
28-
"purescript-math": "^2.0.0"
25+
"purescript-assert": "#compiler/0.12",
26+
"purescript-console": "#compiler/0.12",
27+
"purescript-integers": "#compiler/0.12",
28+
"purescript-math": "#compiler/0.12"
2929
}
3030
}

src/Data/Bifoldable.purs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ module Data.Bifoldable where
33
import Prelude
44

55
import Control.Apply (applySecond)
6-
7-
import Data.Monoid (class Monoid, mempty)
86
import Data.Monoid.Conj (Conj(..))
97
import Data.Monoid.Disj (Disj(..))
108
import Data.Monoid.Dual (Dual(..))
@@ -127,7 +125,7 @@ bifoldMapDefaultL f g = bifoldl (\m a -> m <> f a) (\m b -> m <> g b) mempty
127125

128126
-- | Fold a data structure, accumulating values in a monoidal type.
129127
bifold :: forall t m. Bifoldable t => Monoid m => t m m -> m
130-
bifold = bifoldMap id id
128+
bifold = bifoldMap identity identity
131129

132130
-- | Traverse a data structure, accumulating effects using an `Applicative` functor,
133131
-- | ignoring the final result.
@@ -160,7 +158,7 @@ bisequence_
160158
=> Applicative f
161159
=> t (f a) (f b)
162160
-> f Unit
163-
bisequence_ = bitraverse_ id id
161+
bisequence_ = bitraverse_ identity identity
164162

165163
-- | Test whether a predicate holds at any position in a data structure.
166164
biany

src/Data/Bitraversable.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ bisequenceDefault
9292
=> Applicative f
9393
=> t (f a) (f b)
9494
-> f (t a b)
95-
bisequenceDefault = bitraverse id id
95+
bisequenceDefault = bitraverse identity identity
9696

9797
-- | Traverse a data structure, accumulating effects and results using an `Applicative` functor.
9898
bifor

src/Data/Foldable.purs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ module Data.Foldable
3434
import Prelude
3535

3636
import Control.Plus (class Plus, alt, empty)
37-
3837
import Data.Maybe (Maybe(..))
3938
import Data.Maybe.First (First(..))
4039
import Data.Maybe.Last (Last(..))
41-
import Data.Monoid (class Monoid, mempty)
4240
import Data.Monoid.Additive (Additive(..))
4341
import Data.Monoid.Conj (Conj(..))
4442
import Data.Monoid.Disj (Disj(..))
@@ -173,7 +171,7 @@ instance foldableMultiplicative :: Foldable Multiplicative where
173171

174172
-- | Fold a data structure, accumulating values in some `Monoid`.
175173
fold :: forall f m. Foldable f => Monoid m => f m -> m
176-
fold = foldMap id
174+
fold = foldMap identity
177175

178176
-- | Similar to 'foldl', but the result is encapsulated in a monad.
179177
-- |
@@ -230,7 +228,7 @@ for_ = flip traverse_
230228
-- | sequence_ [ trace "Hello, ", trace " world!" ]
231229
-- | ```
232230
sequence_ :: forall a f m. Applicative m => Foldable f => f (m a) -> m Unit
233-
sequence_ = traverse_ id
231+
sequence_ = traverse_ identity
234232

235233
-- | Combines a collection of elements using the `Alt` operation.
236234
oneOf :: forall f g a. Foldable f => Plus g => f (g a) -> g a
@@ -287,19 +285,19 @@ surroundMap d t f = unwrap (foldMap joined f) d
287285
-- | = "*1*2*3*"
288286
-- | ```
289287
surround :: forall f m. Foldable f => Semigroup m => m -> f m -> m
290-
surround d = surroundMap d id
288+
surround d = surroundMap d identity
291289

292290
-- | The conjunction of all the values in a data structure. When specialized
293291
-- | to `Boolean`, this function will test whether all of the values in a data
294292
-- | structure are `true`.
295293
and :: forall a f. Foldable f => HeytingAlgebra a => f a -> a
296-
and = all id
294+
and = all identity
297295

298296
-- | The disjunction of all the values in a data structure. When specialized
299297
-- | to `Boolean`, this function will test whether any of the values in a data
300298
-- | structure is `true`.
301299
or :: forall a f. Foldable f => HeytingAlgebra a => f a -> a
302-
or = any id
300+
or = any identity
303301

304302
-- | `all f` is the same as `and <<< map f`; map a function over the structure,
305303
-- | and then get the conjunction of the results.

src/Data/FoldableWithIndex.purs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import Data.FunctorWithIndex (mapWithIndex)
2323
import Data.Maybe (Maybe(..))
2424
import Data.Maybe.First (First)
2525
import Data.Maybe.Last (Last)
26-
import Data.Monoid (class Monoid, mempty)
2726
import Data.Monoid.Additive (Additive)
2827
import Data.Monoid.Conj (Conj(..))
2928
import Data.Monoid.Disj (Disj(..))
@@ -32,15 +31,15 @@ import Data.Monoid.Endo (Endo(..))
3231
import Data.Monoid.Multiplicative (Multiplicative)
3332
import Data.Newtype (unwrap)
3433

35-
-- | A `Foldable` with an additional index.
34+
-- | A `Foldable` with an additional index.
3635
-- | A `FoldableWithIndex` instance must be compatible with its `Foldable`
3736
-- | instance
3837
-- | ```purescript
3938
-- | foldr f = foldrWithIndex (const f)
4039
-- | foldl f = foldlWithIndex (const f)
4140
-- | foldMap f = foldMapWithIndex (const f)
4241
-- | ```
43-
-- |
42+
-- |
4443
-- | Default implementations are provided by the following functions:
4544
-- |
4645
-- | - `foldrWithIndexDefault`
@@ -156,9 +155,9 @@ instance foldableWithIndexMultiplicative :: FoldableWithIndex Unit Multiplicativ
156155
foldMapWithIndex f = foldMap $ f unit
157156

158157

159-
-- | Similar to 'foldlWithIndex', but the result is encapsulated in a monad.
158+
-- | Similar to 'foldlWithIndex', but the result is encapsulated in a monad.
160159
-- |
161-
-- | Note: this function is not generally stack-safe, e.g., for monads which
160+
-- | Note: this function is not generally stack-safe, e.g., for monads which
162161
-- | build up thunks a la `Eff`.
163162
foldWithIndexM
164163
:: forall i f m a b

src/Data/FunctorWithIndex.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ import Data.Monoid.Disj (Disj)
1313
import Data.Monoid.Dual (Dual)
1414
import Data.Monoid.Multiplicative (Multiplicative)
1515

16-
17-
-- | A `Functor` with an additional index.
16+
-- | A `Functor` with an additional index.
1817
-- | Instances must satisfy a modified form of the `Functor` laws
1918
-- | ```purescript
20-
-- | mapWithIndex (\_ a -> a) = id
19+
-- | mapWithIndex (\_ a -> a) = identity
2120
-- | mapWithIndex f . mapWithIndex g = mapWithIndex (\i -> f i <<< g i)
2221
-- | ```
2322
-- | and be compatible with the `Functor` instance

src/Data/Semigroup/Foldable.purs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Foldable t <= Foldable1 t where
3939

4040
-- | A default implementation of `fold1` using `foldMap1`.
4141
fold1Default :: forall t m. Foldable1 t => Semigroup m => t m -> m
42-
fold1Default = foldMap1 id
42+
fold1Default = foldMap1 identity
4343

4444
-- | A default implementation of `foldMap1` using `fold1`.
4545
foldMap1Default :: forall t m a. Foldable1 t => Functor t => Semigroup m => (a -> m) -> t a -> m
@@ -76,7 +76,7 @@ for1_ = flip traverse1_
7676
-- | Perform all of the effects in some data structure in the order
7777
-- | given by the `Foldable1` instance, ignoring the final result.
7878
sequence1_ :: forall t f a. Foldable1 t => Apply f => t (f a) -> f Unit
79-
sequence1_ = traverse1_ id
79+
sequence1_ = traverse1_ identity
8080

8181
maximum :: forall f a. Ord a => Foldable1 f => f a -> a
8282
maximum = ala Max foldMap1
@@ -96,7 +96,7 @@ instance semigroupJoinWith :: Semigroup a => Semigroup (JoinWith a) where
9696
-- | Fold a data structure using a `Semigroup` instance,
9797
-- | combining adjacent elements using the specified separator.
9898
intercalate :: forall f m. Foldable1 f => Semigroup m => m -> f m -> m
99-
intercalate = flip intercalateMap id
99+
intercalate = flip intercalateMap identity
100100

101101
-- | Fold a data structure, accumulating values in some `Semigroup`,
102102
-- | combining adjacent elements using the specified separator.

src/Data/Semigroup/Traversable.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Data.Traversable (class Traversable)
1919
-- | following sense:
2020
-- |
2121
-- | - `traverse1 f xs = sequence1 (f <$> xs)`
22-
-- | - `sequence1 = traverse1 id`
22+
-- | - `sequence1 = traverse1 identity`
2323
-- |
2424
-- | `Traversable1` instances should also be compatible with the corresponding
2525
-- | `Foldable1` instances, in the following sense:
@@ -59,4 +59,4 @@ sequence1Default
5959
=> Apply m
6060
=> t (m a)
6161
-> m (t a)
62-
sequence1Default = traverse1 id
62+
sequence1Default = traverse1 identity

src/Data/Traversable.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import Data.Traversable.Accum.Internal (StateL(..), StateR(..), stateL, stateR)
3636
-- | following sense:
3737
-- |
3838
-- | - `traverse f xs = sequence (f <$> xs)`
39-
-- | - `sequence = traverse id`
39+
-- | - `sequence = traverse identity`
4040
-- |
4141
-- | `Traversable` instances should also be compatible with the corresponding
4242
-- | `Foldable` instances, in the following sense:
@@ -68,7 +68,7 @@ sequenceDefault
6868
=> Applicative m
6969
=> t (m a)
7070
-> m (t a)
71-
sequenceDefault = traverse id
71+
sequenceDefault = traverse identity
7272

7373
instance traversableArray :: Traversable Array where
7474
traverse = traverseArrayImpl apply map pure

0 commit comments

Comments
 (0)