Loading ...
Sorry, an error occurred while loading the content.
 

Parametrized types

Expand Messages
  • Marco Pedeira
    Hello all, everyone knows that with CAML one can define a parametrized type (such as type a set= Set of (( a) list);; ) or classes parametrized by many types
    Message 1 of 3 , Feb 4, 2004
      Hello all,

      everyone knows that with CAML one can define
      a parametrized type

      (such as

      type 'a set= Set of (('a) list);; )

      or classes parametrized by many types (e.g.

      class [('a),('b),('c)] my_class= ...)

      My question is : can you define a type parametrized
      with TWO (or more) types ?
      I tried all these :
      type [('a),('b)] special_pair=SP of ('a)*('b);;
      type ('a),('b) special_pair=SP of ('a)*('b);;
      type ('a) ('b) special_pair=SP of ('a)*('b);;

      but they all fail ... what is the correct syntax ?


      Ewan





      ______________________________________________________________________

      Yahoo! GeoCities: 15MB de espaço grátis para criar seu web site!
      http://br.geocities.yahoo.com/
    • Remi Vanicat
      ... type ( a, b) special_pair=SP of a * b;; -- Rémi Vanicat
      Message 2 of 3 , Feb 4, 2004
        Marco Pedeira <roparzhhemon@...> writes:

        > Hello all,
        >
        > everyone knows that with CAML one can define
        > a parametrized type
        >
        > (such as
        >
        > type 'a set= Set of (('a) list);; )
        >
        > or classes parametrized by many types (e.g.
        >
        > class [('a),('b),('c)] my_class= ...)
        >
        > My question is : can you define a type parametrized
        > with TWO (or more) types ?
        > I tried all these :
        > type [('a),('b)] special_pair=SP of ('a)*('b);;
        > type ('a),('b) special_pair=SP of ('a)*('b);;

        type ('a,'b) special_pair=SP of 'a * 'b;;

        --
        Rémi Vanicat
      • Michael
        ... what about: type ( a, b) special_pair=SP of a * b;; Michael
        Message 3 of 3 , Feb 4, 2004
          On Mittwoch 04 Februar 2004 14:24, Marco Pedeira wrote:
          > Hello all,
          > My question is : can you define a type parametrized
          > with TWO (or more) types ?
          > I tried all these :
          > type [('a),('b)] special_pair=SP of ('a)*('b);;
          > type ('a),('b) special_pair=SP of ('a)*('b);;
          > type ('a) ('b) special_pair=SP of ('a)*('b);;
          >
          > but they all fail ... what is the correct syntax ?


          what about:

          type ('a,'b) special_pair=SP of 'a * 'b;;

          Michael
        Your message has been successfully submitted and would be delivered to recipients shortly.