Skip to content
GitLab
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 5,400
    • Issues 5,400
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #10079
Closed
Open
Issue created Feb 11, 2015 by glguy@glguy

Coercible solver regression: Couldn't match rep of () with Const () b

Hello, I ran into what appears to be a regression in the Coercible solver since 7.8.4. This is as small as I've managed to get my example case.

{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE FlexibleContexts #-}
module Bug where

import Control.Applicative
import Data.Coerce

broken :: Bizarre (->) w => w a b t -> ()
broken = getConst #. bazaar (Const #. const ())

class Profunctor p where
  (#.) :: Coercible c b => (b -> c) -> p a b -> p a c

instance Profunctor (->) where
  (#.) = (.)

class Bizarre p w | w -> p where 
  bazaar :: Applicative f => p a (f b) -> w a b t -> f t
Bug.hs:10:36:
    Couldn't match representation of type ‘()’
                             with that of ‘Const () b’
    Relevant role signatures: type role Const representational phantom
    Relevant bindings include
      broken :: w a b t -> () (bound at Bug.hs:10:1)
    In the first argument of ‘bazaar’, namely ‘(Const #. const ())’
    In the second argument of ‘(#.)’, namely
      ‘bazaar (Const #. const ())’
    In the expression: getConst #. bazaar (Const #. const ())
Edited Mar 10, 2019 by glguy
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking