O'Reilly logo

Learning F# Functional Data Structures and Algorithms by Adnan Masood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Query expressions

To retrieve a selective number of elements through a sequence, or page through the sequence, a query expression is used. Query expressions allow us to query a data source and put the results in the desired form. Query expressions provide support for LINQ in F#. A typical use case of pagination is a retail location grid where we see 10-20 stores at a time, based on search criteria. This search of elements can later be expanded based on users' selection of the page number.

As a computation expression, query expressions are similar to sequences. Just like sequences, where to populate a sequence you provide code in a sequence expression, for query expression you specify a predicate, a selection query, or similar code.

To understand ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required