You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hamming 2.3.0.10: Add empty strand test cases (#796)
The following solution passes all the current tests but fail on the new ones:
module Hamming (distance) where
distance :: String -> String -> Maybe Int
distance [] [] = Just 0
distance (x:xs) (y:ys)
| length(xs) /= length(ys) = Nothing
| x /= y = fmap (1 + ) (distance xs ys)
| x == y = distance xs ys
The problem is insufficient pattern matching against an empty strand.
This PR adds two test cases that address the possibility that one strand is
empty and the other one isn't.
This PR addresses exercism/problem-specifications#1450
0 commit comments