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,390
    • Issues 4,390
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 373
    • Merge Requests 373
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14582

Closed
Open
Opened Dec 14, 2017 by Simon Peyton Jones@simonpjDeveloper

Review and improve the Typeable API

This ticket is to track improvements in the Typeable API

There are a number of points I'm uncomfortable about

  • Data.Typable is presumably meant to be the public API, and is

    fairly small. But Data.Typeable.Internal has a much larger

    API, which includes pattern synonyms and suchlike that appear

    to be for the benefit of clients, not just internal use.

  • The Typeable API has type TypeRep = I.SomeTypeRep which is

    different to the type-indexed data TypeRep a defined in

    Data.Typeable.Internals. This is exteremly confusing. Perhaps

    this is intended to be temporary, while we are moving over to the new type-indexed

    representation. But then what's the transition plan?

  • I cordially dislike this stuff about IsApplication in

    Internals (this commit). It's hard for me to understand what's going on. I

    believe that the two pattern synonyms App and Con are supposed

    to be exhaustive -- if so, let's just write a COMPLETE pragma.

  • The code has many uses of unsafeCoerce, whereas the drive of

    our "Typed reflection in Haskell" paper was to reduced the size

    of the trusted code base. I'd like to see a comment on each of

    those uses of unsafeCoerce to explain.

  • Do we really need Con' as well as Con?

  • The API could do with some careful documentation, in Haddock,

    but perhaps also an accomanying wiki page. It's tricky stuff.

Here's the Typeablewikipage

Trac metadata
Trac field Value
Version 8.2.1
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#14582