vendredi 26 février 2016

if condition in Haskell

    xor :: Bool -> Bool -> Bool

    xor False False = False

    xor _ _= True

so i'm new with haskell and i'm trying to transform the above pattern matching program to an if condition. basically this is an "or" function. this is what i came up with for the if condition but doesnt work. any help please?

    xor2 :: Bool -> Bool -> Bool

    xor2 False False = False

    xor2 _ _= True

    xor2 If False False Then False Else True

Aucun commentaire:

Enregistrer un commentaire