Member-only story
Processing DNA Strings With Unison
Use the Unison functional programming language to process DNA text strings

Whenever I learn a new programming language, I like to do simple exercises which doesn’t require knowing a large API but which expose you to the basics of the language. Project Rosalind is a fun site to get familiar with working with arrays, strings, characters, and common higher-order functions such as map
, fold
and filter
.
The Rosalind problems are more text oriented than Project Euler problems, which are more math oriented. The Euler projects take a bit more time to figure out and solve for me.
Project Rosalind Problems
To understand Rosalind problems, it is useful to know a few things about how DNA and RNA are represented in computing. DNA is represented as text strings consisting only of the characters A, C, G, T. So ATGCTTCAGAAAGGTCTTACG
would be an example of a DNA text string.
Counting DNA Nucleotides
The problem described here, involves counting the number of A, C, G and T characters in a DNA string. The sample
and output
variables are just to compare your output and see if you get the expected output.