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.
I know this is a somewhat dubious request :P but I'd like an
unsafeHas
function. I would like to add something topurescript-variant
for partial matching with a record (right now it must always be total). It's possible for me to do this bycontract
ing 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 anunsafeHas
function to do the dynamic lookup instead, which wouldn't require any IsSymbol constraints.