Advertisement
Guest User

Equality constraint/type family weirdness

a guest
May 2nd, 2022
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data Dict (c :: Constraint) where
  2.   Dict :: c => Dict c
  3.  
  4. class Foo (e :: Type) (r :: [Type])
  5. instance Foo e (e ': r)
  6.  
  7. type family R :: [Type]
  8. type family F (a :: [Type]) :: [Type]
  9.  
  10. compiles :: (R ~ Int ': F R, r ~ R)
  11.          => Dict (Foo Int R)
  12. compiles = Dict
  13.  
  14. errors :: (R ~ Int ': F R)
  15.       => Dict (Foo Int R)
  16. errors = Dict
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement