Question: I try to generate a trigger, in the trigger statement I have to set a column of type decimal(17,3) with the actual timestamp or the seconds of unix timestamp, but could not find a solution.

Answer: 
One definition of foldr is:

```
foldr            :: (a -> b -> b) -> b -> [a] -> b
foldr f acc []     = acc
foldr f acc (x:xs) = f x (foldr f acc xs)

```

The [wikibook on Haskell](http://en.wikibooks.org/wiki/Haskell/List_processing) has a nice graph on foldr (and on other folds, too):

```
  :                         f
 / \                       / \
a   :       foldr f acc   a   f
   / \    ------------->     / \
  b   :                     b   f
     / \                       / \
    c  []                     c   acc

```

I.e. `a : b : c : []` (which is just `[a, b, c]`) becomes `f a (f b (f c acc))` (again, taken from wikibook).

So your example is evaluated as `let f = (\x y -> 2*x + y) in f 5 (f 6 (f 7 4))` (let-binding only for brevity).
[This was supposed to be a comment on delnan's remark, but was too wordy...]

Yoon, you can open a private 'conversation' with `lambdabot` on the #haskell irc (e.g. at <http://webchat.freenode.net/> ). She has a simple reflection ability, so you can type meaningless letters, e.g.

```
    Yoon: > foldr (\x y -> 2*x + y) o [a,b,c,d]
lamdabot: 2 * a + (2 * b + (2 * c + (2 * d + o)))

```

This says what is evaluated, but as Edka points out you get a picture of the order of evaluation from say

```
     Yoon: > reverse (scanr (\x y -> 2*x + y) o [a,b,c,d])
lambdabot: [o,2 * d + o,2 * c + (2 * d + o),2 * b + (2 * c + (2 * d + o)),2 * a + (2 * b + (2 * c + (2 * d + o)))

```

I remember imprinting some good lessons playing around with `foldr`, `foldl`, `scanr`, `scanl` and this clever device.