#7061: Allow 'default' declarations within GHCi
-+--
Reporter: parcs | Owner: simonmar
Type: feature request | Status: new
Priority: high
#7061: Allow 'default' declarations within GHCi
-+--
Reporter: parcs | Owner: simonmar
Type: feature request | Status: patch
Priority: high
#7061: Allow 'default' declarations within GHCi
---+
Reporter: parcs | Owner: simonmar
Type: feature request | Status: closed
Priority: high
#7061: Allow 'default' declarations within GHCi
-+--
Reporter: parcs | Owner:
Type: feature request | Status: new
Priority: high
#7061: Allow 'default' declarations within GHCi
--+-
Reporter: parcs | Owner:
Type: feature request | Status: new
Priority: normal
It's arguably a bug in ghci -- but it's not quite clear what the right
answer is. Suppose you are in the top level scope of two modules with
differing default declarations. So GHCi uses the default default for
the top level, always.
Simon
| -Original Message-
| From: [EMAIL PROTECTED
Hi,
apparently ghci doesn't take default declarations into account.
Inspired by a question on the hugs-users list I wrote
module BoolNum where
default (Bool, Rational)
instance Num Bool where
(+) = (/=)
(-) = (/=)
(*) = ()
negate x = x
abs x = x
signum x = x
Sven,
You've already heard from nhc, hbc, and ghc, so here's the
perspective from Hugs-land to complete your set.
| What is the rationale for the second condition, i.e. why is no
| defaulting done when a user-defined class is involved? Example:
Defaulting is one of those places where Haskell
Sven Panne wrote:
The Haskell 98 report, section 4.3.4 states:
[...] In situations where an ambiguous type is discovered, an
ambiguous type variable is defaultable if at least one of its
classes is a numeric class (that is, Num or a subclass of Num)
and if all of its classes