I'm starting at Haskell and doing her exercises on Exercism . When I sent a code, I was comparing it with others and I came across a similar one to mine, but I used a definition of guards (I do not know if it is guard I saw in a place calling function by pattern matching , but not sure) different:
-- Minha função
transcribe :: Char -> Maybe Char
transcribe nucleotide
| nucleotide == 'G' = Just 'C'
| nucleotide == 'C' = Just 'G'
| nucleotide == 'T' = Just 'A'
| nucleotide == 'A' = Just 'U'
| otherwise = Nothing
-- Função de outro participante
transcribe :: Char -> Maybe Char
transcribe 'G' = Just 'C'
transcribe 'C' = Just 'G'
transcribe 'T' = Just 'A'
transcribe 'A' = Just 'U'
transcribe _ = Nothing
So I'd like to understand, is there any difference between the two forms? For cases like this, which one is the most correct? Or are the two in the end the same?