caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] still silly issues on polymorphic types
@ 2011-09-27 11:46 Walter Cazzola
  2011-09-27 12:57 ` Christophe Papazian
  2011-09-27 13:16 ` Jacques Garrigue
  0 siblings, 2 replies; 12+ messages in thread
From: Walter Cazzola @ 2011-09-27 11:46 UTC (permalink / raw)
  To: OCaML Mailing List

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1350 bytes --]

Dear all,
I'm still playing around with functors, modules and polymorphism but
I've some problems with this last concept.

In the attached files I have tried to implement a sort of function with
a variable number of arguments (based on continuation) and to generalize
the approach I've used a functor (OpVarADT) where I defined the
operation of type 'a -> 'b -> 'c but seems that it is not general enough
to contain int->int->int or 'a -> 'a list -> 'a list

This is the functor instantiation with the errors I get:

   # module M0 = Continuation(StringConcat) ;;
   Error: Signature mismatch:
          Modules do not match:
            sig val op : 'a -> 'a list -> 'a list val init : 'a list end
          is not included in
            OpVarADT.OpVarADT
          Values do not match:
            val op : 'a -> 'a list -> 'a list
          is not included in
            val op : 'a -> 'b -> 'c
   # module M1 = Continuation(Sum) ;;
   Error: Signature mismatch:
          Modules do not match:
            sig val op : int -> int -> int val init : int end
          is not included in
            OpVarADT.OpVarADT
          Values do not match:
            val op : int -> int -> int
          is not included in
            val op : 'a -> 'b -> 'c

I'm sure I'm doing something wrong but I can't see what, any help is
welcome

TIA

Walter

--

