4
Exemple code:de type Haskell problème jeté
fac :: Int → Int
fac 0 = 1
fac n = n * fac (n-1)
main = do
putStrLn show fac 10
Erreur:
Couldnt match expected type 'String'
against inferred type 'a -> String'
In the first argument of 'putStrLn', namely 'show'
In the expression: putStrLn show fac 10
+1 ' $ 'est votre ami. –
($) et (.) Sont vos amis aimants <3 – codebliss