Commit 40db277f authored by Tao He's avatar Tao He Committed by Ben Gamari

Fix `print-explicit-runtime-reps` (#11786).

By fixing splitting of IfaceTypes in splitIfaceSigmaTy.

Test Plan: make test TEST="T11549 T11376 T11786"

Reviewers: goldfire, bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #11786, #11376

Differential Revision: https://phabricator.haskell.org/D4733
parent 838aeb9b
......@@ -342,8 +342,23 @@ isIfaceLiftedTypeKind _ = False
splitIfaceSigmaTy :: IfaceType -> ([IfaceForAllBndr], [IfacePredType], IfaceType)
-- Mainly for printing purposes
--
-- Here we split nested IfaceSigmaTy properly.
--
-- @
-- forall t. T t => forall m a b. M m => (a -> m b) -> t a -> m (t b)
-- @
--
-- If you called @splitIfaceSigmaTy@ on this type:
--
-- @
-- ([t, m, a, b], [T t, M m], (a -> m b) -> t a -> m (t b))
-- @
splitIfaceSigmaTy ty
= (bndrs, theta, tau)
= case (bndrs, theta) of
([], []) -> (bndrs, theta, tau)
_ -> let (bndrs', theta', tau') = splitIfaceSigmaTy tau
in (bndrs ++ bndrs', theta ++ theta', tau')
where
(bndrs, rho) = split_foralls ty
(theta, tau) = split_rho rho
......@@ -623,6 +638,8 @@ pprIfaceType = pprPrecIfaceType topPrec
pprParendIfaceType = pprPrecIfaceType appPrec
pprPrecIfaceType :: PprPrec -> IfaceType -> SDoc
-- We still need `eliminateRuntimeRep`, since the `pprPrecIfaceType` maybe
-- called from other places, besides `:type` and `:info`.
pprPrecIfaceType prec ty = eliminateRuntimeRep (ppr_ty prec) ty
ppr_ty :: PprPrec -> IfaceType -> SDoc
......@@ -883,9 +900,11 @@ data ShowForAllFlag = ShowForAllMust | ShowForAllWhen
pprIfaceSigmaType :: ShowForAllFlag -> IfaceType -> SDoc
pprIfaceSigmaType show_forall ty
= ppr_iface_forall_part show_forall tvs theta (ppr tau)
= eliminateRuntimeRep ppr_fn ty
where
(tvs, theta, tau) = splitIfaceSigmaTy ty
ppr_fn iface_ty =
let (tvs, theta, tau) = splitIfaceSigmaTy iface_ty
in ppr_iface_forall_part show_forall tvs theta (ppr tau)
pprUserIfaceForAll :: [IfaceForAllBndr] -> SDoc
pprUserIfaceForAll tvs
......
......@@ -9407,7 +9407,7 @@ stub out functions that return unboxed types.
Printing levity-polymorphic types
---------------------------------
.. ghc-flag:: -fprint-explicit-runtime-rep
.. ghc-flag:: -fprint-explicit-runtime-reps
:shortdesc: Print ``RuntimeRep`` variables in types which are
runtime-representation polymorphic.
:type: dynamic
......
......@@ -1440,7 +1440,7 @@ def stdout_ok(name, way):
expected_stdout_file, actual_stdout_file)
def dump_stdout( name ):
with open(in_testdir(name, 'run.stdout')) as f:
with open(in_testdir(name, 'run.stdout'), encoding='utf8') as f:
str = f.read().strip()
if str:
print("Stdout (", name, "):")
......@@ -1456,7 +1456,7 @@ def stderr_ok(name, way):
whitespace_normaliser=normalise_whitespace)
def dump_stderr( name ):
with open(in_testdir(name, 'run.stderr')) as f:
with open(in_testdir(name, 'run.stderr'), encoding='utf8') as f:
str = f.read().strip()
if str:
print("Stderr (", name, "):")
......
......@@ -3,12 +3,16 @@ import GHC.Exts
putStrLn "-fno-print-explicit-runtime-reps"
:set -fno-print-explicit-runtime-reps
:type ($)
:info ($)
:kind TYPE
:type error
:info error
putStrLn "\n-fprint-explicit-runtime-reps"
:set -fprint-explicit-runtime-reps
:type ($)
:info ($)
:kind TYPE
:type error
:info error
-fno-print-explicit-runtime-reps
($) :: (a -> b) -> a -> b
($) :: (a -> b) -> a -> b -- Defined in ‘GHC.Base’
infixr 0 $
TYPE :: RuntimeRep -> *
error :: [Char] -> a
error :: GHC.Stack.Types.HasCallStack => [Char] -> a
-- Defined in ‘GHC.Err’
-fprint-explicit-runtime-reps
($) :: (a -> b) -> a -> b
($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
-- Defined in ‘GHC.Base’
infixr 0 $
TYPE :: RuntimeRep -> *
error
:: forall (r :: RuntimeRep) (a :: TYPE r).
GHC.Stack.Types.HasCallStack =>
[Char] -> a
error :: [Char] -> a
error ::
forall (r :: RuntimeRep) (a :: TYPE r).
GHC.Stack.Types.HasCallStack =>
[Char] -> a
-- Defined in ‘GHC.Err’
:set -fno-print-explicit-runtime-reps
:t ($)
:t (($))
:t +v ($)
:i ($)
:set -fprint-explicit-runtime-reps
:t ($)
:t (($))
:t +v ($)
:i ($)
($) :: (a -> b) -> a -> b
(($)) :: (a -> b) -> a -> b
($) :: (a -> b) -> a -> b
($) :: (a -> b) -> a -> b -- Defined in ‘GHC.Base’
infixr 0 $
($) :: (a -> b) -> a -> b
(($)) :: (a -> b) -> a -> b
($)
:: forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r).
(a -> b) -> a -> b
($) ::
forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r).
(a -> b) -> a -> b
-- Defined in ‘GHC.Base’
infixr 0 $
test('T11549',
[ expect_broken( 11787 ),
expect_broken( 11786 ) ],
ghci_script, ['T11549.script'])
test('T11549', normal, ghci_script, ['T11549.script'])
test('T11786', normal, ghci_script, ['T11786.script'])
test('T14238', normal, ghci_script, ['T14238.script'])
......@@ -3,13 +3,13 @@ mapM
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM
:: forall (t :: * -> *).
Traversable t =>
forall (m :: * -> *) a b. Monad m => (a -> m b) -> t a -> m (t b)
:: forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM
:: forall (t :: * -> *).
Traversable t =>
forall (m :: * -> *) a b. Monad m => (a -> m b) -> t a -> m (t b)
:: forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
foo @Int :: forall {b}. Num b => Int -> b
foo @Int :: forall b. (Show Int, Num b) => Int -> b
foo @Int :: forall b. (Show Int, Num b) => Int -> b
......@@ -6,4 +6,8 @@ type Pair (a :: TYPE rep) (b :: TYPE rep') rep'' = forall (r :: TYPE rep''). (a
:kind Pair Int Float
:kind Pair Int Float LiftedRep
:set -fprint-explicit-runtime-reps
:kind Pair
:kind Pair Int
:kind Pair Int Float
:kind Pair Int Float LiftedRep
Pair :: * -> * -> RuntimeRep -> *
Pair Int :: * -> RuntimeRep -> *
Pair Int Float :: RuntimeRep -> *
Pair Int Float LiftedRep :: *
Pair :: TYPE rep -> TYPE rep' -> RuntimeRep -> *
Pair Int :: * -> RuntimeRep -> *
Pair Int Float :: RuntimeRep -> *
......
($!) ::
forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r).
(a -> b) -> a -> b
-- Defined in ‘GHC.Base’
($!) :: (a -> b) -> a -> b -- Defined in ‘GHC.Base’
infixr 0 $!
......@@ -8,18 +8,18 @@ class C a b
...
c1 :: (C a b, N b) => a -> b
c2 :: (C a b, N b, S b) => a -> b
c3 :: C a b => forall a. a -> b
c4 :: C a b => forall a1. a1 -> b
c3 :: C a b => a -> b
c4 :: C a b => a1 -> b
-- imported via Control.Monad
class (GHC.Base.Alternative m, Monad m) => MonadPlus (m :: * -> *)
...
mplus :: MonadPlus m => forall a. m a -> m a -> m a
mzero :: MonadPlus m => forall a. m a
mplus :: MonadPlus m => m a -> m a -> m a
mzero :: MonadPlus m => m a
-- imported via Control.Monad, Prelude
(>>) :: Monad m => forall a b. m a -> m b -> m b
(>>=) :: Monad m => forall a b. m a -> (a -> m b) -> m b
fail :: Monad m => forall a. GHC.Base.String -> m a
return :: Monad m => forall a. a -> m a
(>>) :: Monad m => m a -> m b -> m b
(>>=) :: Monad m => m a -> (a -> m b) -> m b
fail :: Monad m => GHC.Base.String -> m a
return :: Monad m => a -> m a
-- imported via Control.Monad, Prelude, T
class GHC.Base.Applicative m => Monad (m :: * -> *)
...
......@@ -43,8 +43,7 @@ Nothing :: Maybe a
class Eq a
...
-- imported via Prelude, T
Prelude.length ::
Data.Foldable.Foldable t => forall a. t a -> GHC.Types.Int
Prelude.length :: Data.Foldable.Foldable t => t a -> GHC.Types.Int
-- imported via T
data T.Integer = ...
T.length :: Data.ByteString.Internal.ByteString -> GHC.Types.Int
......@@ -57,8 +56,8 @@ class C a b
...
c1 :: (C a b, N b) => a -> b
c2 :: (C a b, N b, S b) => a -> b
c3 :: C a b => forall a. a -> b
c4 :: C a b => forall a1. a1 -> b
c3 :: C a b => a -> b
c4 :: C a b => a1 -> b
:browse! T -- with -fprint-explicit-foralls
-- defined locally
T.length :: T.Integer
......@@ -68,8 +67,8 @@ class C a b
...
c1 :: forall a b. (C a b, N b) => a -> b
c2 :: forall a b. (C a b, N b, S b) => a -> b
c3 :: forall a b. C a b => forall a. a -> b
c4 :: forall a b. C a b => forall a1. a1 -> b
c3 :: forall a b a. C a b => a -> b
c4 :: forall a b a1. C a b => a1 -> b
-- test :browse! <target> relative to different contexts
:browse! Ghci025C -- from *Ghci025C>
-- defined locally
......@@ -94,4 +93,3 @@ Ghci025C.g :: forall {a}. Num a => a -> a
Ghci025C.h :: forall {a}. Integral a => a -> a
-- defined locally
f :: forall {a}. Num a => a -> a
......@@ -76,11 +76,11 @@ T13050.hs:4:9: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Classes’))
return :: forall (m :: * -> *). Monad m => forall a. a -> m a
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Base’))
pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
with pure @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Base’))
......@@ -162,11 +162,11 @@ T13050.hs:5:11: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Classes’))
return :: forall (m :: * -> *). Monad m => forall a. a -> m a
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Base’))
pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
with pure @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Base’))
......@@ -249,11 +249,11 @@ T13050.hs:6:11: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Classes’))
return :: forall (m :: * -> *). Monad m => forall a. a -> m a
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Base’))
pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
with pure @((->) Int) @Int
(imported from ‘Prelude’ at T13050.hs:1:8-17
(and originally defined in ‘GHC.Base’))
......@@ -77,11 +77,11 @@ T14590.hs:4:13: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Classes’))
return :: forall (m :: * -> *). Monad m => forall a. a -> m a
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Base’))
pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
with pure @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Base’))
......@@ -165,11 +165,11 @@ T14590.hs:5:13: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Classes’))
return :: forall (m :: * -> *). Monad m => forall a. a -> m a
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Base’))
pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
with pure @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Base’))
......@@ -252,11 +252,11 @@ T14590.hs:6:11: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Classes’))
return :: forall (m :: * -> *). Monad m => forall a. a -> m a
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Base’))
pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
with pure @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Base’))
......@@ -340,11 +340,11 @@ T14590.hs:7:11: warning: [-Wtyped-holes (in -Wdefault)]
with min @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Classes’))
return :: forall (m :: * -> *). Monad m => forall a. a -> m a
return :: forall (m :: * -> *) a. Monad m => a -> m a
with return @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Base’))
pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
with pure @((->) Int) @Int
(imported from ‘Prelude’ at T14590.hs:1:8-13
(and originally defined in ‘GHC.Base’))
......@@ -11,49 +11,37 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
g :: [Integer] -> Integer
head :: forall a. [a] -> a
last :: forall a. [a] -> a
maximum :: forall (t :: * -> *).
Foldable t =>
forall a. Ord a => t a -> a
minimum :: forall (t :: * -> *).
Foldable t =>
forall a. Ord a => t a -> a
product :: forall (t :: * -> *).
Foldable t =>
forall a. Num a => t a -> a
sum :: forall (t :: * -> *).
Foldable t =>
forall a. Num a => t a -> a
maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
product :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
Valid refinement hole fits include
foldl1 (_ :: Integer -> Integer -> Integer)
where foldl1 :: forall (t :: * -> *).
where foldl1 :: forall (t :: * -> *) a.
Foldable t =>
forall a. (a -> a -> a) -> t a -> a
(a -> a -> a) -> t a -> a
foldr1 (_ :: Integer -> Integer -> Integer)
where foldr1 :: forall (t :: * -> *).
where foldr1 :: forall (t :: * -> *) a.
Foldable t =>
forall a. (a -> a -> a) -> t a -> a
(a -> a -> a) -> t a -> a
foldl (_ :: Integer -> Integer -> Integer) (_ :: Integer)
where foldl :: forall (t :: * -> *).
where foldl :: forall (t :: * -> *) b a.
Foldable t =>
forall b a. (b -> a -> b) -> b -> t a -> b
(b -> a -> b) -> b -> t a -> b
foldr (_ :: Integer -> Integer -> Integer) (_ :: Integer)
where foldr :: forall (t :: * -> *).
where foldr :: forall (t :: * -> *) a b.
Foldable t =>
forall a b. (a -> b -> b) -> b -> t a -> b
(a -> b -> b) -> b -> t a -> b
const (_ :: Integer)
where const :: forall a b. a -> b -> a
($) (_ :: [Integer] -> Integer)
where ($) :: forall a b. (a -> b) -> a -> b
fail (_ :: String)
where fail :: forall (m :: * -> *).
Monad m =>
forall a. String -> m a
where fail :: forall (m :: * -> *) a. Monad m => String -> m a
return (_ :: Integer)
where return :: forall (m :: * -> *). Monad m => forall a. a -> m a
where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: Integer)
where pure :: forall (f :: * -> *).
Applicative f =>
forall a. a -> f a
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
($!) (_ :: [Integer] -> Integer)
where ($!) :: forall a b. (a -> b) -> a -> b
curry (_ :: (a2, [Integer]) -> Integer) (_ :: a2)
......@@ -63,25 +51,25 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
flip (_ :: [Integer] -> b7 -> Integer) (_ :: b7)
where flip :: forall a b c. (a -> b -> c) -> b -> a -> c
(>>=) (_ :: [Integer] -> a11) (_ :: a11 -> [Integer] -> Integer)
where (>>=) :: forall (m :: * -> *).
where (>>=) :: forall (m :: * -> *) a b.
Monad m =>
forall a b. m a -> (a -> m b) -> m b
m a -> (a -> m b) -> m b
(>>) (_ :: [Integer] -> a10) (_ :: [Integer] -> Integer)
where (>>) :: forall (m :: * -> *).
where (>>) :: forall (m :: * -> *) a b.
Monad m =>
forall a b. m a -> m b -> m b
m a -> m b -> m b
fmap (_ :: a12 -> Integer) (_ :: [Integer] -> a12)
where fmap :: forall (f :: * -> *).
where fmap :: forall (f :: * -> *) a b.
Functor f =>
forall a b. (a -> b) -> f a -> f b
(a -> b) -> f a -> f b
(<*>) (_ :: [Integer] -> a8 -> Integer) (_ :: [Integer] -> a8)
where (<*>) :: forall (f :: * -> *).
where (<*>) :: forall (f :: * -> *) a b.
Applicative f =>
forall a b. f (a -> b) -> f a -> f b
f (a -> b) -> f a -> f b
(*>) (_ :: [Integer] -> a7) (_ :: [Integer] -> Integer)
where (*>) :: forall (f :: * -> *).
where (*>) :: forall (f :: * -> *) a b.
Applicative f =>
forall a b. f a -> f b -> f b
f a -> f b -> f b
(<$>) (_ :: a1 -> Integer) (_ :: [Integer] -> a1)
where (<$>) :: forall (f :: * -> *) a b.
Functor f =>
......@@ -91,13 +79,13 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
Monad m =>
(a -> m b) -> m a -> m b
(<*) (_ :: [Integer] -> Integer) (_ :: [Integer] -> b5)
where (<*) :: forall (f :: * -> *).
where (<*) :: forall (f :: * -> *) a b.
Applicative f =>
forall a b. f a -> f b -> f a
f a -> f b -> f a
(<$) (_ :: Integer) (_ :: [Integer] -> b4)
where (<$) :: forall (f :: * -> *).
where (<$) :: forall (f :: * -> *) a b.
Functor f =>
forall a b. a -> f b -> f a
a -> f b -> f a
id (_ :: t0 -> [Integer] -> Integer) (_ :: t0)
where id :: forall a. a -> a
head (_ :: [t0 -> [Integer] -> Integer]) (_ :: t0)
......@@ -129,15 +117,11 @@ abstract_refinement_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
($) (_ :: a5 -> [Integer] -> Integer) (_ :: a5)
where ($) :: forall a b. (a -> b) -> a -> b
fail (_ :: String) (_ :: t0)
where fail :: forall (m :: * -> *).
Monad m =>
forall a. String -> m a
where fail :: forall (m :: * -> *) a. Monad m => String -> m a
return (_ :: [Integer] -> Integer) (_ :: t0)
where return :: forall (m :: * -> *). Monad m => forall a. a -> m a
where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: [Integer] -> Integer) (_ :: t0)
where pure :: forall (f :: * -> *).
Applicative f =>
forall a. a -> f a
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
uncurry (_ :: a4 -> b3 -> [Integer] -> Integer) (_ :: (a4, b3))
where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c
($!) (_ :: a6 -> [Integer] -> Integer) (_ :: a6)
......@@ -153,17 +137,17 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
(bound at abstract_refinement_hole_fits.hs:7:1)
Valid hole fits include
const :: forall a b. a -> b -> a
return :: forall (m :: * -> *). Monad m => forall a. a -> m a
pure :: forall (f :: * -> *). Applicative f => forall a. a -> f a
return :: forall (m :: * -> *) a. Monad m => a -> m a
pure :: forall (f :: * -> *) a. Applicative f => a -> f a
Valid refinement hole fits include
foldl (_ :: Integer -> Integer -> Integer)
where foldl :: forall (t :: * -> *).
where foldl :: forall (t :: * -> *) b a.
Foldable t =>
forall b a. (b -> a -> b) -> b -> t a -> b
(b -> a -> b) -> b -> t a -> b
foldr (_ :: Integer -> Integer -> Integer)
where foldr :: forall (t :: * -> *).
where foldr :: forall (t :: * -> *) a b.
Foldable t =>
forall a b. (a -> b -> b) -> b -> t a -> b
(a -> b -> b) -> b -> t a -> b
curry (_ :: (Integer, [Integer]) -> Integer)
where curry :: forall a b c. ((a, b) -> c) -> a -> b -> c
flip (_ :: [Integer] -> Integer -> Integer)
......@@ -173,15 +157,11 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
($) (_ :: Integer -> [Integer] -> Integer)
where ($) :: forall a b. (a -> b) -> a -> b
fail (_ :: String)
where fail :: forall (m :: * -> *).
Monad m =>
forall a. String -> m a
where fail :: forall (m :: * -> *) a. Monad m => String -> m a
return (_ :: [Integer] -> Integer)
where return :: forall (m :: * -> *). Monad m => forall a. a -> m a
where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: [Integer] -> Integer)
where pure :: forall (f :: * -> *).
Applicative f =>
forall a. a -> f a
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
($!) (_ :: Integer -> [Integer] -> Integer)
where ($!) :: forall a b. (a -> b) -> a -> b
curry (_ :: (a2, Integer) -> [Integer] -> Integer) (_ :: a2)
......@@ -192,26 +172,26 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
where flip :: forall a b c. (a -> b -> c) -> b -> a -> c
(>>=) (_ :: Integer -> a11)
(_ :: a11 -> Integer -> [Integer] -> Integer)
where (>>=) :: forall (m :: * -> *).
where (>>=) :: forall (m :: * -> *) a b.
Monad m =>
forall a b. m a -> (a -> m b) -> m b
m a -> (a -> m b) -> m b
(>>) (_ :: Integer -> a10) (_ :: Integer -> [Integer] -> Integer)
where (>>) :: forall (m :: * -> *).
where (>>) :: forall (m :: * -> *) a b.
Monad m =>
forall a b. m a -> m b -> m b
m a -> m b -> m b
fmap (_ :: a12 -> [Integer] -> Integer) (_ :: Integer -> a12)
where fmap :: forall (f :: * -> *).
where fmap :: forall (f :: * -> *) a b.
Functor f =>
forall a b. (a -> b) -> f a -> f b
(a -> b) -> f a -> f b
(<*>) (_ :: Integer -> a8 -> [Integer] -> Integer)
(_ :: Integer -> a8)
where (<*>) :: forall (f :: * -> *).
where (<*>) :: forall (f :: * -> *) a b.
Applicative f =>
forall a b. f (a -> b) -> f a -> f b
f (a -> b) -> f a -> f b
(*>) (_ :: Integer -> a7) (_ :: Integer -> [Integer] -> Integer)
where (*>) :: forall (f :: * -> *).
where (*>) :: forall (f :: * -> *) a b.
Applicative f =>
forall a b. f a -> f b -> f b
f a -> f b -> f b
(<$>) (_ :: a1 -> [Integer] -> Integer) (_ :: Integer -> a1)
where (<$>) :: forall (f :: * -> *) a b.
Functor f =>
......@@ -222,13 +202,13 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
Monad m =>
(a -> m b) -> m a -> m b
(<*) (_ :: Integer -> [Integer] -> Integer) (_ :: Integer -> b5)
where (<*) :: forall (f :: * -> *).
where (<*) :: forall (f :: * -> *) a b.
Applicative f =>
forall a b. f a -> f b -> f a
f a -> f b -> f a
(<$) (_ :: [Integer] -> Integer) (_ :: Integer -> b4)
where (<$) :: forall (f :: * -> *).
where (<$) :: forall (f :: * -> *) a b.
Functor f =>
forall a b. a -> f b -> f a
a -> f b -> f a
id (_ :: t0 -> Integer -> [Integer] -> Integer) (_ :: t0)
where id :: forall a. a -> a
head (_ :: [t0 -> Integer -> [Integer] -> Integer]) (_ :: t0)
......@@ -261,15 +241,11 @@ abstract_refinement_hole_fits.hs:7:5: warning: [-Wtyped-holes (in -Wdefault)]
($) (_ :: a5 -> Integer -> [Integer] -> Integer) (_ :: a5)
where ($) :: forall a b. (a -> b) -> a -> b
fail (_ :: String) (_ :: t0)
where fail :: forall (m :: * -> *).
Monad m =>
forall a. String -> m a
where fail :: forall (m :: * -> *) a. Monad m => String -> m a
return (_ :: Integer -> [Integer] -> Integer) (_ :: t0)
where return :: forall (m :: * -> *). Monad m => forall a. a -> m a
where return :: forall (m :: * -> *) a. Monad m => a -> m a
pure (_ :: Integer -> [Integer] -> Integer) (_ :: t0)
where pure :: forall (f :: * -> *).
Applicative f =>
forall a. a -> f a
where pure :: forall (f :: * -> *) a. Applicative f => a -> f a
uncurry (_ :: a4 -> b3 -> Integer -> [Integer] -> Integer)
(_ :: (a4, b3))
where uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c
......
......@@ -14,43 +14,35 @@ constraint_hole_fits.hs:4:5: warning: [-Wtyped-holes (in -Wdefault)]
g :: [a] -> a
head :: forall a. [a] -> a
last :: forall a. [a] -> a
maximum :: forall (t :: * -> *).
Foldable t =>
forall a. Ord a => t a -> a
minimum :: forall (t :: * -> *).
Foldable t =>
forall a. Ord a => t a -> a
maximum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
minimum :: forall (t :: * -> *) a. (Foldable t, Ord a) => t a -> a
Valid refinement hole fits include
foldl1 (_ :: a -> a -> a)
where foldl1 :: forall (t :: * -> *).
where foldl1 :: forall (t :: * -> *) a.
Foldable t =>
forall a. (a -> a -> a) -> t a -> a
(a -> a -> a) -> t a -> a
foldr1 (_ :: a -> a -> a)
where foldr1 :: forall (t :: * -> *).
where foldr1 :: forall (t :: * -> *) a.