learning F#, it seems pretty cool, favourite functional language so far.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
Lachlan Jacob 5493170dc4 RNA problem done 5 年前
..
README.md RNA problem done 5 年前
RnaTranscription.fs RNA problem done 5 年前
RnaTranscription.fsproj RNA problem done 5 年前
RnaTranscriptionTests.fs RNA problem done 5 年前

README.md

RNA Transcription

Given a DNA strand, return its RNA complement (per RNA transcription).

Both DNA and RNA strands are a sequence of nucleotides.

The four nucleotides found in DNA are adenine (A), cytosine (C), guanine (G) and thymine (T).

The four nucleotides found in RNA are adenine (A), cytosine (C), guanine (G) and uracil (U).

Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement:

  • G -> C
  • C -> G
  • T -> A
  • A -> U

Hints

For this exercise the following F# feature comes in handy:

  • Match Expressions While this can be solved using a dictionary, using a match expression is more idiomatic.

Running the tests

To run the tests, run the command dotnet test from within the exercise directory.

Autoformatting the code

F# source code can be formatted with the Fantomas tool.

After installing it with dotnet tool restore, run dotnet fantomas . to format code within the current directory.

Further information

For more detailed information about the F# track, including how to get help if you’re having trouble, please visit the exercism.io F# language page.

Source

Hyperphysics http://hyperphysics.phy-astr.gsu.edu/hbase/Organic/transcription.html