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

Incorrectly inferring types #19

Open
joshcox opened this issue Oct 23, 2014 · 0 comments
Open

Incorrectly inferring types #19

joshcox opened this issue Oct 23, 2014 · 0 comments
Labels

Comments

@joshcox
Copy link
Collaborator

joshcox commented Oct 23, 2014

Reproducer:

fun createNStreams(n,s) {
  fun f (n) iterate x in s { if moduloI(x,n) == 0 then emit x };
  fun g (n) if n == 1 then [] else f(n):::g(n-1);
  g(n)
}

The inferred type of this function is:
createNStreams :: (#a, Stream Int) -> List 'b;

This bug can be sidestepped by providing a correct type signature. The compiler accepts the correct type signature provided. For this particular function:
createNStreams :: (Int, Stream Int) -> List (Stream Int);

@joshcox joshcox added the Bug label Oct 23, 2014
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