Can cardinality analysis subsume strictness analysis
Joachim Breitner
mail at joachim-breitner.de
Fri Nov 29 11:54:05 UTC 2013
Hi,
after playing a bit with the Demand analyser and trying debug tricky
bugs (#8569), I begin to wonder: Can cardinality analysis subsume
strictness analysis?
Not directly, obviously, but if we change
data Count = One | Many
to
data Count = AtMostOne | ExactlyOne | AtLeastOne | Many
(or some other form that would allow us to express all possible
intervals in {0,1,∞}), would the demand and cardinality analysis then
not subsume strictness, given that:
A value is used strictly if is definitely used at least once?
That might simplify the Demand.lhs code, and also the demand signatures,
quite a bit, because currently it carries strictness and demand data
around separately, duplicating lots of stuff.
Greetings,
Joachim
--
Joachim “nomeata” Breitner
mail at joachim-breitner.de • http://www.joachim-breitner.de/
Jabber: nomeata at joachim-breitner.de • GPG-Key: 0x4743206C
Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20131129/4dde7d1f/attachment.sig>
More information about the ghc-devs
mailing list