Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#1613 closed support request (invalid)

Derived types unequal with let binding

Reported by: popcount@… Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The types of x and y are different. This breaks the replacing equals with equals gives equals property. I am not sure whether this is a bug, but I would be very keen to know whether it is.

class X l z b m | l -> z b where 
  p:: (Show a, Show b, Show b') => l a b -> m (l a b')
  e::(Show a, Show b) => l a b ->  m [z]

foo :: (X l a b m, Show b, Show a1) => [a] -> l a1 b -> m [(Int, Int, b)]
foo = undefined
o :: (Show z1, Show b,  X l z b m) =>(Int, Int, b) -> l a1 b -> m (l z1 b)
o = undefined

x f r = do
 es <- e r
 something <- p r
 xxx <- foo es r
  (flip o) 
   (map f xxx)

y f r = do
 es <- e r
 something <- p r
 xxx <- foo es r
 let abc = map f xxx
  (flip o) 

Change History (4)

comment:1 Changed 10 years ago by guest

Resolution: invalid
Status: newclosed

comment:2 Changed 10 years ago by Isaac Dupree

let-bindings generalize, (is there an effect if they are affected by the monomorphism restriction?), which could have odd effects with type-system extensions (which doesn't tell me, either, whether this is a bug).

comment:3 Changed 9 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:4 Changed 9 years ago by simonmar

Operating System: UnknownUnknown/Multiple
Note: See TracTickets for help on using tickets.