-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert.rkt
32 lines (29 loc) · 955 Bytes
/
convert.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#lang racket/base
(require racket/contract
racket/match
racket/string)
(define/contract (convert pkgsupdate)
(-> (listof (hash/c symbol? (or/c string? (listof string?))))
(listof (listof string?)))
(map
(λ (pkg)
(match pkg
[(hash 'name name
'path path
'before before
'after after
'warnings warnings)
(list name
(if (string? path) (car (string-split path "/")) "N/A")
before
after
(if (list? warnings)
(if (null? warnings)
"N/A"
(if (> (length warnings) 1) (cadr warnings) "N/A"))
"N/A"))]))
pkgsupdate))
(provide (contract-out [convert
(-> (listof (hash/c symbol? (or/c string? (listof string?))))
(listof (listof string?)))
]))