Closed LightAndLight closed 1 year ago
The computation expression is desugared to io.andThen (io.pure "hello") (\string -> if string then io.pure () else io.pure ())
. The lambda is inferred to have type Bool -> IO ()
.
When checking that \string -> if string then io.pure () else io.pure ()
has type String -> IO ?
, we need to push the argument type String
down so that string : String
while inferring if string then io.pure () else io.pure ()
.
Here is a prototype of how to "push" known types down in a unification-based type checker.
Branch: https://github.com/LightAndLight/ipso/tree/issue/218
Program:
Expected output:
Actual output: