Skip to content

Instantly share code, notes, and snippets.

@dmitriz
Created August 17, 2019 02:55
Show Gist options
  • Save dmitriz/962093f13ca2b556d432a01f1813c65d to your computer and use it in GitHub Desktop.
Save dmitriz/962093f13ca2b556d432a01f1813c65d to your computer and use it in GitHub Desktop.
ghci errors
λ [9]: fmap f [1]
Out [9]:
<interactive>:186:1: error:
• Ambiguous type variable ‘f0’ arising from a use of ‘print’
prevents the constraint ‘(Show (f0 Integer))’ from being solved.
Probable fix: use a type annotation to specify what ‘f0’ should be.
These potential instances exist:
instance Show a => Show (ZipList a)
-- Defined in ‘Control.Applicative’
instance Show a => Show (Complex a) -- Defined in ‘Data.Complex’
instance (Show a, Show b) => Show (Either a b)
-- Defined in ‘Data.Either’
...plus 53 others
...plus 48 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In a stmt of an interactive GHCi command: print it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment