(define (daggemiddelden temperaturen)
  (let ((dagtemperaturen (split (prune temperaturen 12) 12)))
    (map-stream (lambda (y) (/ y 12))
                (map-stream (lambda (x)
                  (accumulate + 0 x)) dagtemperaturen))))


(define (nachtgemiddelden temperaturen)
  (define (skip-eerste-n  str n)
    (if (zero? n)
        str
        (skip-eerste-n (tail str) (- n 1))))
  
  (let ((nachttemperaturen
         (split (prune (skip-eerste-n temperaturen 12) 12) 12)))
        (map-stream (lambda (y) (/ (exact->inexact y) 12))
                (map-stream (lambda (x)
                  (accumulate + 0 x)) nachttemperaturen))))