Any of these will work:

1
2
3
4
let concatList2 (x:_ list) (y:_ list) = x @ y
let concatList2 (x:list<_>) (y:list<_>) = x @ y
let concatList2 (x:'a list) (y:'a list) = x @ y
let concatList2 (x:list<'a>) (y:list<'a>) = x @ y

Since list is a generic type, it needs to take a type argument. You can either use the prefix ('a list) or postfix (list<'a>) forms. "_" asks the compiler to infer it for you. Any identifier starting with an apostrophe is a generic type parameter (like <T> in C#).

By on 9/30/2008 4:21 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