Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 461
    • Merge requests 461
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4952
Closed
Open
Created 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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking