Version française
Home     About     Download     Resources     Contact us    
Browse thread
specifying the type of an argument with more than one #classpath
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Peng Zang <peng.zang@g...>
Subject: Re: [Caml-list] specifying the type of an argument with more than one #classpath
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This works if #foo just implies one method "foo".

But suppose it were more general, like:

  #drawable which implies methods draw2,drawfast,drawbuffered,etc..

and

  #foldable which implies methods iter,sample,map,to_list,etc...

We would like to avoid calling every implied method.


Thanks,

Peng


On Wednesday 05 March 2008 08:56:39 pm Edgar Friendly wrote:
> Peng Zang wrote:
> > Is there some simple trick people have found for specifying various type
> > constraints on arguments?
>
> How about something like:
> let takesomefooable_and_barable x =
> 	ignore(lazy(x#foo));
> 	ignore(lazy(x#bar));
> 	x
>
> E


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.7 (GNU/Linux)

iD8DBQFHz1FEfIRcEFL/JewRAnlgAJ9kD4/itxfOvyl+IPIIaYojssHG+wCcDXIg
1CkxusK3dP96MHBS1PBe67k=
=2X1k
-----END PGP SIGNATURE-----