madlib icon indicating copy to clipboard operation
madlib copied to clipboard

Add `Constructor.is` for quick comparative shorthand

Open brekk opened this issue 2 years ago • 0 comments

type Cool a => Cool(a)
type Shit a => Shit(a)

nice = Cool("nice")
not_nice = Shit("shit")

Cool.is(nice) // true
Cool.is(not_nice) // false

I'd like some kind of affordance similar to the above, where we get an automatic .is function which returns a boolean based on is-constructor-x truthiness.

brekk avatar Jul 24 '22 15:07 brekk