Open 1derless opened 1 year ago
Quick Summary: Mutually recursive functions can be used to transmute a value to an arbitrary type.
-- repl says f has type `a -> b -> c` f x y = g x y g x y = if False then f x y else y eraseType : a -> b eraseType x = f () x
Ellie: https://ellie-app.com/jr8JcxccdXba1
I think the types of f and g should be a -> b -> b, and my Haskell compiler (ghc) agrees.
f
g
a -> b -> b
In addition, attempting to print the type of g in the repl causes the crash in the mutual recursion-related issue #2207.
Thanks for reporting this! To set expectations:
Finally, please be patient with the core team. They are trying their best with limited resources.
Quick Summary: Mutually recursive functions can be used to transmute a value to an arbitrary type.
SSCCE
Additional Details
Ellie: https://ellie-app.com/jr8JcxccdXba1
I think the types of
f
andg
should bea -> b -> b
, and my Haskell compiler (ghc) agrees.In addition, attempting to print the type of
g
in the repl causes the crash in the mutual recursion-related issue #2207.