Skip to content

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

@GoogleCodeExporter

Description

@GoogleCodeExporter
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:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions