@@ -5,8 +5,8 @@ import Prelude
5
5
import Control.Monad.Eff (Eff )
6
6
import Control.Monad.Eff.Console (log , CONSOLE )
7
7
8
- import Data.Array (range , replicate , foldM , unzip , zip , zipWithA , zipWith , intersectBy , intersect , (\\), deleteBy , delete , unionBy , union , nubBy , nub , groupBy , group' , group , span , dropWhile , drop , takeWhile , take , sortBy , sort , catMaybes , mapMaybe , mapWithIndex , filterM , filter , concat , concatMap , reverse , alterAt , modifyAt , updateAt , deleteAt , insertAt , findLastIndex , findIndex , elemLastIndex , elemIndex , (!!), uncons , init , tail , last , head , insertBy , insert , snoc , (:), length , null , singleton , fromFoldable )
9
- import Data.Foldable (for_ , foldMapDefaultR , class Foldable , all )
8
+ import Data.Array (range , replicate , foldM , unzip , zip , zipWithA , zipWith , intersectBy , intersect , (\\), deleteBy , delete , unionBy , union , nubBy , nub , groupBy , group' , group , span , dropWhile , drop , takeWhile , take , sortBy , sort , catMaybes , mapMaybe , mapWithIndex , filterM , filter , concat , concatMap , reverse , alterAt , modifyAt , updateAt , deleteAt , insertAt , findLastIndex , findIndex , elemLastIndex , elemIndex , (!!), uncons , init , tail , last , head , insertBy , insert , snoc , (:), length , null , singleton , fromFoldable , toUnfoldable )
9
+ import Data.Foldable (for_ , foldMapDefaultR , class Foldable , all , traverse_ )
10
10
import Data.Maybe (Maybe (..), isNothing , fromJust )
11
11
import Data.NonEmpty ((:|))
12
12
import Data.NonEmpty as NE
@@ -308,6 +308,17 @@ testArray = do
308
308
assert $ length arr == n
309
309
assert $ all (_ == elem) arr
310
310
311
+ log " toUnfoldable"
312
+ let toUnfoldableId xs = toUnfoldable xs == xs
313
+ traverse_ (assert <<< toUnfoldableId)
314
+ [ []
315
+ , [1 ]
316
+ , [1 ,2 ,3 ]
317
+ , [2 ,3 ,1 ]
318
+ , [4 ,0 ,0 ,1 ,25 ,36 ,458 ,5842 ,23757 ]
319
+ ]
320
+
321
+
311
322
nil :: Array Int
312
323
nil = []
313
324
0 commit comments