Two functions showing how to filter functional lists using the specified predicate. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter.
76 people like thisPosted: 14 years ago by Tomas Petricek
The Let active pattern demonstrated by this snippet can be used to assign values to symbols in pattern matching. This is useful for writing complex pattern matching using match as we can handle multiple cases using a single clause.
64 people like thisPosted: 13 years ago by Tomas Petricek
A simple domain specific langauge (DSL) that can be used to specify and recognize patterrns in 2D arrays. A pattern is defined by composing primitive checks, rotating and translating patterns. See also: http://t.co/6Poty4FL
3 people like thisPosted: 12 years ago by Tomas Petricek
Inspired by http://dave.fayr.am/posts/2012-10-4-finding-fizzbuzz.html Rules are in a list of lambdas that can be easily modified. A pattern-matching recursive function applies them in the correct order.
7 people like thisPosted: 12 years ago by Richard Broida
For tutorial, the same functionality, different styles of pattern matching.
4 people like thisPosted: 10 years ago by Tuomas Hietanen
HttpListener + FParsec + Pattern Matching = Simple REST Endpoints
3 people like thisPosted: 9 years ago by Ted Cackowski Jr
Exemplary convenience wrappers for some of the System.
Posted: 5 years ago by Novox
Active pattern returning list of captured groups with parsing.
0 people like thisPosted: 3 years ago by Evgeniy Andreev
Three functions showing how to implement projection for functional lists. First version uses naive recursion and the second one is tail-recursive using the accumulator parameter. The third version extends this with continuation passing.
73 people like thisPosted: 14 years ago by Tomas Petricek
Found an very good article on RS-Trees in Haskell (see: http://www.eecs.usma.edu/webs/people/okasaki/jfp99.ps) It heavyly uses pattern recognition to translate those pesky balance-rules into short code. Bellowe is the simple rewrite of the haskell-implementation in F# - enjoy
6 people like thisPosted: 13 years ago by Carsten König
A simple utility that allows making assertions using potentially complex pattern matches.
3 people like thisPosted: 12 years ago by Eirik Tsarpalis
Strangely enough, really useful documentation of F#'s "function" keyword used for pattern matching is difficult to find within Microsoft's official documentation. A Google search turns up some helpful illustrations and discussions of the keyword. Here's a simple example that some might find useful.
3 people like thisPosted: 11 years ago by musicologyman
Sample code snippet to group the data into buckets
3 people like thisPosted: 9 years ago by Tamizhvendan
Usage:
[
Posted: 6 years ago by Yuri Martynov
Playing with coordinates and moves See https://github.com/giuliohome/AdventOfCode2019/blob/master/Day15-Part1-QueueVersion.fs#L54-L66
1 people like thisPosted: 4 years ago by giuliohome