Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,867
    • Issues 4,867
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 457
    • Merge requests 457
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9792
Closed
Open
Created Nov 11, 2014 by David Feuer@treeowlReporter

map/coerce rule does not fire until the coercion is known

If I write a nice, simple use, like:

myPotato = map coerce

or even

myPotato = Data.OldList.map coerce

the "map/coerce" rule does not fire.

It looks like there are two things getting in the way:

  1. The map rule fires first, turning map into a build/foldr form, which map/coerce does not recognize.
  2. Even if map gets written back, coerce has been expanded into something the rule doesn't recognize.

So we end up with something that looks like

myPotato =
  \ (@ a_are)
    (@ b_arf)
    ($dCoercible_arz :: Coercible a_are b_arf)
    (lst_aqx :: [a_are]) ->
    map
      @ a_are
      @ b_arf
      (\ (tpl_B2 [OS=ProbOneShot] :: a_are) ->
         case $dCoercible_arz
         of _ [Occ=Dead] { GHC.Types.MkCoercible tpl1_B3 ->
         tpl_B2 `cast` (tpl1_B3 :: a_are ~R# b_arf)
         })
      lst_aqx
Trac metadata
Trac field Value
Version 7.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Core Libraries
Test case
Differential revisions
BlockedBy
Related
Blocking
CC core-libraries-committee@haskell.org
Operating system
Architecture
Edited Mar 10, 2019 by David Feuer
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking