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

function returning pair with higher-rank type does not typecheck #95

Open
GoogleCodeExporter opened this issue Aug 9, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. load this simple program

---------------------
data A = A (forall x. x -> x, Int)
--data A = A (A -> A, Int)

--f3 :: A -> (forall x. x -> x, Int)
f3 (A (c@(a, b))) = c
--f3 (A c) = c

---------------------

2. observe error:

**** Near File: impred.prg
line: 5 column: 1
Pattern match failure in do expression at Infer.hs:1632:25-30

3. not using higher-rank structure as return value resolves the problem.
also supplying a type signature resolves te problem.

What is the expected output? What do you see instead?

The error message is inacceptable, we should urge the user to supply a type 
signature for f3.

What does Haskell (GHC?) say in this situation?

Please use labels and text to provide additional information.

Original issue reported on code.google.com by ggr...@gmail.com on 10 Aug 2011 at 8:53

Attachments:

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

No branches or pull requests

1 participant