Yes, it is treated specially. It is a discriminated union 'constructor' for the list<'a> type, and so begged the question of whether as a function value its arguments should be curried (like +) or tupled (like all DU constructors). Either way seems fishy/unexpected to some people, so we simply disallow the construct.

Of course you can always write e.g.

let cons x y = x :: y

and use 'cons' if you want a 'curried prefix function of two args' for this.

By on 9/2/2009 9:26 AM ()
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