[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell
Subject: Re: Question
From: kh () dcs ! gla ! ac ! uk
Date: 1993-11-17 12:08:49
Message-ID: 9311171208.AA04691 () animal ! cs ! chalmers ! se
[Download RAW message or body]
Resent-Message-Id: <9311171208.AA04691@animal.cs.chalmers.se>
From: kh@dcs.gla.ac.uk
Subject: Re: Question
Date: Wed, 17 Nov 93 11:49:19 GMT
To: augustss, haskell@dcs.gla.ac.uk
Old-Resent-From: haskell-request@dcs.gla.ac.uk
Errors-To: haskell-request@dcs.gla.ac.uk
Approved: haskell@dcs.gla.ac.uk
Resent-Date: Wed, 17 Nov 1993 11:49:40 +0000
Resent-From: kh
Resent-To: haskell-list-dist
> Prompted by an IOHCC entry I have the following question:
>
> Is the following legal?
>
> ----------------------
> module M(x) where
> x = 1
> z = x==1
> ----------------------
>
> If the definition of z wasn't there it would clearly be
> illegal since it exports an overload non-function value.
> But the use of x in z forces x to be in Int there, so
> maybe it's legal? (First I thought not, but now I'm in doubt.)
Yes, it's legal. The monomorphism restriction requires x to be
used at one type in M. This type is forced by the equality
(and default default type) to be Int.
Kevin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic