High precedence, right associative backward pipe
7 people like thisPosted: 13 years ago by Stephen Swensen
A novel, due to performance inadequacy, abstraction of the "tail-recursive loop" pattern. Approaching what a built-in language feature might look like.
3 people like thisPosted: 13 years ago by Stephen Swensen
The static representations, unlike the encoded System.Tuple<_,...,_> forms, of tuples do not have ItemX properties and therefore static structural constraints cannot be used to obtain the nth item of a tuple. Here we give a utility with overloads for obtaining the nth item of a tuple. However, type inference is undermined in the presence of overloads
3 people like thisPosted: 13 years ago by Stephen Swensen
A partition function on sequences, like List.partition and Array.partition, but yields elements in either partition on demand. Suitable as an extension to Seq.
7 people like thisPosted: 13 years ago by Stephen Swensen
Several WinForms controls, like TreeView and ListView, implement methods BeginUpdate and EndUpdate, which suspend repainting of the control while items are being individually added to a control, preventing flicker caused by rapid repainting. But using BeginUpdate and EndUpdate is very imperative, and opens up the possibility for bugs, such as neglecting to call the matching EndUpdate. An obvious improvement would be to create an extension method on types implementing this pattern which takes a unit -> unit lambda which is executed between update pairs. But the pattern is only conventional, rather than through a common base class or interface. Hence this presents a reasonable opportunity to use F#'s statically resolved structural type system to implement a function which only works on Control types with the correct structural signature.
3 people like thisPosted: 13 years ago by Stephen Swensen