Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference in behavior with inline and multi-line definition with type annotation #13

Closed
mmhelloworld opened this issue Nov 8, 2014 · 1 comment
Labels

Comments

@mmhelloworld
Copy link
Member

frege> type F = (forall b. [b] -> [b]) -> Int
type alias F :: ?

frege> g :: F -> Int; g f = undefined
4: application of g will diverge.
4: Type [b]->[b]
inferred from  g is not as polymorphic as
expected type  forall b.[b] -> [b]

frege> :{
> g :: F -> Int
> g f = undefined
> :}
function g :: ((forall b.[b] -> [b]) -> Int) -> Int
@mmhelloworld
Copy link
Member Author

Fixed with Frege/frege-interpreter@04a9019 .

Both command line REPL and online REPL now support the following:

frege> type F = (forall b. [b] -> [b]) -> Int
type alias F :: ?

frege> g :: F -> Int; g f = undefined
function g :: ((forall b.[b] -> [b]) -> Int) -> Int

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant