This code sample generates Pascal's triangle as jagged 2D list (list of lists).
19 people like thisPosted: 13 years ago by Dmitry Soshnikov
A small Scheme interpreter using Higher Order Abstract Syntax (HOAS) encoding for terms. The essence of the technique is to use F# (meta-level) functions to encode Scheme (object-level) functions and other binding constructs, thus avoiding the need for representing variables, bindings, explicit substitution and dealing with shadowing.
37 people like thisPosted: 13 years ago by Anton Tayanovskyy
Here's a function which takes a comparator function and two sequences, and returns tuples consisting of an item from each sequence, where the comparator function returns true for those two items. This is a small part of my wider project to generate guitar chord shapes. One of the requirements there is to take a list of 'wanted' notes for a chord, and a list of 'available' notes within a range of frets and to combine them into an actual set of frettings. That's what led to tryFindFirstPair and hence to findPairs.
1 people like thisPosted: 13 years ago by Kit Eason
Implementation of Langton's ant route.. Takes first 1000 steps and returns only black fields.
2 people like thisPosted: 12 years ago by stejcz
A while ago I posted a snippet to calculate the 'Discrete Fréchet Distance' between two curves. If we treat a word as a 'curve' by giving each letter an index (with similar-sounding letters having closer indices) we can compare words by the Fréchet distance between them! An alternative to edit-distance...
3 people like thisPosted: 12 years ago by Kit Eason
Calculate the root-mean-square of a dataset. Eg. given the voltages over time of an alternating current, calculate the RMS voltage.
3 people like thisPosted: 11 years ago by Kit Eason
After watching this clip (http://www.youtube.com/watch?v=ZhuHCtR3xq8) on Youtube featuring Brian Beckman I wanted to try to sketch Brian's main argument that Monads' main purpose is function composition. I will post my sketch to http://rodhern.wordpress.com/2014/02/ . These snippets are the companion examples to the blog post.
1 people like thisPosted: 10 years ago by Robert Nielsen
A script suitable for FSI that copies a (UTF-8) text file throwing away uninteresting lines in the process.
2 people like thisPosted: 10 years ago by Robert Nielsen
This code sample generates Pascal's triangle as jagged 2D list (list of lists). It takes 0.5 sec to generate 3000 rows (vs 16 sec for http://fssnip.net/23). Tip: try to avoid of using "list1 @ list2" construction.
13 people like thisPosted: 13 years ago by Shamil Sayfutdinov
This is to demonstrate that: (1) there are many ways to solve the same problems; (2) operators can be grouped together into data structures and act as data; (3) you can have fun in F# in many ways.
57 people like thisPosted: 13 years ago by Dmitry Soshnikov
Euler #5 solution
4 people like thisPosted: 13 years ago by Michael Falanga
Implementation of Langton's ant route.. Takes first 1000 steps and returns only black fields.
4 people like thisPosted: 12 years ago by stejcz
The Eurovision final scoring system using records and some higher order functions. (Results are fictional - no-one seems to publish the full voting live online.)
2 people like thisPosted: 12 years ago by Kit Eason
After watching this clip (http://www.youtube.com/watch?v=ZhuHCtR3xq8) on Youtube featuring Brian Beckman I wanted to try to sketch Brian's main argument that Monads' main purpose is function composition. I will post my sketch to http://rodhern.wordpress.com/2014/02/ . These snippets are the companion examples to the blog post.
3 people like thisPosted: 10 years ago by Robert Nielsen
After watching this clip (http://www.youtube.com/watch?v=ZhuHCtR3xq8) on Youtube featuring Brian Beckman I wanted to try to sketch Brian's main argument that Monads' main purpose is function composition. I will post my sketch to http://rodhern.wordpress.com/2014/02/ . These snippets are the companion examples to the blog post.
1 people like thisPosted: 10 years ago by Robert Nielsen
After watching this clip (http://www.youtube.com/watch?v=ZhuHCtR3xq8) on Youtube featuring Brian Beckman I wanted to try to sketch Brian's main argument that Monads' main purpose is function composition. I will post my sketch to http://rodhern.wordpress.com/2014/02/ . These snippets are the companion examples to the blog post.
1 people like thisPosted: 10 years ago by Robert Nielsen
Select right russian word for number of days
0 people like thisPosted: 9 years ago by runiner