TDNR without new operators or syntax changes

Jeremy voldermort at
Tue May 17 07:21:28 UTC 2016

AntC wrote
> No. For TDNR GHC needs some syntactic signal to trigger disambiguation.
> ...
> I suspect that if you took the syntax away from TDNR, you'd have very
> little left.

To copy an example from the TDNR wiki page:

  module Foo where
    import Button( Button, reset ) as B
    import Canvas( Canvas, reset ) as C

    f :: Button -> Canvas -> IO ()
    f b c = do { B.reset b; C.reset c }

With syntaxless TDNR enabled, the last line could be:

    f b c = do { reset b; reset c }

This requires no syntactic signal. The compiler will see two candidate
definitions for reset, and in each case, pick the one which matches its

View this message in context:
Sent from the Haskell - Glasgow-haskell-users mailing list archive at

More information about the Glasgow-haskell-users mailing list