Last active
August 30, 2018 14:52
-
-
Save codingedgar/6426fb2014ad9ede5bc2dd26f49c33fc to your computer and use it in GitHub Desktop.
until transducer: composition
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { double_sum2_to_string } from './compose' | |
test('stringify after add 2 after double', () => { | |
expect(double_sum2_to_string([1, 2, 3])).toEqual(['4', '6', '8']) | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { compose, map } from 'ramda' | |
export const double_sum2_to_string = | |
compose( | |
map((number: number) => String(number)), | |
map((number: number) => number + 2), | |
map((number: number) => number * 2) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment