Implict parameters and monomorphism

Dylan Thurston dpt@math.harvard.edu
Tue, 24 Apr 2001 22:51:41 -0400


On Tue, Apr 24, 2001 at 04:04:54PM -0700, Simon Peyton-Jones wrote:
> Question 1: can we "inherit" implicit parameters
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Consider this:
> 
> 	f x = (x::Int) + ?y
> ...
> 	f :: Int -> Int
> [versus]
> 	f :: (?y::Int) => Int -> Int
> 
> Question 2: type signatures
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
> OK, so it it legal to give an explicit, user type signature to f, thus:
> 
> 	f :: Int -> Int
> 	f x = (x::Int) + ?y
> ...

It seems desirable to provide some way to allow either possible answer
to Question 1 (i.e., dynamically scoped or statically scoped ?y).  Is
there some syntax for that (other than providing a type signature,
which I agree is not desirable)?

--Dylan Thurston