Skip to content

ImplicitParams does not imply FlexibleContexts or FlexibleInstances

Given:

{-# LANGUAGE ImplicitParams       #-}
{-# LANGUAGE FlexibleInstances    #-}

module Test where

data X a = X
type XI = X Int

class Foo a where
  foo :: (?p :: Int) => a -> Int

instance Foo XI where foo = undefined

This code compiles. However, the documentation at https://downloads.haskell.org/~ghc/master/users-guide/glasgow_exts.html#language-options says that ImplicitParams implies FlexibleInstances, so we should be able to remove the FlexibleInstances extension. However, doing so makes it stop compiling.

My guess is that ImplicitParams doesn't really imply either of the type class extensions, and that the documentation is buggy.

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