unison/unison-src/transcripts-using-base/serial-test-01.md
2022-09-12 10:07:27 -04:00

412 B

.> builtins.mergeio
l1 = [1.0,2.0,3.0]
l2 = [+1,+2,+3]
l3 = [?a, ?b, ?c]

combines = cases
  (x, y, z) ->
    rx = foldLeft (+) 0.0 x
    ry = foldLeft (+) +0 y
    rz = foldLeft (t c -> t ++ Char.toText c) "" z

    "(" ++ toText rx ++ ", " ++ toText ry ++ ", \"" ++ rz ++ "\")"

mkTestCase = do
  saveTestCase "case-01" combines (l1, l2, l3)
.> add
.> run mkTestCase