Say that you’re implementing a linked list, and you want an enumerator: public IEnumerator<T> GetEnumerator() { return new Stream<T,Node>(first, node => node.next == null ? null : Tuple.Of(node.next, node.datum).AsNullable()); } This uses the following utility class to implement the enumerator in one line (along with some code for Tuples and an extension method for structs): [...]
Pages
Tags
.net bind9 Books Broken C# C# code comparison Cool criticism Critique csharp Default Development DNS Firefox Functional programming Game GNOME Haskell horrid Java Links Linux massey Mathematics Me Mono music Odd Programming Reference Review self short silly snippet Thought thoughts Types Ubuntu Unicode Unix Work XMLCategories
Archives
