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.180 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.179 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.178 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.177 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.176 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.175 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.174 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.173 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.172 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.171 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.170 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.169 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.167 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.166 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.165 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.164 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.163 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.162 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.161 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.160 tracks/sml/exercises/rna-transcription/example.sml