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,248
    • Issues 5,248
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 573
    • Merge requests 573
  • 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
  • #1799
Closed
Open
Issue created Oct 23, 2007 by guest@trac-guest

Retain export-list order in ModIface, use it in :browse

while trying to write a test for an extension of :browse, i encountered an issue with the existing functionality: the order of names is not stable, making it difficult to write meaningful tests for :browse.

a reduced test case & output are appended below, showing that output order is affected by prior usage, in both 6.6.1 and HEAD.

i would prefer for the items to appear in source order, but at the point :browse gets a hand on them, source location information might not be available; sorting by Name would be random due to uniqueIds, and lexicographic sorting would be confusing to users (spreading related items all over the alphabet, instead of keeping the order in which they appear in source and documentation).

is there a way to keep the items in source order, within each module (modules themselves could be sorted lexicographically)? note that alphabetically sorting names would very much be a last resort!

--------------------------------------- testing :browse
$ cat y.hs
import Prelude()
import Data.Maybe(catMaybes,mapMaybe)

$ cat .ghci
:t Data.Maybe.mapMaybe

$ ghcii.sh --version
The Glorious Glasgow Haskell Compilation System, version 6.6.1

$ /cygdrive/c/fptools/ghc/compiler/stage2/ghc-inplace --interactive --version
The Glorious Glasgow Haskell Compilation System, version 6.9.20071019

$ (echo :l y.hs;echo :browse '*Main') | ghcii.sh -v0
Data.Maybe.mapMaybe :: (a -> Maybe b) -> [a] -> [b]
mapMaybe :: (a -> Data.Maybe.Maybe b) -> [a] -> [b]
catMaybes :: [Data.Maybe.Maybe a] -> [a]

$ (echo :l y.hs;echo :browse '*Main') | ghcii.sh -v0 -ignore-dot-ghci
catMaybes :: [Data.Maybe.Maybe a] -> [a]
mapMaybe :: (a -> Data.Maybe.Maybe b) -> [a] -> [b]

$ (echo :l y.hs;echo :browse '*Main') | /cygdrive/c/fptools/ghc/compiler/stage2/ghc-inplace --inter
active  -v0
Data.Maybe.mapMaybe :: (a -> Maybe b) -> [a] -> [b]
mapMaybe :: (a -> Data.Maybe.Maybe b) -> [a] -> [b]
catMaybes :: [Data.Maybe.Maybe a] -> [a]

$ (echo :l y.hs;echo :browse '*Main') | /cygdrive/c/fptools/ghc/compiler/stage2/ghc-inplace --inter
active  -v0 -ignore-dot-ghci
catMaybes :: [Data.Maybe.Maybe a] -> [a]
mapMaybe :: (a -> Data.Maybe.Maybe b) -> [a] -> [b]
Trac metadata
Trac field Value
Version 6.6.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC claus.reinke@talk21.com
Operating system Unknown
Architecture Unknown
Edited Mar 09, 2019 by Simon Marlow
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking