Opened 7 years ago

Closed 7 years ago

Last modified 6 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: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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
 foldM 
  (flip o) 
   something
   (map f xxx)

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

Change History (4)

comment:1 Changed 7 years ago by guest

  • Resolution set to invalid
  • Status changed from new to closed

comment:2 Changed 7 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 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:4 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.