Guest User

Untitled

a guest
Jul 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. module DNA (nucleotideCounts) where
  2.  
  3. import Data.Map (Map)
  4.  
  5. countLetters :: String -> Char -> Int
  6. countLetters str c = length $ filter (== c) str
  7.  
  8. nucleotideCounts :: String -> Either String (Map Char Int)
  9. nucleotideCounts xs = go xs [] where
  10. go [] acc = Right acc
  11. go (x:xs) acc = if x `elem` "ACGT" then ???? else Left "error"
Add Comment
Please, Sign In to add comment