Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,388
    • Issues 4,388
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 378
    • Merge Requests 378
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4952

Closed
Open
Opened Feb 09, 2011 by Ian Lynagh <igloo@earth.li>@trac-igloo

Typechecking regression

  1. 0.1 accepts this module (cut down from hashed-storage-0.5.4):
{-# LANGUAGE UndecidableInstances,
             MultiParamTypeClasses,
             KindSignatures,
             FlexibleInstances,
             FunctionalDependencies #-}

module Storage.Hashed.Monad () where

class Monad m => TreeRO m where
    withDirectory :: (MonadError e m) => Int -> m a -> m a
    expandTo :: (MonadError e m) => Int -> m Int

instance (Monad m, MonadError e m) => TreeRO (M m) where
    expandTo = undefined
    withDirectory dir _ = do
      _ <- expandTo dir
      undefined

data M (m :: * -> *) a

instance Monad m => Monad (M m) where
    (>>=) = undefined
    return = undefined

instance MonadError e m => MonadError e (M m)

class Monad m => MonadError e m | m -> e

but 7.0 branch says:

[1 of 1] Compiling Storage.Hashed.Monad ( Storage/Hashed/Monad.hs, interpreted )

Storage/Hashed/Monad.hs:17:12:
    Could not deduce (MonadError e1 m) arising from a use of `expandTo'
    from the context (Monad m, MonadError e m)
      bound by the instance declaration
      at Storage/Hashed/Monad.hs:14:10-50
    or from (MonadError e1 (M m))
      bound by the type signature for
                 withDirectory :: MonadError e1 (M m) => Int -> M m a -> M m a
      at Storage/Hashed/Monad.hs:(16,5)-(18,15)
    Possible fix:
      add (MonadError e1 m) to the context of
        the type signature for
          withDirectory :: MonadError e1 (M m) => Int -> M m a -> M m a
        or the instance declaration
    In a stmt of a 'do' expression: _ <- expandTo dir
    In the expression:
      do { _ <- expandTo dir;
           undefined }
    In an equation for `withDirectory':
        withDirectory dir _
          = do { _ <- expandTo dir;
                 undefined }
Failed, modules loaded: none.
Trac metadata
Trac field Value
Version 7.0.1
Type Bug
TypeOfFailure OtherFailure
Priority highest
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
7.0.2
Milestone
7.0.2
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#4952