anushri
anushri

Reputation: 67

F# type declaration based on parameter passed

hey i want to generate a parametrized type in F# if parameter is present then generate an array of float containing as many number of values as value of parameter else single float value

i tried the code which is showing error

type val<'mult> =
                 |Some -> Arr[|1..mult|]
                 |None -> value 

Upvotes: 0

Views: 74

Answers (1)

N_A
N_A

Reputation: 19897

Sadly F# doesn't currently have dependent types. Also see this uservoice asking for pretty much the same thing you want.

Upvotes: 2

Related Questions