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,862
    • Issues 4,862
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 460
    • Merge requests 460
  • 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
  • #8925
Closed
Open
Created Mar 23, 2014 by soapie@trac-soapie

:print and :sprint sometimes fully evaluates strings

Not too confident in my terminology but :sprinting a string that has been evaluated down to its spine seems to fully evaluate the string:

Prelude> let a = map (Debug.Trace.trace "!!!") "abc"
Prelude> a `seq` ()
()
Prelude> :sprint a
a = _ : _                     -- looks fine
Prelude> length a
3
Prelude> :sprint a
a = "!!!                      -- strange!
a!!!
b!!!
c"

What I expect to see is a = [_,_,_]. :print behaves similarly. Since neither :print nor :sprint is supposed to force any evaluation this seems like a bug. At least it can make debugging quite confusing if you're not aware of it!

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC hvr
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