Opened 4 years ago

Closed 4 years ago

Last modified 2 years ago

#10564 closed bug (fixed)

GHC 7.10.2 RC cannot build HList-0.4.0.0

Reported by: snoyberg Owned by:
Priority: high Milestone: 7.10.2
Component: Compiler Version: 7.10.2-rc1
Keywords: FunDeps Cc:
Operating System: Linux Architecture: x86_64 (amd64)
Type of failure: GHC rejects valid program Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Another Stackage find:

http://lpaste.net/135061

Data/HList/Record.hs:575:10:
    Illegal instance declaration for ‘HasFieldM l (r xs) v’
      The liberal coverage condition fails in class ‘HasFieldM’
        for functional dependency: ‘l r -> v’
      Reason: lhs types ‘l’, ‘r xs’ do not jointly determine rhs type ‘v’
    In the instance declaration for ‘HasFieldM l (r xs) v’

Data/HList/Record.hs:587:10:
    Illegal instance declaration for
      ‘HasField l (Record (Tagged l1 v1 : r)) v’
      The liberal coverage condition fails in class ‘HasField’
        for functional dependency: ‘l r -> v’
      Reason: lhs types ‘l’, ‘Record (Tagged l1 v1 : r)’
        do not jointly determine rhs type ‘v’
    In the instance declaration for
      ‘HasField l (Record (Tagged l1 v1 : r)) v’

Data/HList/Record.hs:646:10:
    Illegal instance declaration for ‘HDeleteAtLabel Record l v v'’
      The liberal coverage condition fails in class ‘HDeleteAtLabel’
        for functional dependency: ‘l v -> v'’
      Reason: lhs types ‘l’, ‘v’ do not jointly determine rhs type ‘v'’
    In the instance declaration for ‘HDeleteAtLabel Record l v v'’

Data/HList/Record.hs:723:10:
    Illegal instance declaration for
      ‘HUpdateAtLabel2 l v (Tagged l' e : xs) xs'’
      The liberal coverage condition fails in class ‘HUpdateAtLabel2’
        for functional dependency: ‘l r v -> r'’
      Reason: lhs types ‘l’, ‘Tagged l' e : xs’, ‘v’
        do not jointly determine rhs type ‘xs'’
    In the instance declaration for
      ‘HUpdateAtLabel2 l v (Tagged l' e : xs) xs'’

Change History (5)

comment:1 Changed 4 years ago by rwbarton

Priority: normalhigh

Setting priority to high since it is a regression (or a change, at least) since 7.10.1.

Probably relevant is that the type classes involved are polykinded; I got too confused trying to work out the interaction between functional dependencies and polykinds to determine whether the program should be accepted or not.

comment:2 Changed 4 years ago by Simon Peyton Jones <simonpj@…>

In 7c07cf16ab5d5bdfb64efb1d4fc5f20cf7437437/ghc:

closeOverKinds *before* oclose in coverage check

Combining functional dependencies with kind-polymorphism is
devilishly tricky!  It's all documented in
    Note [Closing over kinds in coverage]

Fixes Trac #10564

comment:3 Changed 4 years ago by thoughtpolice

Status: newmerge

comment:4 Changed 4 years ago by thoughtpolice

Resolution: fixed
Status: mergeclosed

Merged to ghc-7.10.

comment:5 Changed 2 years ago by simonpj

Keywords: FunDeps added
Note: See TracTickets for help on using tickets.