module Exercise_8 where import Data.List {-WETT-} shoefa :: (Num a, Ord a) => [a] -> Int shoefa = length . drop 1 . group . map signum . filter (/= 0) {- shoefa xs = length $ drop 1 $ groupBy (\x y -> signum x * signum y >= 0) xs -} {- shoefa xs = length $ drop 1 $ group $ map signum $ filter (/= 0) xs -} {- shoefa xs = if a == 0 then 0 else pred a where a = length (group $ map signum $ filter (/= 0) xs) -} {-TTEW-}