Skip to content

The dreaded State Hack. Optimisation can lose sharing in IO code, esp replicateM

Summary

Many bug reports are ultimately due to the "state hack". This ticket serves a summary of these various reports, and points to thinking about solutions.

Other tickets reporting the same problem (please extend this list; "closed" probably means "duplicate" not "solved):

Possible solutions

This particular ticket's report

The simplifier is losing sharing in spectral/calendar, probably because we're being a bit fast-and-loose with eta-expanding State# lambdas. A quick look at the Core shows that calFor year is not shared across multiple executions.

Trac metadata
Trac field Value
Version 6.6
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
Edited by Sylvain Henry
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information