{"size": 2814, "ext": "rktl", "max_stars_repo_path": "pkgs/racket-benchmarks/tests/racket/benchmarks/common/typed/nestedloop.rktl", "max_stars_repo_name": "lkh01/racket", "max_stars_repo_stars_event_min_datetime": "2018-07-05T21:18:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-04T14:48:37.000Z", "max_issues_repo_path": "pkgs/racket-benchmarks/tests/racket/benchmarks/common/typed/nestedloop.rktl", "max_issues_repo_name": "lkh01/racket", "max_issues_repo_issues_event_min_datetime": "2017-05-10T07:33:20.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-19T15:49:46.000Z", "max_forks_repo_path": "pkgs/racket-benchmarks/tests/racket/benchmarks/common/typed/nestedloop.rktl", "max_forks_repo_name": "lkh01/racket", "max_forks_repo_forks_event_min_datetime": "2016-04-25T11:47:57.000Z", "max_forks_repo_forks_event_max_datetime": "2017-05-09T14:52:48.000Z"}
{"max_stars_count": 4, "max_issues_count": 9, "max_forks_count": 3, "avg_line_length": 40.7826086957, "max_line_length": 85, "alphanum_fraction": 0.2540867093}
;; Imperative body:
(: loops (Integer -> Integer))
(define (loops n)
  (let: ((result : Integer 0))
        (let loop1 ((i1 1))
          (if (> i1 n)
              'done
              (begin
                (let loop2 ((i2 1))
                  (if (> i2 n)
                      'done
                      (begin
                        (let loop3 ((i3 1))
                          (if (> i3 n)
                              'done
                              (begin
                                (let loop4 ((i4 1))
                                  (if (> i4 n)
                                      'done
                                      (begin
                                        (let loop5 ((i5 1))
                                          (if (> i5 n)
                                              'done
                                              (begin
                                                (let loop6 ((i6 1))
                                                  (if (> i6 n)
                                                      'done
                                                      (begin
                                                        (set! result (+ result 1))
                                                        (loop6 (+ i6 1)))))
                                                (loop5 (+ i5 1)))))
                                        (loop4 (+ i4 1)))))
                                (loop3 (+ i3 1)))))
                        (loop2 (+ i2 1)))))
                (loop1 (+ i1 1)))))
        result))

;; Functional body:
(: func-loops (Integer -> Integer))
(define (func-loops n)
  (let loop1 ((i1 1)(result 0))
    (if (> i1 n)
        result
        (let loop2 ((i2 1)(result result))
          (if (> i2 n)
              (loop1 (+ i1 1) result)
              (let loop3 ((i3 1)(result result))
                (if (> i3 n)
                    (loop2 (+ i2 1) result)
                    (let loop4 ((i4 1)(result result))
                      (if (> i4 n)
                          (loop3 (+ i3 1) result)
                          (let loop5 ((i5 1)(result result))
                            (if (> i5 n)
                                (loop4 (+ i4 1) result)
                                (let loop6 ((i6 1)(result result))
                                  (if (> i6 n)
                                      (loop5 (+ i5 1) result)
                                      (loop6 (+ i6 1) (+ result 1)))))))))))))))

(let ((cnt (if (with-input-from-file "input.txt" read) 18 1)))
    (time (let: loop : (Listof Integer) ((n : Integer 20) (v : (Listof Integer) '()))
          (if (zero? n)
              v
              (loop (- n 1)
                    (list
                     (loops cnt)
                     (func-loops cnt)))))))
