[1 of 1] Compiling Main ( prog.hs, prog.o )
prog.hs:13:3:
No instance for (Show a0) arising from a use of `print'
The type variable `a0' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there are several potential instances:
instance Show Double -- Defined in `GHC.Float'
instance Show Float -- Defined in `GHC.Float'
instance (Integral a, Show a) => Show (GHC.Real.Ratio a)
-- Defined in `GHC.Real'
...plus 23 others
In the expression: print
In a stmt of a 'do' block: print $ foo "hello"
In the expression:
do { print $ foo "hello";
print $ foo }
prog.hs:13:11:
Overlapping instances for Foo ([Char] -> a0)
arising from a use of `foo'
Matching instances:
instance a ~ Int => Foo (String -> a) -- Defined at prog.hs:6:10
instance a ~ String => Foo a -- Defined at prog.hs:9:10
In the second argument of `($)', namely `foo "hello"'
In a stmt of a 'do' block: print $ foo "hello"
In the expression:
do { print $ foo "hello";
print $ foo }
prog.hs:14:3:
No instance for (Show a1) arising from a use of `print'
The type variable `a1' is ambiguous
Possible fix: add a type signature that fixes these type variable(s)
Note: there are several potential instances:
instance Show Double -- Defined in `GHC.Float'
instance Show Float -- Defined in `GHC.Float'
instance (Integral a, Show a) => Show (GHC.Real.Ratio a)
-- Defined in `GHC.Real'
...plus 23 others
In the expression: print
In a stmt of a 'do' block: print $ foo
In the expression:
do { print $ foo "hello";
print $ foo }
prog.hs:14:11:
Overlapping instances for Foo a1 arising from a use of `foo'
Matching instances:
instance a ~ String => Foo a -- Defined at prog.hs:9:10
instance a ~ Int => Foo (String -> a) -- Defined at prog.hs:6:10
(The choice depends on the instantiation of `a1'
To pick the first instance above, use -XIncoherentInstances
when compiling the other instance declarations)
In the second argument of `($)', namely `foo'
In a stmt of a 'do' block: print $ foo
In the expression:
do { print $ foo "hello";
print $ foo }