case expression inference
This commit is contained in:
18
README.org
18
README.org
@@ -62,15 +62,15 @@ Available debug flags include:
|
||||
|
||||
** DONE [#A] HM memoisation prevents shadowing :bug:
|
||||
CLOSED: [2024-04-04 Thu 12:29]
|
||||
Example:
|
||||
#+begin_src haskell
|
||||
-- >>> runHM' $ infer1 [rlpExpr|let f = \x -> x in f (let f = 2 in f)|]
|
||||
-- Left [TyErrCouldNotUnify
|
||||
-- (ConT "Int#")
|
||||
-- (AppT (AppT FunT (ConT "Int#")) (VarT "$a2"))]
|
||||
-- >>> :t let f = \x -> x in f (let f = 2 in f)
|
||||
-- let f = \x -> x in f (let f = 2 in f) :: Int
|
||||
#+end_src
|
||||
Example:
|
||||
#+begin_src haskell
|
||||
-- >>> runHM' $ infer1 [rlpExpr|let f = \x -> x in f (let f = 2 in f)|]
|
||||
-- Left [TyErrCouldNotUnify
|
||||
-- (ConT "Int#")
|
||||
-- (AppT (AppT FunT (ConT "Int#")) (VarT "$a2"))]
|
||||
-- >>> :t let f = \x -> x in f (let f = 2 in f)
|
||||
-- let f = \x -> x in f (let f = 2 in f) :: Int
|
||||
#+end_src
|
||||
For the time being, I just disabled the memoisation. This is very, very bad.
|
||||
*** Closing Remarks
|
||||
Fixed by entirely rewriting the type inference algorithm :P. Memoisation is
|
||||
|
||||
Reference in New Issue
Block a user