Not sure how to express it in words, but:
class WithoutSym t where
wrel ∷ ∀ sym r2
. IsSymbol sym
⇒ RowCons sym t () r2
⇒ RowLacks sym ()
⇒ SProxy sym
→ t
→ { | r2 }
-- | This works fine
instance wsInt ∷ WithoutSym Int where
wrel sym p = insert sym p {}
class IsSymbol sym <= Rel t sym where
rel ∷ ∀ r2
. RowCons sym t () r2
⇒ RowLacks sym ()
⇒ SProxy sym
→ t
→ { | r2 }
instance relInt ∷ Rel Int "test" where
rel sym p = insert sym p {}
-- | ^
-- | Could not match type
-- | ( test :: Int
-- | )
-- | with type
-- | r24
-- | Prim.RowCons "test"
-- | Int
-- | ()
-- | r24
Is this a compiler bug or is it expected? You can try it out: http://try.purescript.org/?backend=core&gist=855016e5488c0cafeedd98ff82955518
Not sure how to express it in words, but:
Is this a compiler bug or is it expected? You can try it out: http://try.purescript.org/?backend=core&gist=855016e5488c0cafeedd98ff82955518