@@ -8,7 +8,7 @@ import Control.Monad.Eff.Console (CONSOLE, log)
88import Data.Bifoldable (class Bifoldable , bifoldl , bifoldr , bifoldMap , bifoldrDefault , bifoldlDefault , bifoldMapDefaultR , bifoldMapDefaultL )
99import Data.Bifunctor (class Bifunctor , bimap )
1010import Data.Bitraversable (class Bitraversable , bisequenceDefault , bitraverse , bisequence , bitraverseDefault )
11- import Data.Foldable (class Foldable , foldl , foldr , foldMap , foldrDefault , foldlDefault , foldMapDefaultR , foldMapDefaultL , minimumBy , minimum , maximumBy , maximum , find , findMap , null )
11+ import Data.Foldable (class Foldable , foldl , foldr , foldMap , foldrDefault , foldlDefault , foldMapDefaultR , foldMapDefaultL , minimumBy , minimum , maximumBy , maximum , find , findMap , length , null )
1212import Data.Function (on )
1313import Data.Int (toNumber )
1414import Data.Maybe (Maybe (..))
@@ -110,6 +110,13 @@ main = do
110110 assert $ null [0 ] == false
111111 assert $ null [0 ,1 ] == false
112112
113+ log " Test length"
114+ assert $ length Nothing == 0
115+ assert $ length (Just 1 ) == 1
116+ assert $ length [] == 0
117+ assert $ length [1 ] == 1
118+ assert $ length [1 , 2 ] == 2
119+
113120 log " All done!"
114121
115122
0 commit comments