Sha256: 0e86c9ddcd028f65f9087cf7bd63597b557e25bcc822f2274a08eecbace6ca8b
Contents?: true
Size: 488 Bytes
Versions: 200
Compression:
Stored size: 488 Bytes
Contents
object RnaTranscription { private type Strand = String private type Nucleotide = Char def toRna(dna: Strand): Option[Strand] = dna.foldRight (Option("")) { case (char, rna) => for { rnaNucleotide <- toRnaNucleotide(char) rnaStrand <- rna } yield rnaNucleotide +: rnaStrand } private val DnaToRna = Map('G' -> 'C', 'C' -> 'G', 'T' -> 'A', 'A' -> 'U') private def toRnaNucleotide(char: Char): Option[Nucleotide] = DnaToRna get char }
Version data entries
200 entries across 200 versions & 1 rubygems