Skip to content

Overloads without type specifications? #26

@dylex

Description

@dylex

I'm not sure whether this is expected to work, but I thought it was:

-- count :: Int -> Int
count x = x

length :: List a -> Int
length = ...

-- count :: List a -> Int
count x = length x

With the type specifications, this is fine because unify gives the right answer. Without them, both are a -> b, which means count 1 is ambiguous and we never try either of them. It seems like we could make this work by attempting an entire inference pass on all possibilities in this case, but maybe we don't want to?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions