On this page:
:

3 Lists🔗

Raqit includes racket/base, so many standard list-processing utilties are available.

(map (~> sqr add1) [1 2 3 4 5])
(map (switch [positive? add1] [else sub1]) [1 -2 3 -4 5])

However, for any nontrivial list processing, it’s advisable to use Qi flows, as they use the operations from qi/list which are more efficient (and more clear).

(~> ([1 2 3 4 5]) (filter odd?) (map sqr) (foldl + 0))

procedure

(: v ... vs)  list?

  v : any/c
  vs : list?
When used as an expression, construct a list; when used as a pattern, match a list. Alias for Racket’s list* both as an expression and as a pattern.

(: 1 [2 3])
(: 1 2 3 [4 5 6])
(def [: x xs] [1 2 3])