Parcourir la source

Add case...of code

master
Julian Ospald il y a 9 ans
Parent
révision
b964f22c39
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: 220CD1C5BDEED020
1 fichiers modifiés avec 6 ajouts et 0 suppressions
  1. +6
    -0
      common/code/Code.hs

+ 6
- 0
common/code/Code.hs Voir le fichier

@@ -51,3 +51,9 @@ addTwo (x:xs) = (x + 2) : addTwo xs

f'' :: String -> Bool
f'' xs = even . length . (\x -> x ++ "Hello world") $ xs

g :: Int -> Bool
g x = case x - 2 of
2 -> True
5 -> True
x -> False

Chargement…
Annuler
Enregistrer