RosettaCodeData/Task/Function-composition/Brat/function-composition.brat
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

7 lines
137 B
Text

compose = { f, g | { x | f g x } }
#Test
add1 = { x | x + 1 }
double = { x | x * 2 }
b = compose(->double ->add1)
p b 1 #should print 4