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).
You can actually easily visualize it for yourself:

```
import Text.Printf

showOp f = f (printf "(%s op %s)") "0" ["1","2","3"]

```

then

```
Main> showOp foldr
"(1 op (2 op (3 op 0)))"
Main> showOp foldl
"(((0 op 1) op 2) op 3)"
Main> showOp scanl
["0","(0 op 1)","((0 op 1) op 2)","(((0 op 1) op 2) op 3)"]

```