selective icon indicating copy to clipboard operation
selective copied to clipboard

Which of the predefined Selective instances are rigid?

Open kozross opened this issue 4 years ago • 3 comments

It would be really useful to know this. While it can be inferred from the implementations, having this information in the documentation for the instances would be great.

kozross avatar Dec 20 '20 22:12 kozross

Most of the instances are rigid. Three notable exceptions are: Under and Validation, as well as Lift f that inherits the rigidity of the underlying selective functor f.

I agree that we should document this. Perhaps, marking the few non-rigid instances should be sufficient?

snowleopard avatar Dec 21 '20 00:12 snowleopard

@snowleopard If as you say most instances are rigid, marking the exceptions alone, while adding something like "Unless stated otherwise, the instances of Selective defined in this package are rigid.` to the paragraph describing rigidity, would do.

Out of curiosity, how does rigidity interact with Compose? I assume it inherits the rigidity of the Selective 'component'? This kind of thing is also worth explaining on 'lifty' instances (that is, instances of types similar to Compose).

kozross avatar Dec 21 '20 03:12 kozross

Hmm, interesting. It's not immediately clear to me whether Selective (Compose f g) inherits the rigidity of the inner instance Selective g.

For Product f g the answer seems simple: the result is rigid only if both f and g are rigid.

snowleopard avatar Dec 21 '20 23:12 snowleopard