Difference between revisions of "To Squares Using Higher Order Functions Assignment"
Jump to navigation
Jump to search
(Created page with "<syntaxhighlight lang="sml"> fun to_squares(xs : int list) : int list = raise Fail "NotYetImplemented" </syntaxhighlight>") |
|||
Line 1: | Line 1: | ||
+ | Reimplement [[To_Squares_Assignment|To Squares]] with pattern matching. | ||
+ | |||
+ | =Code to Implement= | ||
+ | {{SMLToImplement|squares_using_hof|to_squares|warmup_squares_using_hof}} | ||
<syntaxhighlight lang="sml"> | <syntaxhighlight lang="sml"> | ||
fun to_squares(xs : int list) : int list = | fun to_squares(xs : int list) : int list = | ||
raise Fail "NotYetImplemented" | raise Fail "NotYetImplemented" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | =Test= | ||
+ | {{SMLUnitTesting|run_squares_using_hof_testing|warmup_squares_using_hof}} |
Latest revision as of 16:24, 17 September 2024
Reimplement To Squares with pattern matching.
Code to Implement
file: | src/main/sml/warmup_squares_using_hof/squares_using_hof.sml | ![]() |
functions: | to_squares |
fun to_squares(xs : int list) : int list =
raise Fail "NotYetImplemented"
Test
source folder: | src/test/sml/warmup_squares_using_hof |
how to run with CM.make verbosity off: | sml -Ccm.verbose=false run_squares_using_hof_testing.sml |
how to run with CM.make verbosity on: | sml run_squares_using_hof_testing.sml |
note: ensure that you have removed all printing to receive credit for any assignment.