December 2005 Entries

Forwards is the new backwards with the |> operator

Recently Don Syme made a post to the F# mailing list about some proposed changes to the F# libraries. In it talked about the virtues of using the new |> operator, sighting the following example as something it would be difficult without it:   let methods = System.AppDomain.CurrentDomain.GetAssemblies()             |> List.of_array |> List.map ( fun assm -> assm.GetTypes() ) |> Array.concat             |> List.of_array |> List.map ( fun t -> t.GetMethods() ) |> Array.concat   After squinting at it for a while I realised that I didn’t really understand what the sample was doing, let alone see the advantage...

Rico Mariani’s performance quiz 8 – Part 2 – The Great Parsers Shoot Out

Rico made some more interesting posts in his parser performance quiz, first producing a parser where the predicates are compiled into an in memory representation and also a parser where he produces IL on the fly. He talks about them here and here respectively.   So I ported both of these parsers to F#; as they demonstrate some nice uses of patterns commonly used in ML, such as take one data structure that is easy to read and transforming it into another than is easy to evaluate. This gives us 6 parsers in total, so...

Links

 Subscribe in a reader
Twitter Follow me on Twitter
FaceBook View my Facebook
LinkedIn View my LinkedIn Profile Viadeo Viadeo Profile (Français)

Badges



Disclaimer

The views expressed on this weblog are mine and do not necessarily reflect the views of my employer.

All postings are provided "AS IS" with no warranties, and confer no rights.

www.flickr.com
This is a Flickr badge showing public photos and videos from Robert Pickering. Make your own badge here.