madlib
madlib copied to clipboard
Add `Constructor.is` for quick comparative shorthand
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.