Can cardinality analysis subsume strictness analysis

Joachim Breitner mail at
Fri Nov 29 11:54:05 UTC 2013


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
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.


Joachim “nomeata” Breitner
  mail at joachim-breitner.de
  Jabber: nomeata at  • GPG-Key: 0x4743206C
  Debian Developer: nomeata at
-------------- 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: <>

More information about the ghc-devs mailing list