Skip to content

Commit 46f24fb

Browse files
Fix Foldable1 instance; update CI to v0.14.0-rc5 (#44)
* Update CI to v0.14.0-rc5 * Fix Foldable1 instance; remove unused import * Fix compiler warning due to deprecation notice
1 parent 7f28783 commit 46f24fb

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- uses: purescript-contrib/setup-purescript@main
1616
with:
17-
purescript: "0.14.0-rc3"
17+
purescript: "0.14.0-rc5"
1818

1919
- uses: actions/setup-node@v1
2020
with:

src/Data/NonEmpty.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import Data.FoldableWithIndex (class FoldableWithIndex, foldMapWithIndex, foldlW
2222
import Data.FunctorWithIndex (class FunctorWithIndex, mapWithIndex)
2323
import Data.Maybe (Maybe(..), maybe)
2424
import Data.Ord (class Ord1)
25-
import Data.Semigroup.Foldable (class Foldable1, foldMap1)
25+
import Data.Semigroup.Foldable (class Foldable1)
2626
import Data.Semigroup.Foldable (foldl1) as Foldable1
2727
import Data.Traversable (class Traversable, traverse, sequence)
2828
import Data.TraversableWithIndex (class TraversableWithIndex, traverseWithIndex)
@@ -161,7 +161,6 @@ instance traversableWithIndexNonEmpty
161161
NonEmpty <$> f Nothing a <*> traverseWithIndex (f <<< Just) fa
162162

163163
instance foldable1NonEmpty :: Foldable f => Foldable1 (NonEmpty f) where
164-
fold1 = foldMap1 identity
165164
foldMap1 f (a :| fa) = foldl (\s a1 -> s <> f a1) (f a) fa
166165
foldr1 f (a :| fa) = maybe a (f a) $ foldr (\a1 -> Just <<< maybe a1 (f a1)) Nothing fa
167166
foldl1 f (a :| fa) = foldl f a fa

test/Main.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import Prelude
44

55
import Data.Foldable (fold, foldl)
66
import Data.Maybe (Maybe(..))
7-
import Data.NonEmpty (NonEmpty, (:|), foldl1, oneOf, head, tail, singleton)
8-
import Data.Semigroup.Foldable (fold1, foldr1)
7+
import Data.NonEmpty (NonEmpty, (:|), oneOf, head, tail, singleton)
8+
import Data.Semigroup.Foldable (fold1, foldl1, foldr1)
99
import Data.Unfoldable1 as U1
1010
import Effect (Effect)
1111
import Test.Assert (assert)

0 commit comments

Comments
 (0)