|
5 년 전 | |
---|---|---|
.. | ||
Accumulate.fs | 5 년 전 | |
Accumulate.fsproj | 5 년 전 | |
AccumulateTests.fs | 5 년 전 | |
README.md | 5 년 전 |
Implement the accumulate
operation, which, given a collection and an
operation to perform on each element of the collection, returns a new
collection containing the result of applying that operation to each element of
the input collection.
Given the collection of numbers:
And the operation:
x => x * x
)Your code should be able to produce the collection of squares:
Check out the test suite to see the expected function signature.
Keep your hands off that collect/map/fmap/whatchamacallit functionality provided by your standard library! Solve this one yourself using other basic tools instead.
For this exercise the following F# feature comes in handy:
To run the tests, run the command dotnet test
from within the exercise directory.
F# source code can be formatted with the Fantomas tool.
After installing it with dotnet tool restore
, run dotnet fantomas .
to format code within the current directory.
For more detailed information about the F# track, including how to get help if you’re having trouble, please visit the exercism.io F# language page.
Conversation with James Edward Gray II https://twitter.com/jeg2