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,326
    • Issues 4,326
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 390
    • Merge Requests 390
  • 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
  • #11581

Closed
Open
Opened Feb 15, 2016 by rwbarton@trac-rwbarton

TypeError requires UndecidableInstances unnecessarily

The example from the TypeError documentation

type family ByteSize x where
    ByteSize Word16   = 2
    ByteSize Word8    = 1
    ByteSize a        = TypeError (Text "The type " :<>: ShowType a :<>:
                                   Text " is not exportable.")

requires UndecidableInstances:

BS.hs:11:5: error:
    • The type family application ‘(TypeError ...)’
        is no smaller than the instance head
      (Use UndecidableInstances to permit this)
    • In the equations for closed type family ‘ByteSize’
      In the type family declaration for ‘ByteSize’

Obviously there's no real danger of undecidability here.

I tried changing the declaration of TypeError to

type family TypeError :: ErrorMessage -> b where

but it didn't help. Same error. Is that a bug?

Edited Mar 10, 2019 by Ben Gamari
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#11581