To solve the specific problem you pose, one doesn't need to know anything about the relationship between alleles and blood types -- you don't even need to know what an allele is :-)

If I didn't need to do anything else than just calculate whether a given father's blood type is 'viable', I'd rather go for something like the solution in attachment. I took advantage of this handy calculator while writing it.

Cheers,


On Sun, Jun 29, 2014 at 4:16 AM, Rafael Almeida <almeidaraf@gmail.com> wrote:
Hello,

I'm trying to practice my Haskell. So I had the idea of making a program which, given a mother's and a child blood type, it can determine whether a certain father is possible or not.

Please take a look on this gist with my implementation:

    https://gist.github.com/aflag/14429dfb2e89791a44e2#file-parentaltesting

Would you care to comment on it? It looks a bit cumbersome to my eyes. I'm trying to find the most intuitive and elegant way of do it. I'm not so much worried with performance.

[]'s
Rafael

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe




--
José A. Romero L.
escherdragon@gmail.com
"We who cut mere stones must always be envisioning cathedrals."
(Quarry worker's creed)