add mlish/sweet-map.rkt test

This commit is contained in:
AlexKnauth 2016-05-20 13:20:00 -04:00
parent 94ae1ebabe
commit c45e967896

View File

@ -0,0 +1,20 @@
#lang sweet-exp "../../mlish.rkt"
define
sum [lst : (List Int)] Int
match lst with
[] -> 0
x :: xs ->
{x + sum(xs)}
define
map [f : ( X Y)] [lst : (List X)] (List Y)
match lst with
[] -> nil
x :: xs ->
cons
f x
map f xs
sum
map string->number (list "1" "2" "3")