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.119 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.118 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.117 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.116 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.115 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.114 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.113 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.111 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.110 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.109 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.108 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.107 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.106 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.105 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.104 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.103 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.102 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.101 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.100 tracks/sml/exercises/rna-transcription/example.sml
trackler-2.2.1.99 tracks/sml/exercises/rna-transcription/example.sml