From e04dcb782b5335447cb676ebe7e4541cdccdaa38 Mon Sep 17 00:00:00 2001 From: rbasso Date: Sun, 25 Sep 2016 03:04:32 +0900 Subject: [PATCH] hamming: Improve code based on HLint's suggestions. --- exercises/hamming/src/Example.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/hamming/src/Example.hs b/exercises/hamming/src/Example.hs index 0be8647e5..255c5309a 100644 --- a/exercises/hamming/src/Example.hs +++ b/exercises/hamming/src/Example.hs @@ -1,6 +1,6 @@ module Hamming (distance) where distance :: Integral a => String -> String -> Maybe a -distance (x:xs) (y:ys) = fmap (if x /= y then (+1) else id) $ distance xs ys +distance (x:xs) (y:ys) = (if x /= y then (+1) else id) <$> distance xs ys distance [] [] = Just 0 distance _ _ = Nothing