Re: Partial Type Declarations

1999-11-17 Thread Fergus Henderson
On 17-Nov-1999, Koen Claessen <[EMAIL PROTECTED]> wrote: > I think it would be easy to extend most type check/inference > algorithms with this new feature. (Any comments on this?) I agree. For the Mercury type checker I'd estimate that it would probably take a good programmer who was familiar wi

Re: Partial Type Declarations

1999-11-17 Thread Bart Demoen
> So, we are allowed to use (..) at any place in the > context (or maybe even type), to show the compiler > that you know "something" should be there. HAL has this feature. HAL ressembles Mercury, but with support for constraint solvers and with real logical variables. Syntax is ? instead of th

Re: Partial Type Declarations

1999-11-17 Thread Alex Ferguson
Koen Claessen: > I want to propose a modest extension to Haskell, which > would solve a common irritating problem in programming > in Haskell, and on-the-fly solves the practical programming > problems occuring due to the monomorphism restriction. I've banged into this more than once, so I have

Partial Type Declarations

1999-11-17 Thread Koen Claessen
I want to propose a modest extension to Haskell, which would solve a common irritating problem in programming in Haskell, and on-the-fly solves the practical programming problems occuring due to the monomorphism restriction. Problem Definition == Currently, in Haskell, when defi

Re: Partial Type Declarations

1999-01-16 Thread Wolfram Kahl
Jeffrey R. Lewis" <[EMAIL PROTECTED]> wrote: > > Anyway, the only thing missing now in the above proposal > is a similar flexibility with contexts. > Say, you want `b' to be a bound, and thus use :<=, > but you want the context to be exact > (i.e. you don't want extra context elements to be

Re: Partial Type Declarations

1999-01-16 Thread Wolfram Kahl
Starting from Jeffrey R. Lewis' <[EMAIL PROTECTED]> wish to let partial type declarations express binding of SOME type variables > > foo :: C a => a -> _b and modulating the syntax proposed by Claus Reinke <[EMAIL PROTECTED]>, > > foo :<= C

Re: Partial Type Declarations

1999-01-16 Thread Alex Ferguson
Patrik Jansson: > I like ? better than .., but maybe the Haskell "don't care"-symbol _ > could be even more suggesting: > > q :: a -> _ -> c > qa_ = c > > Syntactically this is closer to what is currently allowed as type > variables and it would easily (in the sense that such a pro

Re: Partial Type Declarations

1999-01-16 Thread Jeffrey R. Lewis
Wolfram Kahl wrote: > Jeffrey R. Lewis" <[EMAIL PROTECTED]> writes: > > > > foo :<= C a => a -> b roughly equiv to foo :: C _a => _a -> _b > > > > I can easily imagine that you might want some variables to be a bound, and > > others to be exact, as in > > > > foo :: C a =>

Re: Partial Type Declarations

1999-01-16 Thread Wolfram Kahl
To my last message: > Jeffrey R. Lewis" <[EMAIL PROTECTED]> writes: > > > > foo :<= C a => a -> b roughly equiv to foo :: C _a => _a -> _b > > > > I can easily imagine that you might want some variables to be a bound, and > > others to be exact, as in > > > > foo

Re: Partial Type Declarations

1999-01-16 Thread Wolfram Kahl
Jeffrey R. Lewis" <[EMAIL PROTECTED]> writes: > > foo :<= C a => a -> b roughly equiv to foo :: C _a => _a -> _b > > I can easily imagine that you might want some variables to be a bound, and > others to be exact, as in > > foo :: C a => a -> _b > > I don't think the

Re: Partial Type Declarations

1999-01-16 Thread Jeffrey R. Lewis
Claus Reinke wrote: > > what I wanted to write was > a partial specification, which I would want to write as > > foo :<= C a => a -> b > > Read e :<= t as "the type of e should be bounded by t". Choose a better > symbol if you like -- the idea is to keep the syntax of types unchanged, > and to

Re: Partial Type Declarations

1999-01-16 Thread Claus Reinke
>Koen Claessen wrote: >> We should allow "partial type specification". The programmer is >> allowed to specify as much information about the type as (s)he wants. >> >> The partial type specification would be taken as a "skeleton", >> merely filled in by the type inference algorithm. >> foo ::

Re: Partial Type Declarations

1999-01-16 Thread Patrik Jansson
On Wed, 17 Nov 1999, Koen Claessen wrote: > foo :: (..) => a -> b -> c This is certainly something I've been bitten by. I like ? better than .., but maybe the Haskell "don't care"-symbol _ could be even more suggesting: q :: a -> _ -> c qa_ = c Syntactically this is closer to w

RE: Partial Type Declarations

1999-01-15 Thread Simon Peyton-Jones
| Here is how we could specify partial type information | about foo: | | foo :: (..) => a -> b -> c Good idea. Mark and I discussed something very like this when we were writing our Haskell workshop paper, but it didn't make it into the paper. Seems easy to use and to implement. Fergus s

RE: Partial Type Declarations

1999-01-15 Thread Frank A. Christoph
Koen Claessen wrote: > We should allow "partial type specification". The programmer > is allowed to specify as much information about the type as > (s)he wants. > > The partial type specification would be taken as a "skeleton", > merely filled in by the type inference algorithm. > > Here is how we