Add an `unsafeHas` function
natefaubion opened this issue · 1 comments
natefaubion commented
I know this is a somewhat dubious request :P but I'd like an unsafeHas function. I would like to add something to purescript-variant for partial matching with a record (right now it must always be total). It's possible for me to do this by contracting the variant first, which essentially does the "has" check for me, but it requires me to build a List of IsSymbol constraints on every invocation, and then walk the list to see if the variant tag is within bounds. However, if I have a record of case eliminators, then I could just use an unsafeHas function to do the dynamic lookup instead, which wouldn't require any IsSymbol constraints.
paf31 commented
I'd be fine with adding it.