<div dir="ltr">In a custom prelude, I have written the following definitions:<div><br></div><div>data Truth = True | False</div><div><br></div><div>ifThenElse :: Truth -> a -> a -> a</div><div>ifThenElse True x _ = x</div><div>ifThenElse False _ x = x</div><div><br></div><div>(==) :: a -> a -> Truth</div><div>(==) = ...</div><div><br></div><div>I'm replacing Bool with my own Truth type.  Clients will be built with RebindableSyntax, so that they will use these definitions for desugaring.</div><div><br></div><div>However, if I write this:</div><div><br></div><div>f :: Text -> Text</div><div>f "r" = "rrr"</div><div>f other = other</div><div><br></div><div>I get a build error indicating that GHC expected the (==) operator to return a value of type Bool, rather than Truth.</div><div><br></div><div>Shouldn't pattern matching desugar to use overloaded ifThenElse in these situations?  Or is it expected that use of GHC.Types.Bool is hard-coded even with RebindableSyntax enabled?</div><div><br></div><div>Thanks,</div><div>Chris</div></div>