Skip to content

Unable to synthetize type for point-free expression #4573

Open
@alexandrubuzea

Description

@alexandrubuzea

Your environment

Which OS do you use: Ubuntu 20.04

Steps to reproduce

In a Haskell file, define the function func as follows:

func = filter . (/=)

Expected behaviour

The synthetized type (suggested by language server) should be func :: Eq a => a -> [a] -> [a]. This definition works just fine in GHCi command line with the previously-mentioned result.

Actual behaviour

Instead, the following annotation is suggested:

func :: GHC.Types.Any -> [GHC.Types.Any] -> [GHC.Types.Any]

and an error marker is put for (/=), with the error Ambiguous type variable ‘a0’ arising from a use of /= prevents the constraint (Eq a0) from being solved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..type: enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions