File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1616 " package.json"
1717 ],
1818 "dependencies" : {
19- "purescript-foldable-traversable" : " ^3.0 .0" ,
19+ "purescript-foldable-traversable" : " ^3.3 .0" ,
2020 "purescript-nonempty" : " ^4.0.0" ,
2121 "purescript-partial" : " ^1.2.0" ,
2222 "purescript-st" : " ^3.0.0" ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ module Data.Array.NonEmpty
66 , toNonEmpty
77
88 , fromFoldable
9+ , fromFoldable1
910 , toUnfoldable
1011 , singleton
1112 , (..), range
@@ -109,6 +110,7 @@ import Data.FunctorWithIndex (class FunctorWithIndex)
109110import Data.Maybe (Maybe (..), fromJust )
110111import Data.NonEmpty (NonEmpty , (:|))
111112import Data.Ord (class Ord1 )
113+ import Data.Semigroup.Foldable (class Foldable1 )
112114import Data.Traversable (class Traversable )
113115import Data.TraversableWithIndex (class TraversableWithIndex )
114116import Data.Tuple (Tuple )
@@ -209,6 +211,9 @@ toNonEmpty = uncons >>> \{head: x, tail: xs} -> x :| xs
209211fromFoldable :: forall f a . Foldable f => f a -> Maybe (NonEmptyArray a )
210212fromFoldable = fromArray <<< A .fromFoldable
211213
214+ fromFoldable1 :: forall f a . Foldable1 f => f a -> NonEmptyArray a
215+ fromFoldable1 = unsafeFromArray <<< A .fromFoldable
216+
212217toUnfoldable :: forall f a . Unfoldable f => NonEmptyArray a -> f a
213218toUnfoldable = adaptAny A .toUnfoldable
214219
You can’t perform that action at this time.
0 commit comments