Created
February 15, 2015 14:37
-
-
Save amonshiz/5b1090712f9c6e8032d1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified Bioinformatics.DNANucleotide as D | |
hammingDistance :: (Eq a) => [a] -> [a] -> Int | |
hammingDistance l1 l2 = sum . map (\(f,s) -> if f == s then 0 else 1) $ zip l1 l2 | |
main = do | |
string1 <- getLine | |
string2 <- getLine | |
let dnaString1 = map D.charToDNANucleotide string1 | |
let dnaString2 = map D.charToDNANucleotide string2 | |
putStrLn . show $ hammingDistance dnaString1 dnaString2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment