Last active
August 29, 2015 14:12
-
-
Save amonshiz/70e8b507fb1086aed11a to your computer and use it in GitHub Desktop.
Solving Counting DNA Nucleotides on Project Rosalind
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 Data.Char | |
import Data.List | |
data DNANucleotide = A | C | G | T deriving(Show, Eq, Ord, Read) | |
charToDNANucleotide :: Char -> DNANucleotide | |
charToDNANucleotide c = read [toUpper c] :: DNANucleotide | |
mainCountDNANucleotides = do | |
dna <- getLine | |
putStrLn $ unwords . map show . map length . group . sort $ map charToDNANucleotide dna |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment