Skip to content

Crash when using (->) instead of (=>) in a typeclass instance

import qualified Data.Vector as V import Test.QuickCheck import Control.Monad (liftM)

instance (Arbitrary a) -> Arbitrary (V.Vector a) where

arbitrary = fmap V.fromList arbitrary

main = do

print "bla"

The arrow is obviously incorrect.

runghc <thisfile> tells me:

  • ** Exception: compiler/rename/RnSource.lhs:429:14-81: Irrefutable pattern failed for pattern Data.Maybe.Just (inst_tyvars,

_,

SrcLoc.L _ cls,

_)

Trac metadata
Trac field Value
Version 7.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Parser)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information