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
  • #17006

Closed
Open
Opened Jul 30, 2019 by Simon Michael@simonmichaelReporter

type annotations on the left cause ellipsis (...) cost centres in profiles

Summary

When defining a large multi-line subexpression in a where clause, I often write the type signature on the left side of the equals sign, so that the name and type are close together. This causes extra ellipsis ("(...)") cost centres to appear in time & space profiles, making those profiles less useful.

Steps to reproduce

A minimal example from alp on #ghc: https://gist.github.com/alpmestan/66b32f20622160c74f4d4ffd24d518d8

A real-world example: showamt is shown by name but declaredprices is not. More precisely, that cost center, with source location (121,5)-(128,43), is shown both as pricesAtDate.declaredprices and as pricesAtDate.(...), with only the latter having non-zero time/alloc/ticks/bytes.

If the type annotation is removed, or moved to the right hand side, the (...) cost centres no longer appear in the profile.

Expected behavior

A LHS-type-annotated subexpression should appear normally in the profile, without extra (...) cost centres.

Environment

  • GHC version used: 8.6.5

Optional:

  • Operating System: mac mojave
  • System Architecture:

Related:

https://github.com/ghc/ghc/blob/master/compiler/deSugar/Coverage.hs#L336

the essence of your problem seems to be that any PatBind gets treated this way. https://hackage.haskell.org/package/ghc-8.6.5/docs/HsBinds.html#v:PatBind and the note mentioned there should probably enlighten you

Edited Jul 30, 2019 by Simon Michael
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#17006