Ticket #1383 (closed feature request: wontfix)

Opened 6 years ago

Last modified 5 months ago

mistaken qualified infix syntax could have a nicer error message

Reported by: Isaac Dupree Owned by:
Priority: low Milestone: _|_
Component: Compiler Version: 6.6.1
Keywords: Cc: shumovichy@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Consider the expression Prelude.(+) ; we get Not in scope: data constructor `Prelude'. Unfortunately this is valid code if the module-referencing name also is the name of an in-scope data constructor. In the common case that it isn't, at least (a cursory inspection doesn't find any such exports in the libraries, e.g. Data.Map doesn't export a data-constructor Map), a message to the effect that infix operators must be qualified like (Prelude.+) instead, would be nice. (hierarchical module names probably make this a little more complicated somehow)

Change History

Changed 6 years ago by igloo

  • milestone set to 6.8

Changed 6 years ago by simonmar

  • priority changed from normal to low
  • milestone changed from 6.8 branch 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 5 months ago by Yuras

  • cc shumovichy@… added
  • failure set to None/Unknown

It can be pretty valid expression. An example:

Prelude> data Prelude a = Prelude a
Prelude> :t Prelude.(+)
Prelude.(+) :: Num a => a -> Prelude (a -> a)
Prelude> 

The ticket seems invalid for me.

Changed 5 months ago by simonpj

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

Yes, in Haskell Prelude.(+) means (Prelude . (+)), that is the composition of the function Prelude and the function (+).

There's a Haskell Prime proposal to change this:  http://hackage.haskell.org/trac/haskell-prime/wiki/QualifiedOperators

Till then I don't see how we can improve the error message.

Simon

Note: See TracTickets for help on using tickets.