Stumbled upon this challenge and tried my hand: http://themechanicalbride.blogspot.com/2009/04/f-solution-to-eric-lippert-challenge.html The original challenge calls for a string result, so there's no issue with converting the sequence to a list from the outset since we need to enumerate it completely anyway; had it insisted on returning a sequence my answer would be different. > commaize ["ABC"; "DEF"; "G"; "H"];; val it : string = "ABC, DEF, G and H"
2 people like thisPosted: 9 years ago by Hugh Gleaves
Shows a recursive means of filtering out simple HTML tags from a string. This is ultimately a simple FSM with state transitions implemented by recursive invocations and a bool flag (in this simple case).
0 people like thisPosted: 8 years ago by Hugh Gleaves
Sums a sequence of decimal digits by repeatedly adding pairs of digits resulting in a single digit result.
3 people like thisPosted: 8 years ago by Hugh Gleaves
Create a circular (repeating) sequence from an input sequence, optionally limiting the total number of elements.
0 people like thisPosted: 9 years ago by Hugh Gleaves
Some scenarios require the ability to read stdin as a sequence of character codes. The console in .Net does not behave the same as a file. The console also has limited buffering capacity (you can't paste a large string into the console for example - try it). Call this function with arg = [-1;13] and the sequence will end if either 'enter' is pressed at the console or EOF is reached with a file.
0 people like thisPosted: 8 years ago by Hugh Gleaves
This function enables the repeated insertion of a specified value into a sequence. It ensures that Seq.skip will never throw an exception by always ensuring it never skips more elements than remain in the sequence.
1 people like thisPosted: 7 years ago by Hugh Gleaves