[-- Attachment #2: Type: TEXT/PLAIN, Size: 75 bytes --]

module Sum = struct
  let op = fun x y -> x+y ;;
  let init = 0 ;;
end

[-- Attachment #3: Type: TEXT/PLAIN, Size: 82 bytes --]

module type OpVarADT = 
 sig
   val op: 'a -> 'b -> 'c
   val init : 'c
 end

[-- Attachment #4: Type: TEXT/PLAIN, Size: 182 bytes --]

module Continuation (OP : OpVarADT.OpVarADT) = 
  struct
    let arg x = fun y continuation -> continuation (OP.op x y) ;;
    let stop x = x;;
    let f g = g OP.init;;
  end

[-- Attachment #5: Type: TEXT/PLAIN, Size: 89 bytes --]

module StringConcat = struct
  let op = fun x y -> y @ [x] ;;
  let init = [] ;;
end

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 11:46 [Caml-list] still silly issues on polymorphic types Walter Cazzola
@ 2011-09-27 12:57 ` Christophe Papazian
  2011-09-27 13:49   ` Walter Cazzola
  2011-09-27 13:16 ` Jacques Garrigue
  1 sibling, 1 reply; 12+ messages in thread
From: Christophe Papazian @ 2011-09-27 12:57 UTC (permalink / raw)
  To: Walter Cazzola; +Cc: OCaML Mailing List

Please remember how types can be subtypes of other types :

consider

val f : int -> int
val g : int -> 'a
val h : 'a -> int
val i : 'a -> 'b

then the most general type is the type of g
and most specific type is type of h. In fact we have a diamond  
relation between types :

h<f<g
h<i<g
and i and f are not related.

Why ?

because if you need a function of type like f (int -> int)
you can give h (if h can eat anything, it can eat int), but not g
(i don't now how to handle 'a if I only need a int).

So int is a subtype of 'a,
but int -> int is not a subtype of 'a -> 'b,
and 'a -> 'a is a valid subtype of int-> int.



Le 27 sept. 11 à 13:46, Walter Cazzola a écrit :

> Dear all,
> I'm still playing around with functors, modules and polymorphism but
> I've some problems with this last concept.
>
> In the attached files I have tried to implement a sort of function  
> with
> a variable number of arguments (based on continuation) and to  
> generalize
> the approach I've used a functor (OpVarADT) where I defined the
> operation of type 'a -> 'b -> 'c but seems that it is not general  
> enough
> to contain int->int->int or 'a -> 'a list -> 'a list
>
> This is the functor instantiation with the errors I get:
>
>  # module M0 = Continuation(StringConcat) ;;
>  Error: Signature mismatch:
>         Modules do not match:
>           sig val op : 'a -> 'a list -> 'a list val init : 'a list end
>         is not included in
>           OpVarADT.OpVarADT
>         Values do not match:
>           val op : 'a -> 'a list -> 'a list
>         is not included in
>           val op : 'a -> 'b -> 'c
>  # module M1 = Continuation(Sum) ;;
>  Error: Signature mismatch:
>         Modules do not match:
>           sig val op : int -> int -> int val init : int end
>         is not included in
>           OpVarADT.OpVarADT
>         Values do not match:
>           val op : int -> int -> int
>         is not included in
>           val op : 'a -> 'b -> 'c
>
> I'm sure I'm doing something wrong but I can't see what, any help is
> welcome
>
> TIA
>
> Walter
>
> --
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
> <sum.ml><OpVarADT.mli><continuation.ml><concat.ml>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 11:46 [Caml-list] still silly issues on polymorphic types Walter Cazzola
  2011-09-27 12:57 ` Christophe Papazian
@ 2011-09-27 13:16 ` Jacques Garrigue
  2011-09-27 13:58   ` Walter Cazzola
  1 sibling, 1 reply; 12+ messages in thread
From: Jacques Garrigue @ 2011-09-27 13:16 UTC (permalink / raw)
  To: Walter Cazzola; +Cc: OCaML Mailing List

On 2011/09/27, at 20:46, Walter Cazzola wrote:

> Dear all,
> I'm still playing around with functors, modules and polymorphism but
> I've some problems with this last concept.
> 
> In the attached files I have tried to implement a sort of function with
> a variable number of arguments (based on continuation) and to generalize
> the approach I've used a functor (OpVarADT) where I defined the
> operation of type 'a -> 'b -> 'c but seems that it is not general enough
> to contain int->int->int or 'a -> 'a list -> 'a list
> 
> This is the functor instantiation with the errors I get:
> 
>  # module M0 = Continuation(StringConcat) ;;
>  Error: Signature mismatch:
>         Modules do not match:
>           sig val op : 'a -> 'a list -> 'a list val init : 'a list end
>         is not included in
>           OpVarADT.OpVarADT
>         Values do not match:
>           val op : 'a -> 'a list -> 'a list
>         is not included in
>           val op : 'a -> 'b -> 'c

It seems that your continuation functor has not the right specification.
Namely, there is no way you can provide a meaningful function of
type 'a -> 'b -> 'c (i.e. a -> b -> c for all possible a, b, and c)
other than raising an exception or going into an infinite loop.
I think that you meant something else, like

type a and b and c
val op : a -> b -> c

which would let you give a specific function for op.

Jacques Garrigue


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 12:57 ` Christophe Papazian
@ 2011-09-27 13:49   ` Walter Cazzola
  2011-09-27 15:26     ` Christophe Papazian
  0 siblings, 1 reply; 12+ messages in thread
From: Walter Cazzola @ 2011-09-27 13:49 UTC (permalink / raw)
  To: Christophe Papazian; +Cc: OCaML Mailing List

On Tue, 27 Sep 2011, Christophe Papazian wrote:

> Please remember how types can be subtypes of other types :
>
> consider
>
> val f : int -> int
> val g : int -> 'a
> val h : 'a -> int
> val i : 'a -> 'b
>
> then the most general type is the type of g
> and most specific type is type of h. In fact we have a diamond relation 
> between types :
>
> h<f<g
> h<i<g
> and i and f are not related.
>
> Why ?
>
> because if you need a function of type like f (int -> int)
> you can give h (if h can eat anything, it can eat int), but not g
> (i don't now how to handle 'a if I only need a int).
>
> So int is a subtype of 'a,
> but int -> int is not a subtype of 'a -> 'b,
> and 'a -> 'a is a valid subtype of int-> int.

uhm, I have a couple of questions I don't understand on your
explanation:
  - why the most general type is int->'a and not 'a -> 'b?
  - does this mean that I can't have a general type that could be matched
    by 'a -> 'a list -> 'a list  and int -> int -> int ?

Walter

-- 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 13:16 ` Jacques Garrigue
@ 2011-09-27 13:58   ` Walter Cazzola
  2011-09-27 19:45     ` Pierre Chopin
  0 siblings, 1 reply; 12+ messages in thread
From: Walter Cazzola @ 2011-09-27 13:58 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: OCaML Mailing List

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2114 bytes --]

On Tue, 27 Sep 2011, Jacques Garrigue wrote:

> On 2011/09/27, at 20:46, Walter Cazzola wrote:
>
>> Dear all,
>> I'm still playing around with functors, modules and polymorphism but
>> I've some problems with this last concept.
>>
>> In the attached files I have tried to implement a sort of function with
>> a variable number of arguments (based on continuation) and to generalize
>> the approach I've used a functor (OpVarADT) where I defined the
>> operation of type 'a -> 'b -> 'c but seems that it is not general enough
>> to contain int->int->int or 'a -> 'a list -> 'a list
>>
>> This is the functor instantiation with the errors I get:
>>
>>  # module M0 = Continuation(StringConcat) ;;
>>  Error: Signature mismatch:
>>         Modules do not match:
>>           sig val op : 'a -> 'a list -> 'a list val init : 'a list end
>>         is not included in
>>           OpVarADT.OpVarADT
>>         Values do not match:
>>           val op : 'a -> 'a list -> 'a list
>>         is not included in
>>           val op : 'a -> 'b -> 'c

> It seems that your continuation functor has not the right specification.
> Namely, there is no way you can provide a meaningful function of
> type 'a -> 'b -> 'c (i.e. a -> b -> c for all possible a, b, and c)
> other than raising an exception or going into an infinite loop.
> I think that you meant something else, like

> type a and b and c
> val op : a -> b -> c

> which would let you give a specific function for op.

uhm, I've tried to follow your advice but the problem persists (attached
the new version) when I try to apply the functor I get the following
error:

# module M1 = Continuation(Sum) ;;
Error: Signature mismatch:
        Modules do not match:
          sig
            type a = int
            and b = int
            and c = int
            val op : int -> int -> int
            val init : int
          end
        is not included in
          OpVarADT.OpVarADT
        Values do not match:
          val op : int -> int -> int
        is not included in
          val op : 'a -> 'b -> 'c

But probably I misinterpreted your advice.

Walter

-- 

[-- Attachment #2: Type: TEXT/PLAIN, Size: 182 bytes --]

module Continuation (OP : OpVarADT.OpVarADT) = 
  struct
    let arg x = fun y continuation -> continuation (OP.op x y) ;;
    let stop x = x;;
    let f g = g OP.init;;
  end

[-- Attachment #3: Type: TEXT/PLAIN, Size: 102 bytes --]

module type OpVarADT = 
 sig
   type a and b and c
   val op: a -> b -> c
   val init : 'c
 end

[-- Attachment #4: Type: TEXT/PLAIN, Size: 109 bytes --]

module Sum = struct
  type a=int and b=int and c=int
  let op = fun x y -> x+y ;;
  let init = 0 ;;
end

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 13:49   ` Walter Cazzola
@ 2011-09-27 15:26     ` Christophe Papazian
  2011-09-27 18:43       ` Walter Cazzola
  0 siblings, 1 reply; 12+ messages in thread
From: Christophe Papazian @ 2011-09-27 15:26 UTC (permalink / raw)
  To: Walter Cazzola; +Cc: OCaML Mailing List

[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]


>
> uhm, I have a couple of questions I don't understand on your
> explanation:
> - why the most general type is int->'a and not 'a -> 'b?

Because if I need a function of type int -> 'a I can give a function  
of type 'a -> 'b.
But if I need a function of type 'a -> 'b I can not use a function of  
type int -> 'a.
So int -> 'a is more general and 'a -> 'b is more specific.

General rule : if a < b then (a->c) > (b->c)

> - does this mean that I can't have a general type that could be  
> matched
>   by 'a -> 'a list -> 'a list  and int -> int -> int ?
>

if you want to get a supertype of a -> b and c -> d you need to
find a subtype of a and c AND find a supertype of b and d.

So for example for ('a -> ( 'a list -> 'a list)) and (int -> (int ->  
int))
you need
  - a subtype of 'a and int : it's int. you have one.
  - a supertype of ('a list -> 'a list) and (int -> int) (reapply the  
same procedure)
       -a subtype of 'a list and int : there is no such thing in  
ocaml, so there is no supertype.

So to answer your question, you can't. But as Jacques Garrigue said,  
you don't need either,
and you can use abstract type and "with type" construction.




> Walter
>
> -- 


[-- Attachment #2: Type: text/html, Size: 1893 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 15:26     ` Christophe Papazian
@ 2011-09-27 18:43       ` Walter Cazzola
  2011-09-27 19:25         ` Thibault Suzanne
  0 siblings, 1 reply; 12+ messages in thread
From: Walter Cazzola @ 2011-09-27 18:43 UTC (permalink / raw)
  To: Christophe Papazian; +Cc: OCaML Mailing List

On Tue, 27 Sep 2011, Christophe Papazian wrote:

>> uhm, I have a couple of questions I don't understand on your
>> explanation:
>> - why the most general type is int->'a and not 'a -> 'b?

> Because if I need a function of type int -> 'a I can give a function of type 
> 'a -> 'b.
> But if I need a function of type 'a -> 'b I can not use a function of type 
> int -> 'a.
> So int -> 'a is more general and 'a -> 'b is more specific.

> General rule : if a < b then (a->c) > (b->c)

probably this is a question whose answer will be RTFM but I'll try to
get your mercy (;-)): what define that a is lesser than b? is there a
table of the precendece among types?

>> - does this mean that I can't have a general type that could be matched
>>  by 'a -> 'a list -> 'a list  and int -> int -> int ?

> if you want to get a supertype of a -> b and c -> d you need to
> find a subtype of a and c AND find a supertype of b and d.

> So for example for ('a -> ( 'a list -> 'a list)) and (int -> (int -> int))
> you need
> - a subtype of 'a and int : it's int. you have one.
> - a supertype of ('a list -> 'a list) and (int -> int) (reapply the same 
> procedure)
>     -a subtype of 'a list and int : there is no such thing in ocaml, so 
> there is no supertype.

ok I see

> So to answer your question, you can't. But as Jacques Garrigue said, you 
> don't need either, and you can use abstract type and "with type"
> construction.

uhm, as I replied to Jacques I tried but the error persists probably I
don't know enough OCaML to do that.

thanks a lot
Walter

-- 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 18:43       ` Walter Cazzola
@ 2011-09-27 19:25         ` Thibault Suzanne
  0 siblings, 0 replies; 12+ messages in thread
From: Thibault Suzanne @ 2011-09-27 19:25 UTC (permalink / raw)
  To: Walter Cazzola; +Cc: Christophe Papazian, OCaML Mailing List

Le 27/09/2011 20:43, Walter Cazzola a écrit :
> On Tue, 27 Sep 2011, Christophe Papazian wrote:
>
>>> uhm, I have a couple of questions I don't understand on your
>>> explanation:
>>> - why the most general type is int->'a and not 'a -> 'b?
>
>> Because if I need a function of type int -> 'a I can give a function 
>> of type 'a -> 'b.
>> But if I need a function of type 'a -> 'b I can not use a function of 
>> type int -> 'a.
>> So int -> 'a is more general and 'a -> 'b is more specific.
>
>> General rule : if a < b then (a->c) > (b->c)
>
> probably this is a question whose answer will be RTFM but I'll try to
> get your mercy (;-)): what define that a is lesser than b? is there a
> table of the precendece among types?
>
Disclaimer : I'm not at all an expert and i discovered these things with 
these mails. But if I've understood, "a is lesser than b" means that 
when a function expects an argument of type 'b, a value of type 'a can 
be given to this function. For an example, List.length can take a value 
of type int list, because int list < 'a list. If I remember, in fact, 'a 
< 'b if a value of type 'a is also a value of type 'b.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 13:58   ` Walter Cazzola
@ 2011-09-27 19:45     ` Pierre Chopin
  2011-09-27 20:22       ` Walter Cazzola
  0 siblings, 1 reply; 12+ messages in thread
From: Pierre Chopin @ 2011-09-27 19:45 UTC (permalink / raw)
  To: Walter Cazzola; +Cc: OCaML Mailing List

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]


Le 27 sept. 2011 à 09:58, Walter Cazzola a écrit :

> On Tue, 27 Sep 2011, Jacques Garrigue wrote:
> 
> uhm, I've tried to follow your advice but the problem persists (attached
> the new version) when I try to apply the functor I get the following
> error:
> 
> # module M1 = Continuation(Sum) ;;
> Error: Signature mismatch:
>       Modules do not match:
>         sig
>           type a = int
>           and b = int
>           and c = int
>           val op : int -> int -> int
>           val init : int
>         end
>       is not included in
>         OpVarADT.OpVarADT
>       Values do not match:
>         val op : int -> int -> int
>       is not included in
>         val op : 'a -> 'b -> 'c
> 


Compiled successfully the code that was attached, looks somehow you have an old version of OPVarADT being used. 
Try to delete cmo/cmi files and recompile.

-Pierre




[-- Attachment #2: Type: text/html, Size: 1900 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 19:45     ` Pierre Chopin
@ 2011-09-27 20:22       ` Walter Cazzola
  2011-09-27 23:58         ` Jacques Garrigue
       [not found]         ` <266E7048-C3BB-4B9E-9760-9D52993A1C86@math.nagoya-u.ac.jp>
  0 siblings, 2 replies; 12+ messages in thread
From: Walter Cazzola @ 2011-09-27 20:22 UTC (permalink / raw)
  To: Pierre Chopin; +Cc: OCaML Mailing List

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1163 bytes --]

On Tue, 27 Sep 2011, Pierre Chopin wrote:

> Le 27 sept. 2011 à 09:58, Walter Cazzola a écrit :

>> On Tue, 27 Sep 2011, Jacques Garrigue wrote:

>> uhm, I've tried to follow your advice but the problem persists (attached
>> the new version) when I try to apply the functor I get the following
>> error:

>> # module M1 = Continuation(Sum) ;;
>> Error: Signature mismatch:
>>       Modules do not match:
>>         sig
>>           type a = int
>>           and b = int
>>           and c = int
>>           val op : int -> int -> int
>>           val init : int
>>         end
>>       is not included in
>>         OpVarADT.OpVarADT
>>       Values do not match:
>>         val op : int -> int -> int
>>       is not included in
>>         val op : 'a -> 'b -> 'c

> Compiled successfully the code that was attached, looks somehow you
> have an old version of OPVarADT being used.
> Try to delete cmo/cmi files and recompile.

You are right, I forgot to cancel the previous .cmi files.

I still have one problem: how can I assign to a the type 'a list? by
using «type a= 'a list» I get

   Error: Unbound type parameter 'a

thanks a lot for the help

Walter
-- 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
  2011-09-27 20:22       ` Walter Cazzola
@ 2011-09-27 23:58         ` Jacques Garrigue
       [not found]         ` <266E7048-C3BB-4B9E-9760-9D52993A1C86@math.nagoya-u.ac.jp>
  1 sibling, 0 replies; 12+ messages in thread
From: Jacques Garrigue @ 2011-09-27 23:58 UTC (permalink / raw)
  To: Walter Cazzola; +Cc: OCaML Mailing List

On 2011/09/28, at 5:22, Walter Cazzola wrote:

> I still have one problem: how can I assign to a the type 'a list? by
> using «type a= 'a list» I get
> 
> Error: Unbound type parameter 'a

Same thing: you need to make explicit the contents of the list.
So this can be type a = int list.
On the other hand if you are trying to refine the signature, you
can also write
 type t
 type a = t list
keeping t abstract.

But maybe I should first make clearer what instantiation and inclusion
mean, because this is often confusing.

For type schemes (types containing type variables), the more general
type can be used in more contexts, so it is actually a subtype, and you have

  'a -> 'b  <=  int -> 'b  < = int -> bool

I.e., by instantiating a variable you can go to a less general type,
which you can view as a super-type.

For abstract types in signatures, this works the other way round:

 sig type a = int end  <=  sig type a end

This is because an abstract type denotes existential abstraction, rather
than the universal quantification of type variables in type schemes.
So for signatures, instantiating a type declaration creates a subtype.

They still have in common that instantiation substitutes all occurrences
of a name simultaneously.

Hope this helps.

	Jacques

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Caml-list] still silly issues on polymorphic types
       [not found]         ` <266E7048-C3BB-4B9E-9760-9D52993A1C86@math.nagoya-u.ac.jp>
@ 2011-09-29 10:27           ` Walter Cazzola
  0 siblings, 0 replies; 12+ messages in thread
From: Walter Cazzola @ 2011-09-29 10:27 UTC (permalink / raw)
  To: Jacques Garrigue

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1444 bytes --]

Hi all,

On Wed, 28 Sep 2011, Jacques Garrigue wrote:

> On 2011/09/28, at 5:22, Walter Cazzola wrote:
>
>> I still have one problem: how can I assign to a the type 'a list? by
>> using «type a= 'a list» I get
>>
>>  Error: Unbound type parameter 'a
>
> Same thing: you need to make explicit the contents of the list.
> So this can be type a = int list.
> On the other hand if you are trying to refine the signature, you
> can also write
>  type t
>  type a = t list
> keeping t abstract.

thanks for the explanation but I'm still unable to match the 2 types (I
have attached the code again). I get this message:
     # module M0 = Continuation(StringConcat);;
     Error: Signature mismatch:
            Modules do not match:
              sig
                type t = StringConcat.t
                type a = t list
                and b = t
                and c = t list
                val op : 'a -> 'a list -> 'a list
                val init : 'a list
              end
            is not included in
              OpVarADT.OpVarADT
            Values do not match:
              val op : 'a -> 'a list -> 'a list
            is not included in
              val op : a -> b -> c

