Question: I would like to represent some scalar value (e.g. integers or strings)
by either it's real value or by some `NA` value and later store them
in a collection (e.g. a list). The purpose is to handle missing values.

To do this, I have implemented a signature

```
module type Scalar = sig
    type t
    type v = Value of t | NA
end

```

Now I have some polymorphic `Vector` type in mind that contains `Scalar`s. Basically, some of the following

```
module Make_vector(S: Scalar) = struct
    type t = S.v list

    ... rest of the functor ...
end

```

However, I cannot get this to work. I would like to do something like

```
module Int_vector = Make_vector(
    struct
        type t = int
    end
)

module Str_vector = Make_vector(
    struct
        type t = string
    end
)

... and so on for some types.

```

I have not yet worked a lot with OCaml so maybe this is not the right way. Any advises on how to realize such a polymorphic Scalar with a sum type?

The compiler always responds with the following message:

```
The parameter cannot be eliminated in the result type. 
Please bind the argument to a module identifier.

```

Before, I have tried to implement `Scalar` as a sum type but ran into 
complexity issues when realizing some features due to huge `match` clauses. Another (imo not so nice) option would be to use `option`. Is this a better strategy?

Answer: 
I noticed that you mistakenly swapped `setHidden()` values, the `if` part should true while the `else` part should be false. Also, remove the `AndWait` from your animation.

```
Form hi = new Form("Layout Animations", new BoxLayout(BoxLayout.Y_AXIS));

Button button = new Button("Hide");
hi.add(button);

for (int iter = 0; iter < 10; iter++) {
    Label b = new Label("Label " + iter);
    b.setWidth(button.getWidth());
    b.setHeight(button.getHeight());
    b.setY(-button.getHeight());
    hi.add(b);
}

button.addActionListener((e) -> {

    // hide every second label on click
    if (button.getText().equals("Hide")) {
        button.setText("Show");
        for (int iter = 1; iter < hi.getContentPane().getComponentCount(); iter += 2) {
            Component c = hi.getContentPane().getComponentAt(iter);
            c.setHidden(true); //should be true here
        }
        hi.getContentPane().animateUnlayout(500, 255, null); //remove AndWait

    } // show stuff again
    else {
        button.setText("Hide");
        for (int iter = 1; iter < hi.getContentPane().getComponentCount(); iter += 2) {
            Component c = hi.getContentPane().getComponentAt(iter);
            c.setHidden(false); //should be false here
        }
        hi.getContentPane().animateLayout(500); //remove AndWait
    }
});

hi.show();

```
Couple of notes:
- true and false is correct. haven't paid attention to it, as the result was that everything vanished in both cases anyways.
- whether I wait for it to finish or not does not matter in this case, as I call it only case and not repeatedly on several elements.
- one more thing you changed is setting the target opacity of the unlayout animation from 0 to 255. This way, all elements remain visible.

This brings me to two questions:
1. why is unlayout animation applied to all elements in my form, not only to those whose properties were changed (position values)? When using 

```
animateUnlayoutAndWait(500, 0);

```

everything will vanish, even the button. 

2. with the current solution from diamond, when calling unlayout animation, the individual elements that should disappear vanish instantly, the only thing element being animation is label 8, and it is animation INTO place, rather than out of place.