@@ -0,0 +1,36 @@
1+module Data.NonEmptyList
16+toList :: List a -> [a]
25+instance Functor List where
26+ fmap func (List x xs) = List (func x) (map func xs)
29+instance Traversable List where
30+ traverse func (List x xs) = List <$> func x <*> traverse func xs
33+instance Foldable List where
34+ foldr step state (List x xs) = step x (foldr step state xs)
35+ foldl step state (List x xs) = foldl step (step state x) xs
36+ foldl1 step (List x xs) = foldl step x xs