-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1311 from etrepum/rna-1310
#1310 haskell rna-transcription now matches README
- Loading branch information
Showing
2 changed files
with
16 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
module DNA (toRNA) where | ||
|
||
replaceThymidine :: Char -> Char | ||
replaceThymidine 'T' = 'U' | ||
replaceThymidine nucleotide = nucleotide | ||
replaceThymidine c = case c of | ||
'C' -> 'G' | ||
'G' -> 'C' | ||
'A' -> 'U' | ||
'T' -> 'A' | ||
_ -> error $ "Invalid nucleotide " ++ show c | ||
|
||
toRNA :: String -> String | ||
toRNA = map replaceThymidine |
This file contains 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