summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_fail/T14884.stderr
blob: 30e1ffbbfcadbe4177b731329cb5b6aae5965340 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

T14884.hs:4:5: error: [GHC-88464]
    • Found hole: _ :: (a0 -> IO ()) -> String -> IO ()
      Where: ‘a0’ is an ambiguous type variable
    • In the expression: _ print "abc"
      In an equation for ‘x’: x = _ print "abc"
    • Relevant bindings include x :: IO () (bound at T14884.hs:4:1)
      Valid hole fits include
        mapM_ :: forall (t :: * -> *) (m :: * -> *) a b.
                 (Foldable t, Monad m) =>
                 (a -> m b) -> t a -> m ()
          with mapM_ @[] @IO @Char @()
          (imported from ‘Prelude’ at T14884.hs:1:8-13
           (and originally defined in ‘Data.Foldable’))
        foldMap :: forall (t :: * -> *) m a.
                   (Foldable t, Monoid m) =>
                   (a -> m) -> t a -> m
          with foldMap @[] @(IO ()) @Char
          (imported from ‘Prelude’ at T14884.hs:1:8-13
           (and originally defined in ‘Data.Foldable’))
        ($) :: forall a b. (a -> b) -> a -> b
          with ($) @GHC.Types.LiftedRep @String @(IO ())
          (imported from ‘Prelude’ at T14884.hs:1:8-13
           (and originally defined in ‘GHC.Base’))
        ($!) :: forall a b. (a -> b) -> a -> b
          with ($!) @GHC.Types.LiftedRep @String @(IO ())
          (imported from ‘Prelude’ at T14884.hs:1:8-13
           (and originally defined in ‘GHC.Base’))
        id :: forall a. a -> a
          with id @(String -> IO ())
          (imported from ‘Prelude’ at T14884.hs:1:8-13
           (and originally defined in ‘GHC.Base’))

T14884.hs:4:7: error: [GHC-39999]
    • 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.
      Potentially matching instances:
        instance (Show a, Show b) => Show (Either a b)
          -- Defined in ‘Data.Either’
        instance Show Ordering -- Defined in ‘GHC.Show’
        ...plus 26 others
        ...plus 28 instances involving out-of-scope types
        (use -fprint-potential-instances to see them all)
    • In the first argument of ‘_’, namely ‘print’
      In the expression: _ print "abc"
      In an equation for ‘x’: x = _ print "abc"