[GHC] #13258: GHC head 8.1.20170209 does not compile package 'mono-traversable'

#13258: GHC head 8.1.20170209 does not compile package 'mono-traversable' -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Not sure if this is a bug in 'mono-traversable' or GHC but I thought it was worth reporting in any case. GHC head 8.1.20170209 is the version used: {{{ Configuring mono-traversable-1.0.1.1... Preprocessing library mono-traversable-1.0.1.1... [1 of 5] Compiling Data.MonoTraversable ( src/Data/MonoTraversable.hs, .stack-work/dist/x86_64-linux/Cabal-1.25.0.0/build/Data/MonoTraversable.o ) /tmp/stack12856/mono- traversable-1.0.1.1/src/Data/MonoTraversable.hs:144:13: error: • The default type signature for omap: forall (f :: * -> *) a. (Functor f, Element (f a) ~ a, f a ~ mono) => (a -> a) -> f a -> f a does not match its corresponding non-default type signature • When checking the class method: omap :: forall mono. MonoFunctor mono => (Element mono -> Element mono) -> mono -> mono In the class declaration for ‘MonoFunctor’ | 144 | default omap :: (Functor f, Element (f a) ~ a, f a ~ mono) => (a -> a) -> f a -> f a | ^^^^ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13258 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13258: GHC head 8.1.20170209 does not compile package 'mono-traversable' -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by ezyang): Possibly related to #13249? The default signature check is new so it may very well be picking up a bug. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13258#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13258: GHC head 8.1.20170209 does not compile package 'mono-traversable' -------------------------------------+------------------------------------- Reporter: clinton | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13249 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => invalid * related: => #13249 Comment: This is expected behavior. GHC 8.2 tightened up validity checking for default type signatures. This catches many things which are just plain type incorrect (e.g., see #12918). A consequence of this is that you can't write default type signatures quite as liberally as before, but luckily, it's an extremely easy fix: {{{#!hs class MonoFunctor mono where omap :: (Element mono -> Element mono) -> mono -> mono default omap :: (Functor f, Element (f a) ~ a, f a ~ mono) => (Element mono -> Element mono) -> mono -> mono omap = fmap {-# INLINE omap #-} }}} The benefit is now the connection between the default and non-default type signatures is much clearer. That is, the default type signature is exactly the same as the non-default one, just with more constraints. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13258#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC