I'm gonna be short.
I'm going through exercism exercises.
At one moment I had a beef with the compiler.
The 4th and 5th branches of this
if produce different types of values.
4| if x == 'G' then
6| else if x == 'C' then
8| else if x == 'T' then
10| else if x == 'A' then
13|> "There is an Unknown Character in the DNA sequence!!!"
The 4th branch has this type:
But the 5th is:
Hint: All the branches of an
if need to match so that no matter which one we
take, we get back the same type of value overall.
To me, it seemed unreasonable :)
Now, I'm just stuck here.
The definition of
toRNA does not match its type annotation.
17| toRNA : String -> Result Char String
18| toRNA dna =
19|> converted_to_list dna
20|> |> List.map convert
21|> |> String.fromList
The type annotation for
toRNA says it always returns:
Result Char String
But the returned value (shown above) is a:
Detected errors in 1 module.