Quel est le problème que:Pourquoi ne peut pas fonctionner Haskell retourner une liste
partin a = [floor a, a-floor a]
Erreur:
<interactive>:342:1: error:
• Ambiguous type variable ‘a0’ arising from a use of ‘print’
prevents the constraint ‘(Show a0)’ from being solved.
Probable fix: use a type annotation to specify what ‘a0’ should be.
These potential instances exist:
instance Show Ordering -- Defined in ‘GHC.Show’
instance Show Integer -- Defined in ‘GHC.Show’
instance Show a => Show (Maybe a) -- Defined in ‘GHC.Show’
...plus 22 others
...plus 16 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In a stmt of an interactive GHCi command: print it
Il s'agit d'imprimer quelque chose, mais vous ne montrez pas comment vous essayez d'imprimer quelque chose. S'il vous plaît montrer le reste de ce que vous faites. – dfeuer
En fait, quand je fais "partie a = a - étage a" est également donner la même erreur. Le code est uniquement constitué de cette fonction –
Il a juste tapé 'part something' à l'invite de GHCi, comme dans la ligne de signature" Dans une commande interactive de GHCi: 'print it'." – HTNW