[Haskell-cafe] Re: Fractional/negative fixity?
lemming at henning-thielemann.de
Wed Nov 8 10:04:05 EST 2006
On Wed, 8 Nov 2006, Nils Anders Danielsson wrote:
> On Wed, 08 Nov 2006, "Arie Peterson" <ariep at xs4all.nl> wrote:
> > Specifying precedence 'lazily', by a partial order, does not suffer from
> > this problem, because it only requires you to make local decisions.
> Assuming we only want to be able to make local decisions.
> Let's say that we want == to bind less tightly than +, as it is now.
> Let's also say that Eq and Num are defined in two different
> _unrelated_ modules (this of course implies that Eq is not a
> superclass of Num). Where and how would we specify the relation
> between these two operators?
Depends on what we consider being more special.
* Does addition require comparison? Not in Haskell. However, the
recursive implementation of addition for Peano numbers need equality
* Provide all additive types comparison? No.
* Does comparison require addition? No.
So, these concepts seem to be unrelated at first. If the Prelude would be
splitted into modules, where (==) and (+) are separated, and no module
imports the other one, then we need a third module, which states the
relation between (==) and (+). If I have missed something, and say (+)'s
module imports (==)'s one, then (+)'s module should define the relation.
More information about the Haskell-Cafe