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,252
    • Issues 5,252
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 576
    • Merge requests 576
  • 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
  • #9897
Closed
Open
Issue created Dec 18, 2014 by erisco@trac-erisco

Couldn't match type `Id (Id Char)' with `Char'

'foo' is expected to type check given that 'bar' and 'qux' type check.

ghc_bug.hs:21:7:
    Couldn't match type `Id (Id Char)' with `Char'
    Expected type: (:.:) Id Id Char
      Actual type: Char
    In the expression: 'x'
    In an equation for `foo': foo = 'x'
{-# LANGUAGE TypeOperators, TypeFamilies #-}
module Main where

type family (:.:) g f a where
 (:.:) g f a = g (f a)
--

type family Id x where
  Id x = x
--

-- Type checks
bar :: Id (Id Char)
bar = 'x'

-- Type checks
qux = 'x' :: (Id :.: Id) Char

-- Couldn't match type `Id (Id Char)' with `Char'
foo :: (Id :.: Id) Char
foo = 'x'
Trac metadata
Trac field Value
Version 7.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
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