Skip to content

Instantly share code, notes, and snippets.

@amonshiz
Last active August 29, 2015 14:12
Show Gist options
  • Save amonshiz/51b02cd689319038645e to your computer and use it in GitHub Desktop.
Save amonshiz/51b02cd689319038645e to your computer and use it in GitHub Desktop.
Solving Counting DNA Nucleotides on Project Rosalind
countingDNANucleotides = foldl (\(a,c,g,t) x -> if x == 'A' then (a+1,c,g,t) else if x == 'C' then (a,c+1,g,t) else if x == 'G' then (a,c,g+1,t) else if x == 'T' then (a,c,g,t+1) else (a,c,g,t)) (0,0,0,0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment