aboutsummaryrefslogtreecommitdiff
path: root/source/program.lux
blob: 2bbf3fd4f1fbf23f88286d64ade79bafc684a6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(;alias-lux)

(def (filter p xs)
  (All [a] (-> (-> a Bool) (List a) (List a)))
  (case xs
    #;Nil
    (list)

    (#;Cons [x xs'])
    (if (p x)
      (list& x (filter p xs'))
      (filter p xs'))))

(jvm-program _
  (exec (println "Hello, world!")
    (|> (int:+ 2 2) ->text ($ text:++ "2 + 2 = ") println)
    (println (->text (using Int:Ord
                       (< 5 10))))))