I have also tried to set the abstract type t to string butwithout any
luck.

     # module M0 = Continuation(StringConcat with StringConcat.t = string) ;;
     Error: Syntax error

I feel myself quite dumb but I can't figure out how to fix it.

Walter

-- 

[-- Attachment #2: Type: TEXT/PLAIN, Size: 182 bytes --]

module Continuation (OP : OpVarADT.OpVarADT) = 
  struct
    let arg x = fun y continuation -> continuation (OP.op x y) ;;
    let stop x = x;;
    let f g = g OP.init;;
  end

[-- Attachment #3: Type: TEXT/PLAIN, Size: 101 bytes --]

module type OpVarADT = 
 sig
   type a and b and c
   val op: a -> b -> c
   val init : c
 end

[-- Attachment #4: Type: TEXT/PLAIN, Size: 137 bytes --]

module StringConcat = struct
  type t
  type a=t list and b=t and c=t list
  let op = fun x y -> y @ [x] ;;
  let init = [] ;;
end

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-09-29 10:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-27 11:46 [Caml-list] still silly issues on polymorphic types Walter Cazzola
2011-09-27 12:57 ` Christophe Papazian
2011-09-27 13:49   ` Walter Cazzola
2011-09-27 15:26     ` Christophe Papazian
2011-09-27 18:43       ` Walter Cazzola
2011-09-27 19:25         ` Thibault Suzanne
2011-09-27 13:16 ` Jacques Garrigue
2011-09-27 13:58   ` Walter Cazzola
2011-09-27 19:45     ` Pierre Chopin
2011-09-27 20:22       ` Walter Cazzola
2011-09-27 23:58         ` Jacques Garrigue
     [not found]         ` <266E7048-C3BB-4B9E-9760-9D52993A1C86@math.nagoya-u.ac.jp>
2011-09-29 10:27           ` Walter Cazzola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).