1
0
Fork 0
mirror of https://github.com/correl/elm.git synced 2025-03-29 01:09:02 -09:00
elm/exercises/nucleotide-count/NucleotideCount.example

15 lines
391 B
Text

module NucleotideCountExample where
import String
import List
nucleotideCounts : String -> List (Char, Int)
nucleotideCounts sequence = [
(getCount 'A' sequence),
(getCount 'T' sequence),
(getCount 'C' sequence),
(getCount 'G' sequence)
]
getCount : Char -> String -> (Char, Int)
getCount base sequence = (base, (List.length (String.split (String.fromChar base) sequence)) - 1)