Maik Klein
Maik Klein

Reputation: 16148

How to create a list with an explicit type?

type VAO(buffers) = 
    let handle = 
        let h = GL.GenVertexArray()
        GL.BindVertexArray(h)
        buffers 
        |> List.iter (fun (vbo : VBO) -> 
                       GL.EnableVertexAttribArray(vbo.Pos)
                       vbo.Bind())
        GL.BindVertexArray(0)
        h

In this case buffers is of type val buffers: VBO List How do I get this type explicitly? If I try this type VAO(buffers: VBO List) I get val buffers: List<VBO> which is different and I can't use List.iter on this type.

Upvotes: 0

Views: 102

Answers (1)

ildjarn
ildjarn

Reputation: 62975

You're close – list, lowercase l.

Upvotes: 2

Related Questions