Opened 5 years ago

Closed 5 years ago

#9791 closed bug (duplicate)

Ghc panics on tiny example, naive try to overload compose

Reported by: camarao Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.4.1
Keywords: Overloading Cc:
Operating System: Linux Architecture: x86
Type of failure: Compile-time crash Test Case:
Blocked By: Blocking:
Related Tickets: #5951 Differential Rev(s):
Wiki Page:

Description

{-# LANGUAGE MultiParamTypeClasses #-}

class Compose a b c e f where

(<.>)::(b -> c)->(a -> e)->(a -> f)

instance Compose a b c b c where

(<.>) = (.)

instance Monad m -> Compose a b c (m b) (m c) where

(<.>) f g a = g a >>= (return . f)

Change History (1)

comment:1 Changed 5 years ago by thomie

Resolution: duplicate
Status: newclosed

Thank you for the report. This has been fixed, try upgrading to GHC 7.6 or 7.8.

$ ghc-7.6.3 test.hs
[1 of 1] Compiling Main             ( test.hs, test.o )

test.hs:9:10:
    Malformed instance: Monad m -> Compose a b c (m b) (m c)
Note: See TracTickets for help on using tickets.