Skip to content
GitLab
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 5,261
    • Issues 5,261
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 568
    • Merge requests 568
  • 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 CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #9908
Closed
Open
Issue created Dec 19, 2014 by David Feuer@treeowlReporter

Improve enumFromX support for OverloadedLists

At present, OverloadedLists desugars [m..n] as fromList (enumFromTo m n). This is sometimes okay, but terrible for Data.Sequence. In particular, I want, for example,

[m..n] :: Seq Int

to end up as fromFunction (n-m+1) (+m), which performs much better. There are a few approaches that look reasonable:

  1. Try to catch fromList (enumFromTo m n) before enumFromTo becomes eftInt. This does not, unfortunately, seem to work.
  2. Grab eftInt after it gets written back from eftIntFB. This would probably work, but it's currently impossible because eftInt is not exported from GHC.Exts or even GHC.Enum.
  3. Add enumFromTo, etc., to the IsList class. Default to the current behavior, but if possible use fromListN for well-known Enum types.
Trac metadata
Trac field Value
Version 7.9
Type FeatureRequest
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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking