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    []     []  = Just 0
distance     _      _  = Nothing

module Hamming (distance) where

distance :: Integral a => String -> String -> Maybe a
distance (x:xs) (y:ys) = (if x /= y then (+1) else id) <$> distance xs ys
distance    []     []  = Just 0
distance     _      _  = Nothing

Improve code based on HLint's suggestions.
hamming: Improve code based on HLint's suggestions.
