Opened 5 years ago

Closed 5 years ago

#8417 closed bug (invalid)

Pattern matching on OverloadedLists is erratic

Reported by: monoidal Owned by:
Priority: normal Milestone:
Component: Compiler (Type checker) Version: 7.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: GHC accepts invalid program Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Consider

λ> :set -XOverloadedLists 
λ> :t \[True] -> 'a'
\[True] -> 'a' :: (GHC.Exts.IsList l, GHC.Exts.Item l ~ Bool) => l -> Char
λ> :t \[not] -> 'a'
\[not] -> 'a' :: GHC.Exts.IsList l => l -> Char

The first type is expected, but the second one should include GHC.Exts.Item l ~ Bool -> Bool and Eq (Bool -> Bool). Currently e.g. (\[not] -> True) [id] evaluates to True.

Change History (1)

comment:1 Changed 5 years ago by monoidal

Resolution: invalid
Status: newclosed

I'm wrong, not works as a wildcard pattern.

Note: See TracTickets for help on using tickets.