Hi Ivan,

I think you need active patterns. They are a way of making .NET data structures look like F#'s union types. I wrote an article for infoQ a while ago that has an example that's surprisingly similar to what your trying to do:
[link:www.infoq.com]

Cheers,
Rob

By on 6/17/2008 12:35 AM ()

Hi, Rob!

I think I've seen your article. Note, that your list of child nodes is a sequence. It is still not clear how using "Node" and "Leaf" I would express something like "I expect a node with exactly two children: <startDate> and <endDate>".

Maybe I am missing the obvious.
It would be easier if Seq. had a "tail" operator, but it does not

By on 6/17/2008 7:51 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