Personal tools

Solution2.html

From HaskellWiki

Revision as of 16:41, 22 August 2012 by Pronate (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
parent :: Sheep -> Maybe Sheep
parent s = father s `mplus` mother s
 
grandparent :: Sheep -> Maybe Sheep
grandparent s = paternalGrandfather s `mplus` 
                paternalGrandmother s `mplus` 
                maternalGrandfather s `mplus` 
                maternalGrandmother s