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,247
    • Issues 5,247
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 575
    • Merge requests 575
  • 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
  • #981
Closed
Open
Issue created Nov 02, 2006 by jefb@galois.com@trac-jefb

implicit parameters, type synonyms, and $

This is related to ticket #821 (closed) (which is indeed fixed in 6.6).

We make extensive use of an (undocumented?) feature of GHC: type synonyms can include implicit parameter constraints such that when the type is used, the constraint 'floats to the top'. This appears to be broken in some cases in 6.6.

Here's an example module:

{-# OPTIONS -fglasgow-exts -fimplicit-params #-}
module TestIP where

type PPDoc = (?env :: Int) => Char

f :: Char -> PPDoc
f c = g $ c

g :: PPDoc -> PPDoc
g d = d

when loaded in ghci 6.6, this yields:

/Users/jefb/Test.hs:7:10:
    Couldn't match expected type `PPDoc' against inferred type `Char'
    Probable cause: `c' is applied to too many arguments
    In the second argument of `($)', namely `c'
    In the expression: g $ c

If g $ c is changed to g c the module compiles.

The example compiles in 6.4.1 (I don't have handy access to other versions right now).

Thanks! Jef

Trac metadata
Trac field Value
Version 6.6
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture Unknown
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking