Survival of generic-classes in ghc

Dylan Thurston
Wed, 20 Feb 2002 21:35:05 -0500

Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Feb 20, 2002 at 01:15:36PM -0800, Simon Peyton-Jones wrote:
> Another possiblity would be to make the ConCls class look like this
> 	class ConCls c where
>  	  name :: String
> 	  arity :: Int=20
> 	  ...etc...
> Now we'd have to give an explicit type argument at the call site:
>       show {| Constr c t |} (Con x) =3D (name {| c |}) ++ show x
> I quite like the thought of being able to supply explicit type
> arguments....
> but I don't konw how to speak about the order of type parameters.
> What order does map takes its two type parameters in?

Sorry, this seems like a non-sequitur to me?

'map' has type '(a->b) -> [a] -> [b]'; supplying explicit type
parameters would mean giving values to 'a' and 'b'.  If I wanted to
propose notation for this, I would suggest, e.g.,
  (map :: (String -> Int) -> [String] -> [Int]) length ["Hello", "World"]

'name' (above) has type 'String'; the '{| c |}' is not providing a type
parameter in the same sense.

What am I missing?


Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see