@@ -5,8 +5,8 @@ import Prelude
55import Control.Monad.Eff (Eff )
66import Control.Monad.Eff.Console (log , CONSOLE )
77
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_ )
1010import Data.Maybe (Maybe (..), isNothing , fromJust )
1111import Data.NonEmpty ((:|))
1212import Data.NonEmpty as NE
@@ -308,6 +308,17 @@ testArray = do
308308 assert $ length arr == n
309309 assert $ all (_ == elem) arr
310310
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+
311322nil :: Array Int
312323nil = []
313324
0 commit comments