TypeEqualsBool class can assert type inequality.#29
TypeEqualsBool class can assert type inequality.#29matthewleon wants to merge 1 commit intopurescript:masterfrom
Conversation
Depends on Instance Chains.
|
This PR adds a type class class TypeEqualsBool :: forall k1 k2. k1 -> k2 -> Bool -> Constraint
class TypeEqualsBool a b (o :: Boolean) | a b -> o
instance reflTypeEqualsBool :: TypeEqualsBool a a True
else instance notTypeEqualsBool :: TypeEqualsBool a b FalseThis library also attempts to port over the |
|
I don't believe we have to merge |
|
AFAICT, [ Thinking about this more, I don't think |
Depends on Instance Chains.
This moves the type equality test here from
purescript-type-equality, which would be deprecated if this proposal were to be accepted. I don't really see a way to do this otherwise, as type-levelBooleanis defined in this lib.This is inspired by some chats on Slack, as well as the example @LiamGoodacre made for Instance Chains: https://github.com/purescript/purescript/blob/master/examples/passing/InstanceChain.purs