tags:

views:

53

answers:

2

For instance, suppose I want to make a type like this (using Dyn_array):

type some_type = SomeConstructor of <Dyn_array of integers>

I'm a little bit lost on how to do this though. Could someone give me an example so I can wrap my head around this?

+2  A: 

What is the problem ? the syntax ?

Have you tried using an intermediate type ?

type my_dyn = Dyn_Array of int

type some_type = SomeConstructor of my_dyn
LB
please note that i have batteries installed, but this is what i would do for a regular Stack, and it looks the same (based on the documentation though)
LB
It was the syntax. I actually found an answer for this, but forgot to post the answer here!
Jason Baker
+3  A: 

(I don't have batteries installed). DynArray.t is defined already. You just want to specify the type for its free variable and not define a new constructor (what, X of y would do, well, aside from that embedded syntax being illegal),

type some_type = SomeConstructor of integers DynArray.t

If you wanted to leave the type of DynArray free then,

type 'a some_type = SomeConstructor of 'a DynArray.t
nlucaroni
+1: that's what i was looking for.
LB