F# List of functions

Posted by akaphenom on Stack Overflow See other posts from Stack Overflow or by akaphenom
Published on 2010-05-03T13:08:51Z Indexed on 2010/05/03 13:18 UTC
Read the original article Hit count: 632

Filed under:
|

I am trying to have a list of functions, but seem to be comming up empty handed. The basic code is something like this:

let doSomething var  =
    var

let doSomething2 var  =
    var

let listOfStuff = [doSomething doSomething2]

and I am getting the followiung exception:

Error 2 Value restriction. The value 'listOfStuff' has been inferred to have generic type val queue : ('_a -> '_a) list Either define 'queue' as a simple data term, make it a function with explicit arguments or, if you do not intend for it to be generic, add a type annotation. C:\fsharp\SentimentFramework\TradeSignalProcessor\Program.fs 16 9 TradeSignalProcessor

I tried addin the [] attribute but that didn't work...

© Stack Overflow or respective owner

Related posts about F#

Related posts about list