tracks/haskell/exercises/diamond/examples/success-standard/src/Diamond.hs in trackler-2.2.1.105 vs tracks/haskell/exercises/diamond/examples/success-standard/src/Diamond.hs in trackler-2.2.1.106
- old
+ new
@@ -7,10 +7,10 @@
oneRow :: Char -> (Int, Int) -> String
oneRow c (0, y) = pad y ++ [c] ++ pad y
oneRow c (x, y) = pad y ++ [c] ++ pad x ++ [c] ++ pad y
-diamond :: Char -> [String]
-diamond = (\x -> x ++ tail (reverse x)) . mkTop . subtract 64 . ord
+diamond :: Char -> Maybe [String]
+diamond = Just . (\x -> x ++ tail (reverse x)) . mkTop . subtract 64 . ord
where rows x = zip (0 : take (x-1) [1, 3..]) [x-1, x-2..0]
mkTop = zipWith oneRow abc . rows
abc = map chr [65..90]