Ticket #1555 (closed feature request: wontfix)

Opened 6 years ago

Last modified 5 months ago

Reverse do notation: lexer bug?

Reported by: dons Owned by:
Priority: normal Milestone: _|_
Component: Compiler (Parser) Version: 6.6.1
Keywords: Cc: dons@…, dherman@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Noticed here:

 http://calculist.blogspot.com/2007/07/cute-idiom-from-haskell.html

The following is accepted by GHC:

main = do
    getChar -> c
    print c

Yielding the same program as if we'd written;

main = do
    c <- getChar
    print c

The above blogger uses this to ingeniously embed:

gamma |- e -> v

in Haskell, but surely this is either a lexer bug, or an interesting syntactic feature that shouldn't be enabled by default?

Change History

Changed 6 years ago by simonmar

  • status changed from new to closed
  • resolution set to fixed

I'm not quite sure how that sneaked in, but it seems to be my fault and I've now removed it.

Changed 5 years ago by dherman

Would it be possible to revisit this decision? It's really a nice notation for interpreters (rho |- expr -> value) and type checkers that annotate their results (Gamma |- expr ::: type -> expr'). Don suggested an opt-in compiler flag or pragma. That would be fine with me.

Changed 5 years ago by dherman

  • cc dherman@… added

Changed 5 years ago by simonmar

  • status changed from closed to reopened
  • type changed from bug to feature request
  • resolution fixed deleted

Changed 5 years ago by igloo

Note that similar syntax is now used by the view patterns extension, which might add confusion.

Changed 5 years ago by igloo

  • milestone set to _|_

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)

Changed 5 months ago by morabbin

  • failure set to None/Unknown

Bump; what's the dealio?

Changed 5 months ago by simonmar

  • status changed from new to closed
  • resolution set to wontfix
Note: See TracTickets for help on using tickets.