You need parens:

1
2
let sumsecond (data:(string*int) list) = 
    data |> List.sum_by (fun (_,x) -> x)

Try putting your original code in Visual Studio and hovering over 'data' - it has an unexpected type ('a list) which suggests that the type annotation you added was not doing what you expect. In your original example, you declared the return type of the function, not the type of the parameter.

By on 11/15/2008 10:53 PM ()

Funny, I tried every possible combination of parens EXCEPT that one :(

Thanks!

By on 11/15/2008 11:33 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper