code
12 September 2009 | 1 Comment
2-pivot quicksort This posting on the Java core library mailing list proposes to replace the current quicksort with a new, 2-pivot quicksort. Ordinary quicksort in Haskell looks something like this: quicksort [] = [] quicksort (pivot:rest) = quicksort [x| x ← rest, x ≤ pivot] ++ [pivot] ++ quicksort [x| x ← rest, x > [...]
Tagged in comparison, Functional programming, Haskell, Programming, quicksort, sorting
code
10 August 2009 | 0 Comments
So, I thought it would be a fun idea for my first ever Lisp/Scheme program to implement Alan Turing’s original a-machines from his paper, On Computable Numbers, with an Application to the Entscheidungsproblem (paper available to public). Fun? Oh, I hadn’t any idea… Preamble; choice of implementation I decided to go with the latest and [...]
Tagged in code, debugging, Functional programming, ikarus, machine, Programming, recursion, scheme, silly, theory, turing, universal, ypsilon
code,tips
10 December 2008 | 0 Comments
Just a small tip on this: When you add an argument to a function that already exists you should check the existing usage of the function. Say you have this: f x y z = … … and you want: f x y z w = … First of all you should check the contexts [...]
Tagged in code, Functional programming, Haskell, Programming, refactoring, short, tips
Uncategorized
9 October 2007 | 1 Comment
Looking through the list of predefined (or, in Microsoft’s parlance, standard) query operators defined in C# 3.0, there is one that stands out as missing: the ‘map’ function. However, with the new query expression syntax, this is trivial to define: public static IEnumerable<T> Map<F,T>(Func<F,T> func, IEnumerable<F> source) { return from it in source select func(it); [...]
Tagged in C#, Cool, Development, Functional programming, LINQ, Programming