If we look at the containers package. They have Data.Map.Strict, but there is no equivalent Data.Set.Strict. Would it make sense for it to exist?
Set is strict. In a same way as both Map.Lazy and Map.Strict are strict in the key. E.g from the Data.Map.Lazy module:
This module satisfies the following strictness property:
- Key arguments are evaluated to WHNF
The reason is quite obvious: to make any decisions (i.e. something else than always return EQ) the compare have to evaluate the arguments to at least a WHNF (to separate different constructors in a sum type, e.g.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With