Hello.

In short, because data arg of the ProcessData function does matching for same cases as MyData type has.

If you want to know more you can read following article:
[link:en.wikipedia.org]

You can rewrite your code as:

1
2
3
4
5
6
7
//...
 let rec ProcessData data =   
  match data with            
    | Record(record) -> ""
    | Records(recs) ->
      let newList = List.map (fun i -> ProcessData (Record i)) recs //i will be recognised as instance of the IntermediateRecord type
      ""
By on 10/3/2008 11:09 AM ()

Hello.
If you want to know more you can read following article:
[link:en.wikipedia.org]

Wish I could understand it; it's very old and elegant.

Hello.
You can rewrite your code as:

1
2
3
(fun i -> ProcessData (Record i)) recs

//i will be recognised as instance of the IntermediateRecord type

Thanks; I knew I needed to somehow indicate what the individual items are.

By on 10/3/2008 12:00 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