Sha256: 897469b7baa56b3b2dec525f7a91085ecf4af7d9097fa75aa7adf2983ffff827

Contents?: true

Size: 499 Bytes

Versions: 154

Compression:

Stored size: 499 Bytes

Contents

fun toRna dna =
  let
    fun translate #"G" = SOME #"C"
      | translate #"C" = SOME #"G"
      | translate #"T" = SOME #"A"
      | translate #"A" = SOME #"U"
      | translate _    = NONE

    fun reducer (_, NONE)     = NONE
      | reducer (x, SOME acc) = 
          let
            val t = translate x
          in
            case t of
              NONE => NONE
            | SOME c => SOME (c :: acc)
          end
  in
    Option.map implode (foldr reducer (SOME []) (explode dna))
  end

Version data entries

154 entries across 154 versions & 1 rubygems

Version Path
trackler-2.2.1.139 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.138 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.137 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.136 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.135 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.134 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.133 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.132 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.131 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.130 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.129 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.128 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.127 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.126 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.125 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.124 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.123 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.122 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.121 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.120 tracks/sml/exercises/rna-transcription/example.sml