Closed natefaubion closed 7 years ago
It's unsafe because it violates referential transparency. The type signature says it works forall r. { | r }
, but you are able to observe more than that.
Maybe referential transparency isn’t the right word? There isn’t a use for this function in safe code since the whole point of records is that you know the fields statically, making this kind of check unnecessary. The only use case for it is if you are making a dynamic assertion about records, which I would consider inherently unsafe. Maybe “disingenuousHas” is a better name? :D
Thanks!
@natefaubion could you help me understand what makes this "unsafe"?