Kchewz

Untitled

Nov 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. TPair (TInt 1) (TVar 0)
  2. TVar (LVar 0)
  3. Map.empty
  4.  
  5. should be
  6. TPair (TInt 1) (TVar (LVar 0))
  7. TVar (LVar 0)
  8. Map.empty
  9.  
  10. this will fails the occur check
  11.  
  12.  
  13. You want to add this to the substitution:
  14. {TPair (TInt 1) (TVar (LVar 0))}
  15. -> {LVar 0: TPair (TInt 1) (TVar (LVar 0))}
  16.  
  17. before doing extend, walk this term: TPair (TInt 1) (TVar (LVar 0))
  18. we get the same thing back
  19. ^^Test for A2 for ===
  20.  
  21.  
  22.  
  23. Conjegate: (conjunction variable)
  24.  
  25. a = Just 8
  26. >a
  27. Just 8
  28. >let (Just b) = a
  29. > b
  30. 8
  31. >a
  32. Just 8
  33. >f (Just x) = x
  34. >f a
  35. 8
  36.  
  37.  
  38.  
  39.  
  40. TPair (TInt 1) (TVar (LVar 0))
  41. TPair (TInt 1) (TVar (LVar 0))
  42. Map.empty
  43.  
  44. ^This case is already unified so youd return an empty map
Add Comment
Please, Sign In to add comment