MostlyAdequate / mostly-adequate-guide

Mostly adequate guide to FP (in javascript)
Other
23.44k stars 1.87k forks source link

Adding missing find function, fixes #564 #595

Open dotnetCarpenter opened 3 years ago

dotnetCarpenter commented 3 years ago

find is referenced in chapter 8 and is needed for the IO example:

// findParam :: String -> IO Maybe [String]
const findParam = key => map(compose(Maybe.of, find(compose(eq(key), head)), params), url);

This implementation of find only works for Array which is also the type of params in the example. params :: String -> [[String]]

dotnetCarpenter commented 3 years ago

@KtorZ should I reinstate the white-spaces in _appendixc.md before this PR can be accepted?

KtorZ commented 3 years ago

@dotnetCarpenter no worries here. These are indeed extraneous. A double-whitespace marks a newline in markdown (probably should use an explicit <br> instead...) but in this case they are simply superfluous.

I've been busy with other stuff lately and didn't give much time to reviews which required more than a quick eye-check. I'll allocate some time soon-ish to go through some open PRs and issues on this project.