Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,322
    • Issues 4,322
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 362
    • Merge Requests 362
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #8970

Closed
Open
Opened Apr 07, 2014 by tensor5@trac-tensor5

Non-exhaustive pattern match warning with DataKinds and TypeFamilies

The code is:

data K = Foo
       | Bar

data D1 :: K -> * where
    F1 :: D1 Foo
    B1 :: D1 Bar

class C (a :: K -> *) where
    data D2 a :: K -> *
    foo :: a k -> D2 a k -> Bool

instance C D1 where
    data D2 D1 k where
              F2 :: D2 D1 Foo
              B2 :: D2 D1 Bar
    foo F1 F2 = True
    foo B1 B2 = True

With -Wall it gives the warning:

Test.hs:23:5: Warning:
    Pattern match(es) are non-exhaustive
    In an equation for `foo':
        Patterns not matched:
            F1 B2
            B1 F2
Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#8970