4 |
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 🐏 The interactive way to learn ramda
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 🐏 The interactive way to learn ramda
2 |
3 | Those recent years Functional Programming paradigms became more present in the JavaScript ecosystem. From the first functional approach I saw from underscore library, many years passed, and we are now at a place where many of us see the benefits in writing code this way and immutability in mind.
4 |
5 | Still, all the functional jargon can be a barrier for beginners. Not only individuals that want to get their heads into functional programming, but also teams that have use-cases of complex data manipulation and don't see the benefit from using an functional programming library.
6 |
7 | When I was digging into ramda, I found the [Ramda documentation](http://ramdajs.com/docs/) has a list of all the methods and some crazy examples in addition to a more helpful a wiki resource: [What-Function-Should-I-Use](https://github.com/ramda/ramda/wiki/What-Function-Should-I-Use) that I still use from time to time.
8 |
9 | So, I decided to help and create a little UI to interactively find the method that works for you. Hope you enjoy it!
10 |
11 | 
12 | > If you still are lost with the functional programming glossary I would recommend taking a look at [hemanth/functional-programming-jargon](https://github.com/hemanth/functional-programming-jargon)
13 |
14 | ## Thanks
15 |
16 | - Many thanks to **[Josep Martins](https://josepmartins.com)** for designing the UI & teach me how.
17 | - Kudos to [Sarah Drasner (**@sdras**)](https://github.com/sdras) for inspiring me with: https://sdras.github.io/array-explorer
18 | - Kudos to [Stefano Vozza (**@svozza**)](https://github.com/svozza) for creating all the documentation https://github.com/ramda/ramda/wiki/What-Function-Should-I-Use
19 |
20 | ## I need some help
21 |
22 | I want to improve the example code snippets. Right now, I got all of them from ramda jsdoc's source code, the same ones in [ramdajs.com/docs](https://ramdajs.com/docs).
23 |
24 | Many times I don't find them useful, so I would love your help on improve it.
25 | Could [suggest](https://github.com/davesnx/learn-ramda/issues/new) some new code examples for some methods and hopefully someday we could improve the official docs!
26 |
27 | ## Want to run it locally?
28 |
29 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). You can learn more in their [documentation](https://facebook.github.io/create-react-app/docs/getting-started).
30 |
31 | ### Install dependencies
32 | Dependencies must be installed before running the project.
33 | They can be installed by running `npm install` or `yarn install`.
34 |
35 | ### Development server
36 | Start the development server by running `npm start`
37 |
38 | This runs the app in the development mode.
39 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
40 |
41 | The page will reload if you make edits.
42 | You will also see any lint errors in the console.
43 |
44 | [![Build status][ci-image] ][ci-url]
45 | [![semantic-release][semantic-image] ][semantic-url]
46 | [![js-standard-style][standard-image]][standard-url]
47 |
48 | [ci-image]: https://travis-ci.org/davesnx/learn-ramda.svg?branch=master
49 | [ci-url]: https://travis-ci.org/davesnx/learn-ramda
50 | [semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
51 | [semantic-url]: https://github.com/semantic-release/semantic-release
52 | [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
53 | [standard-url]: http://standardjs.com/
54 |
--------------------------------------------------------------------------------
/public/favicon/safari-pinned-tab.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
57 |
--------------------------------------------------------------------------------
/src/app.jsx:
--------------------------------------------------------------------------------
1 | import React, { Suspense, Fragment, useState } from 'react'
2 | import styled from '@emotion/styled'
3 | import { css, keyframes } from '@emotion/core'
4 | import Select, { components } from 'react-select'
5 | import * as R from 'ramda'
6 |
7 | import colors from './colors.js'
8 | import { slug, unslug } from './lib/slug'
9 | import RamdaIcon from './icons/ramda.jsx'
10 | import GithubIcon from './icons/github.jsx'
11 | import Solutions from './solutions.jsx'
12 |
13 | const fadeUp = keyframes`
14 | 0% {
15 | opacity: 0;
16 | }
17 |
18 | 100% {
19 | opacity: 1;
20 | }
21 | `
22 |
23 | const Header = styled.div`
24 | padding: 8vh 8vw 12vh;
25 |
26 | @media (max-width: 1200px) {
27 | padding: 4vh 4vw;
28 | width: 100%;
29 | }
30 | `
31 |
32 | const SelectWrapper = styled.div`
33 | min-width: 200px;
34 | margin: 0 20px;
35 | line-height: 1.2;
36 |
37 | @media (max-width: 1200px) {
38 | min-width: 30vw;
39 | margin: 20px;
40 | margin-left: 0;
41 | align-self: normal;
42 | }
43 |
44 | @media (max-width: 600px) {
45 | min-width: 300px;
46 | }
47 | `
48 |
49 | const SelectWrapperBig = styled.div`
50 | flex: 1;
51 | min-width: 320px;
52 | margin-left: 20px;
53 | line-height: 1.2;
54 |
55 | @media (max-width: 1200px) {
56 | min-width: 30vw;
57 | margin: 20px;
58 | margin-left: 0;
59 | align-self: normal;
60 | }
61 |
62 | @media (max-width: 600px) {
63 | min-width: 300px;
64 | }
65 | `
66 |
67 | const Sentence = styled.div`
68 | display: flex;
69 | align-items: center;
70 | justify-content: flex-start;
71 | width: 100%;
72 | font-size: 24px;
73 | line-height: 1.25;
74 |
75 | @media (max-width: 1200px) {
76 | font-size: 20px;
77 | line-height: 1;
78 | flex-direction: column;
79 | align-items: flex-start;
80 | }
81 | `
82 |
83 | const Title = styled.div`
84 | display: flex;
85 | justify-content: space-between;
86 | align-items: center;
87 | margin-bottom: 3vh;
88 |
89 | @media (max-width: 600px) {
90 | margin-bottom: 3vh;
91 |
92 | flex-direction: column;
93 | align-items: flex-start;
94 | }
95 | `
96 |
97 | const Description = styled.p`
98 | margin: 0;
99 | opacity: 0.6;
100 | font-size: 12px;
101 |
102 | @media (max-width: 600px) {
103 | margin-bottom: 1vh;
104 | }
105 | `
106 |
107 | const StyledLink = css`
108 | margin: 0;
109 | opacity: 0.6;
110 | font-size: 12px;
111 |
112 | &:hover {
113 | opacity: 0.8;
114 | }
115 | `
116 |
117 | const Version = styled.a`
118 | ${StyledLink}
119 | `
120 |
121 | const Content = styled.main`
122 | padding: 8vh 8vw 15vh;
123 |
124 | @media (max-width: 1200px) {
125 | padding: 8vh 4vw;
126 | width: 100%;
127 | }
128 |
129 | background-color: rgba(0, 0, 0, 0.03);
130 | animation: ${fadeUp} 500ms cubic-bezier(0.175, 0.885, 0.32, 1.15);
131 | `
132 |
133 | const customStyles = {
134 | indicatorSeparator: () => ({
135 | display: 'none'
136 | })
137 | }
138 |
139 | const customTheme = theme => ({
140 | ...theme,
141 | colors: {
142 | ...theme.colors,
143 | primary: colors.black,
144 | primary75: colors.grey,
145 | primary50: colors.grey,
146 | primary25: colors.grey
147 | }
148 | })
149 |
150 | const OptionItem = styled.div`
151 | display: flex;
152 | align-items: center;
153 | `
154 |
155 | const OptionIcon = styled.span`
156 | display: flex;
157 | justify-content: center;
158 | align-items: center;
159 |
160 | font-size: 14px;
161 | min-width: 20px;
162 | padding-left: 12px;
163 | text-align: center;
164 | background-color: ${props =>
165 | props.isFocused ? 'rgba(0, 0, 0, 0.05)' : 'transparent'};
166 |
167 | color: rgba(42, 39, 52, 0.6);
168 | min-height: 44px;
169 |
170 | @media (max-width: 1200px) {
171 | min-height: 40px;
172 | }
173 | `
174 |
175 | const Option = props => {
176 | return (
177 |
178 |
179 | {typeIcons[props.label]}
180 |
181 |
182 |
183 | )
184 | }
185 |
186 | const GithubLink = styled.a`
187 | ${StyledLink}
188 |
189 | display: flex;
190 | justify-content: center;
191 | align-items: center;
192 | `
193 |
194 | const typeIcons = {
195 | list: '[]',
196 | object: '{}',
197 | function: 'fn',
198 | logic: 'if',
199 | relation: '>=',
200 | math: '+/'
201 | }
202 |
203 | const App = props => {
204 | const {
205 | data,
206 | match: { params },
207 | history
208 | } = props
209 |
210 | const types = R.uniq(R.map(R.prop('type'), data))
211 | const typeOptions = R.map(v => ({ label: v }), types)
212 |
213 | const [type, setType] = useState({ label: params.type })
214 | const [action, setAction] = useState({
215 | label: params.action && unslug(params.action)
216 | })
217 |
218 | const actionsByType = R.filter(R.propEq('type', type.label), data)
219 | const actionOptions = R.map(v => ({ label: v.action, ...v }), actionsByType)
220 |
221 | const typeSelected = type && R.length(actionsByType) !== 0
222 | const actionSelected = action && R.length(actionsByType) !== 0
223 |
224 | const optionAction = R.find(a => a.label === action.label, actionOptions)
225 |
226 | return (
227 |
228 |
229 |
230 |
231 | Find the right function you need in RamdaJS
232 |
233 |
234 |
235 | davesnx/learn-ramda
236 |
237 |
241 | ramda@0.26.0
242 |
243 |
244 |
245 | I have a
246 |
247 |
265 | {typeSelected && (
266 |
267 | I would like to
268 |
269 |
283 |
284 | )}
285 |
286 |
287 | {optionAction && (
288 | Loading...}>
289 |
290 |
291 |
292 |
293 | )}
294 |
295 | )
296 | }
297 |
298 | export default App
299 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2019 David Sancho
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/ramda-docs/what-function-should-I-use-data.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "type": "list",
4 | "action": "change every value",
5 | "func": [
6 | {
7 | "name": "map"
8 | }
9 | ]
10 | },
11 | {
12 | "type": "object",
13 | "action": "pull a property off each value",
14 | "func": [
15 | {
16 | "name": "pick"
17 | }
18 | ]
19 | },
20 | {
21 | "type": "list",
22 | "action": "receive the index of each element along with the value when iterating over a list",
23 | "func": [
24 | {
25 | "name": "addIndex"
26 | }
27 | ]
28 | },
29 | {
30 | "type": "list",
31 | "action": "pull a property off each value",
32 | "func": [
33 | {
34 | "name": "pluck"
35 | }
36 | ]
37 | },
38 | {
39 | "type": "list",
40 | "action": "select values based on custom logic",
41 | "func": [
42 | {
43 | "name": "filter"
44 | }
45 | ]
46 | },
47 | {
48 | "type": "list",
49 | "action": "select values from a specific index range",
50 | "func": [
51 | {
52 | "name": "slice"
53 | }
54 | ]
55 | },
56 | {
57 | "type": "list",
58 | "action": "select values from the start",
59 | "func": [
60 | {
61 | "name": "take"
62 | }
63 | ]
64 | },
65 | {
66 | "type": "list",
67 | "action": "select values from the start based on custom logic",
68 | "func": [
69 | {
70 | "name": "takeWhile"
71 | }
72 | ]
73 | },
74 | {
75 | "type": "list",
76 | "action": "select values from the end",
77 | "func": [
78 | {
79 | "name": "takeLast"
80 | }
81 | ]
82 | },
83 | {
84 | "type": "list",
85 | "action": "select values from the end based on custom logic",
86 | "func": [
87 | {
88 | "name": "takeLastWhile"
89 | }
90 | ]
91 | },
92 | {
93 | "type": "list",
94 | "action": "remove the last value",
95 | "func": [
96 | {
97 | "name": "init"
98 | }
99 | ]
100 | },
101 | {
102 | "type": "list",
103 | "action": "remove specific values",
104 | "func": [
105 | {
106 | "name": "without"
107 | }
108 | ]
109 | },
110 | {
111 | "type": "list",
112 | "action": "remove values based on custom logic",
113 | "func": [
114 | {
115 | "name": "reject"
116 | }
117 | ]
118 | },
119 | {
120 | "type": "list",
121 | "action": "dedupe, remove all duplicates",
122 | "func": [
123 | {
124 | "name": "uniq"
125 | }
126 | ]
127 | },
128 | {
129 | "type": "list",
130 | "action": "dedupe, remove all duplicates based on custom logic",
131 | "func": [
132 | {
133 | "name": "uniqWith"
134 | }
135 | ]
136 | },
137 | {
138 | "type": "list",
139 | "action": "remove values based on index",
140 | "func": [
141 | {
142 | "name": "remove"
143 | }
144 | ]
145 | },
146 | {
147 | "type": "list",
148 | "action": "remove values from the start",
149 | "func": [
150 | {
151 | "name": "drop"
152 | }
153 | ]
154 | },
155 | {
156 | "type": "list",
157 | "action": "remove values from the start based on custom logic",
158 | "func": [
159 | {
160 | "name": "dropWhile"
161 | }
162 | ]
163 | },
164 | {
165 | "type": "list",
166 | "action": "remove values from the end",
167 | "func": [
168 | {
169 | "name": "dropLast"
170 | }
171 | ]
172 | },
173 | {
174 | "type": "list",
175 | "action": "remove values from the end based on custom logic",
176 | "func": [
177 | {
178 | "name": "dropLastWhile"
179 | }
180 | ]
181 | },
182 | {
183 | "type": "list",
184 | "action": "compute the sum",
185 | "func": [
186 | {
187 | "name": "sum"
188 | }
189 | ]
190 | },
191 | {
192 | "type": "list",
193 | "action": "compute the product",
194 | "func": [
195 | {
196 | "name": "product"
197 | }
198 | ]
199 | },
200 | {
201 | "type": "list",
202 | "action": "compute the average",
203 | "func": [
204 | {
205 | "name": "mean"
206 | }
207 | ]
208 | },
209 | {
210 | "type": "list",
211 | "action": "compute the median",
212 | "func": [
213 | {
214 | "name": "median"
215 | }
216 | ]
217 | },
218 | {
219 | "type": "list",
220 | "action": "compute based on custom logic and only output the final value",
221 | "func": [
222 | {
223 | "name": "reduce"
224 | },
225 | {
226 | "name": "reduceRight"
227 | }
228 | ]
229 | },
230 | {
231 | "type": "list",
232 | "action": "compute based on custom logic and output the values as they are calculated",
233 | "func": [
234 | {
235 | "name": "scan"
236 | }
237 | ]
238 | },
239 | {
240 | "type": "list",
241 | "action": "take the first value",
242 | "func": [
243 | {
244 | "name": "head"
245 | }
246 | ]
247 | },
248 | {
249 | "type": "list",
250 | "action": "take the last value",
251 | "func": [
252 | {
253 | "name": "last"
254 | }
255 | ]
256 | },
257 | {
258 | "type": "list",
259 | "action": "take a value from a specific index",
260 | "func": [
261 | {
262 | "name": "nth"
263 | }
264 | ]
265 | },
266 | {
267 | "type": "list",
268 | "action": "take the first occurrence of a value based on custom logic",
269 | "func": [
270 | {
271 | "name": "find"
272 | }
273 | ]
274 | },
275 | {
276 | "type": "list",
277 | "action": "take the last occurrence of a value based on custom logic",
278 | "func": [
279 | {
280 | "name": "findLast"
281 | }
282 | ]
283 | },
284 | {
285 | "type": "list",
286 | "action": "know if a specific value is present",
287 | "func": [
288 | {
289 | "name": "contains"
290 | }
291 | ]
292 | },
293 | {
294 | "type": "list",
295 | "action": "know where the first occurrence of a value is",
296 | "func": [
297 | {
298 | "name": "indexOf"
299 | }
300 | ]
301 | },
302 | {
303 | "type": "list",
304 | "action": "know where the first occurrence of a value is based on custom logic",
305 | "func": [
306 | {
307 | "name": "findIndex"
308 | }
309 | ]
310 | },
311 | {
312 | "type": "list",
313 | "action": "know where the last occurrence of a value is",
314 | "func": [
315 | {
316 | "name": "lastIndexOf"
317 | }
318 | ]
319 | },
320 | {
321 | "type": "list",
322 | "action": "know where the last occurrence of a value is based on custom logic",
323 | "func": [
324 | {
325 | "name": "findLastIndex"
326 | }
327 | ]
328 | },
329 | {
330 | "type": "list",
331 | "action": "know if a condition is satisfied by all of the values",
332 | "func": [
333 | {
334 | "name": "all"
335 | }
336 | ]
337 | },
338 | {
339 | "type": "list",
340 | "action": "know if a condition is satisfied by any of the values",
341 | "func": [
342 | {
343 | "name": "any"
344 | }
345 | ]
346 | },
347 | {
348 | "type": "list",
349 | "action": "know if a condition is satisfied by none of the values",
350 | "func": [
351 | {
352 | "name": "none"
353 | }
354 | ]
355 | },
356 | {
357 | "type": "list",
358 | "action": "replace a value at a specific index",
359 | "func": [
360 | {
361 | "name": "update"
362 | }
363 | ]
364 | },
365 | {
366 | "type": "list",
367 | "action": "replace a value at a specific index based on custom logic",
368 | "func": [
369 | {
370 | "name": "adjust"
371 | },
372 | {
373 | "name": "lensPath"
374 | }
375 | ]
376 | },
377 | {
378 | "type": "list",
379 | "action": "add a value at the start",
380 | "func": [
381 | {
382 | "name": "prepend"
383 | }
384 | ]
385 | },
386 | {
387 | "type": "list",
388 | "action": "add a value at the end",
389 | "func": [
390 | {
391 | "name": "append"
392 | }
393 | ]
394 | },
395 | {
396 | "type": "list",
397 | "action": "add a value at a specific index",
398 | "func": [
399 | {
400 | "name": "insert"
401 | }
402 | ]
403 | },
404 | {
405 | "type": "list",
406 | "action": "add multiple values at a specific index",
407 | "func": [
408 | {
409 | "name": "insertAll"
410 | }
411 | ]
412 | },
413 | {
414 | "type": "list",
415 | "action": "group values based on custom logic",
416 | "func": [
417 | {
418 | "name": "groupBy"
419 | }
420 | ]
421 | },
422 | {
423 | "type": "list",
424 | "action": "know how many values it contains",
425 | "func": [
426 | {
427 | "name": "length"
428 | }
429 | ]
430 | },
431 | {
432 | "type": "list",
433 | "action": "get a specific range of integer values",
434 | "func": [
435 | {
436 | "name": "range"
437 | }
438 | ]
439 | },
440 | {
441 | "type": "list",
442 | "action": "split at a specific index",
443 | "func": [
444 | {
445 | "name": "splitAt"
446 | }
447 | ]
448 | },
449 | {
450 | "type": "list",
451 | "action": "split based on custom logic",
452 | "func": [
453 | {
454 | "name": "splitWhen"
455 | }
456 | ]
457 | },
458 | {
459 | "type": "list",
460 | "action": "split into chunks of a specific length",
461 | "func": [
462 | {
463 | "name": "splitEvery"
464 | }
465 | ]
466 | },
467 | {
468 | "type": "list",
469 | "action": "reverse",
470 | "func": [
471 | {
472 | "name": "reverse"
473 | }
474 | ]
475 | },
476 | {
477 | "type": "list",
478 | "action": "sort",
479 | "func": [
480 | {
481 | "name": "sort"
482 | }
483 | ]
484 | },
485 | {
486 | "type": "list",
487 | "action": "sort based on custom logic",
488 | "func": [
489 | {
490 | "name": "sortBy"
491 | }
492 | ]
493 | },
494 | {
495 | "type": "list",
496 | "action": "concatenate two lists",
497 | "func": [
498 | {
499 | "name": "concat"
500 | }
501 | ]
502 | },
503 | {
504 | "type": "list",
505 | "action": "find the common values in two lists",
506 | "func": [
507 | {
508 | "name": "intersection"
509 | }
510 | ]
511 | },
512 | {
513 | "type": "list",
514 | "action": "find the common values in two lists based on custom logic",
515 | "func": [
516 | {
517 | "name": "intersectionWith"
518 | }
519 | ]
520 | },
521 | {
522 | "type": "list",
523 | "action": "find the distinct values compared to another list",
524 | "func": [
525 | {
526 | "name": "difference"
527 | }
528 | ]
529 | },
530 | {
531 | "type": "list",
532 | "action": "find the distinct values compared to another list based on custom logic",
533 | "func": [
534 | {
535 | "name": "differenceWith"
536 | }
537 | ]
538 | },
539 | {
540 | "type": "list",
541 | "action": "combine two lists into a list of unique values",
542 | "func": [
543 | {
544 | "name": "union"
545 | }
546 | ]
547 | },
548 | {
549 | "type": "list",
550 | "action": "combine two lists into a list of unique values based on custom logic",
551 | "func": [
552 | {
553 | "name": "unionWith"
554 | }
555 | ]
556 | },
557 | {
558 | "type": "list",
559 | "action": "combine two lists into a list of pairs",
560 | "func": [
561 | {
562 | "name": "zip"
563 | }
564 | ]
565 | },
566 | {
567 | "type": "list",
568 | "action": "combine two lists into a list of pairs based on custom logic",
569 | "func": [
570 | {
571 | "name": "zipWith"
572 | }
573 | ]
574 | },
575 | {
576 | "type": "list",
577 | "action": "convert list of objects into one object",
578 | "func": [
579 | {
580 | "name": "indexBy"
581 | }
582 | ]
583 | },
584 | {
585 | "type": "list",
586 | "action": "split a list into two sub lists based on a single predicate function",
587 | "func": [
588 | {
589 | "name": "partition"
590 | }
591 | ]
592 | },
593 | {
594 | "type": "object",
595 | "action": "change every value",
596 | "func": [
597 | {
598 | "name": "mapObjIndexed"
599 | },
600 | {
601 | "name": "map"
602 | }
603 | ]
604 | },
605 | {
606 | "type": "object",
607 | "action": "select a specific key's value",
608 | "func": [
609 | {
610 | "name": "prop"
611 | },
612 | {
613 | "name": "path"
614 | }
615 | ]
616 | },
617 | {
618 | "type": "object",
619 | "action": "select a specific key's value or return a default if it is not found",
620 | "func": [
621 | {
622 | "name": "propOr"
623 | },
624 | {
625 | "name": "pathOr"
626 | }
627 | ]
628 | },
629 | {
630 | "type": "object",
631 | "action": "select specific keys' values",
632 | "func": [
633 | {
634 | "name": "props"
635 | }
636 | ]
637 | },
638 | {
639 | "type": "object",
640 | "action": "select specific keys",
641 | "func": [
642 | {
643 | "name": "pick"
644 | },
645 | {
646 | "name": "pickAll"
647 | }
648 | ]
649 | },
650 | {
651 | "type": "object",
652 | "action": "select keys based on custom logic",
653 | "func": [
654 | {
655 | "name": "filter"
656 | },
657 | {
658 | "name": "pickBy"
659 | }
660 | ]
661 | },
662 | {
663 | "type": "object",
664 | "action": "remove a specific key",
665 | "func": [
666 | {
667 | "name": "dissoc"
668 | },
669 | {
670 | "name": "dissocPath"
671 | }
672 | ]
673 | },
674 | {
675 | "type": "object",
676 | "action": "remove specific keys",
677 | "func": [
678 | {
679 | "name": "omit"
680 | }
681 | ]
682 | },
683 | {
684 | "type": "object",
685 | "action": "remove specific keys based on custom logic",
686 | "func": [
687 | {
688 | "name": "reject"
689 | }
690 | ]
691 | },
692 | {
693 | "type": "object",
694 | "action": "add a specific key and value",
695 | "func": [
696 | {
697 | "name": "assoc"
698 | },
699 | {
700 | "name": "assocPath"
701 | }
702 | ]
703 | },
704 | {
705 | "type": "object",
706 | "action": "replace a specific value based on custom logic",
707 | "func": [
708 | {
709 | "name": "lens"
710 | },
711 | {
712 | "name": "lensProp"
713 | },
714 | {
715 | "name": "lensPath"
716 | }
717 | ]
718 | },
719 | {
720 | "type": "object",
721 | "action": "replace specific values based on custom logic",
722 | "func": [
723 | {
724 | "name": "evolve"
725 | }
726 | ]
727 | },
728 | {
729 | "type": "object",
730 | "action": "know if a specific key is present",
731 | "func": [
732 | {
733 | "name": "has"
734 | },
735 | {
736 | "name": "hasIn"
737 | }
738 | ]
739 | },
740 | {
741 | "type": "object",
742 | "action": "know if a specific key has a specific value",
743 | "func": [
744 | {
745 | "name": "propEq"
746 | },
747 | {
748 | "name": "pathEq"
749 | }
750 | ]
751 | },
752 | {
753 | "type": "object",
754 | "action": "know if a specific key's value satisfies a custom predicate",
755 | "func": [
756 | {
757 | "name": "propSatisfies"
758 | },
759 | {
760 | "name": "pathSatisfies"
761 | }
762 | ]
763 | },
764 | {
765 | "type": "object",
766 | "action": "know if specific keys have specific values",
767 | "func": [
768 | {
769 | "name": "whereEq"
770 | }
771 | ]
772 | },
773 | {
774 | "type": "object",
775 | "action": "know if specific keys' values satisfy custom predicates",
776 | "func": [
777 | {
778 | "name": "where"
779 | }
780 | ]
781 | },
782 | {
783 | "type": "object",
784 | "action": "list all the keys",
785 | "func": [
786 | {
787 | "name": "keys"
788 | },
789 | {
790 | "name": "keysIn"
791 | }
792 | ]
793 | },
794 | {
795 | "type": "object",
796 | "action": "list all the values",
797 | "func": [
798 | {
799 | "name": "values"
800 | },
801 | {
802 | "name": "valuesIn"
803 | }
804 | ]
805 | },
806 | {
807 | "type": "object",
808 | "action": "convert to a list of pairs",
809 | "func": [
810 | {
811 | "name": "toPairs"
812 | },
813 | {
814 | "name": "toPairsIn"
815 | }
816 | ]
817 | },
818 | {
819 | "type": "object",
820 | "action": "know if two objects share the same key and value",
821 | "func": [
822 | {
823 | "name": "eqProps"
824 | }
825 | ]
826 | },
827 | {
828 | "type": "object",
829 | "action": "create an object with a single key and value",
830 | "func": [
831 | {
832 | "name": "objOf"
833 | }
834 | ]
835 | },
836 | {
837 | "type": "object",
838 | "action": "create an object with multiple keys and values",
839 | "func": [
840 | {
841 | "name": "zipObj"
842 | }
843 | ]
844 | },
845 | {
846 | "type": "object",
847 | "action": "clone an object",
848 | "func": [
849 | {
850 | "name": "clone"
851 | }
852 | ]
853 | },
854 | {
855 | "type": "object",
856 | "action": "merge two objects into one object",
857 | "func": [
858 | {
859 | "name": "merge"
860 | }
861 | ]
862 | },
863 | {
864 | "type": "object",
865 | "action": "merge two objects into one object based on custom duplicate key logic",
866 | "func": [
867 | {
868 | "name": "mergeWith"
869 | }
870 | ]
871 | },
872 | {
873 | "type": "object",
874 | "action": "merge more than two objects into one object",
875 | "func": [
876 | {
877 | "name": "mergeAll"
878 | }
879 | ]
880 | },
881 | {
882 | "type": "function",
883 | "action": "combine functions",
884 | "func": [
885 | {
886 | "name": "pipe"
887 | },
888 | {
889 | "name": "compose"
890 | }
891 | ]
892 | },
893 | {
894 | "type": "function",
895 | "action": "combine promise returning functions",
896 | "func": [
897 | {
898 | "name": "pipeP"
899 | },
900 | {
901 | "name": "composeP"
902 | }
903 | ]
904 | },
905 | {
906 | "type": "function",
907 | "action": "curry a function",
908 | "func": [
909 | {
910 | "name": "curry"
911 | }
912 | ]
913 | },
914 | {
915 | "type": "function",
916 | "action": "partially apply a function",
917 | "func": [
918 | {
919 | "name": "partialRight"
920 | },
921 | {
922 | "name": "partial"
923 | }
924 | ]
925 | },
926 | {
927 | "type": "function",
928 | "action": "uncurry a function",
929 | "func": [
930 | {
931 | "name": "uncurry"
932 | }
933 | ]
934 | },
935 | {
936 | "type": "function",
937 | "action": "swap the argument order",
938 | "func": [
939 | {
940 | "name": "flip"
941 | }
942 | ]
943 | },
944 | {
945 | "type": "function",
946 | "action": "apply a list of arguments",
947 | "func": [
948 | {
949 | "name": "apply"
950 | }
951 | ]
952 | },
953 | {
954 | "type": "function",
955 | "action": "apply multiple functions to a single value and merge the results somehow",
956 | "func": [
957 | {
958 | "name": "converge"
959 | }
960 | ]
961 | },
962 | {
963 | "type": "function",
964 | "action": "transform a function's arguments",
965 | "func": [
966 | {
967 | "name": "useWith"
968 | }
969 | ]
970 | },
971 | {
972 | "type": "function",
973 | "action": "apply a list of functions to each argument and collect the results",
974 | "func": [
975 | {
976 | "name": "juxt"
977 | }
978 | ]
979 | },
980 | {
981 | "type": "function",
982 | "action": "create a variadic function from one that takes an array",
983 | "func": [
984 | {
985 | "name": "unapply"
986 | }
987 | ]
988 | },
989 | {
990 | "type": "function",
991 | "action": "restrict the number of accepted arguments to 1",
992 | "func": [
993 | {
994 | "name": "unary"
995 | }
996 | ]
997 | },
998 | {
999 | "type": "function",
1000 | "action": "restrict the number of accepted arguments to 2",
1001 | "func": [
1002 | {
1003 | "name": "binary"
1004 | }
1005 | ]
1006 | },
1007 | {
1008 | "type": "function",
1009 | "action": "restrict the number of accepted arguments to specific number",
1010 | "func": [
1011 | {
1012 | "name": "nAry"
1013 | }
1014 | ]
1015 | },
1016 | {
1017 | "type": "function",
1018 | "action": "return the supplied argument unchanged",
1019 | "func": [
1020 | {
1021 | "name": "identity"
1022 | }
1023 | ]
1024 | },
1025 | {
1026 | "type": "function",
1027 | "action": "turn a method into a function",
1028 | "func": [
1029 | {
1030 | "name": "invoker"
1031 | }
1032 | ]
1033 | },
1034 | {
1035 | "type": "function",
1036 | "action": "invoke a function only once",
1037 | "func": [
1038 | {
1039 | "name": "once"
1040 | }
1041 | ]
1042 | },
1043 | {
1044 | "type": "function",
1045 | "action": "inspect values without affecting them",
1046 | "func": [
1047 | {
1048 | "name": "tap"
1049 | }
1050 | ]
1051 | },
1052 | {
1053 | "type": "function",
1054 | "action": "bind to a specific context",
1055 | "func": [
1056 | {
1057 | "name": "bind"
1058 | }
1059 | ]
1060 | },
1061 | {
1062 | "type": "function",
1063 | "action": "lift a function",
1064 | "func": [
1065 | {
1066 | "name": "liftN"
1067 | },
1068 | {
1069 | "name": "lift"
1070 | }
1071 | ]
1072 | },
1073 | {
1074 | "type": "function",
1075 | "action": "memoize",
1076 | "func": [
1077 | {
1078 | "name": "memoize"
1079 | }
1080 | ]
1081 | },
1082 | {
1083 | "type": "logic",
1084 | "action": "apply a function based on conditional logic",
1085 | "func": [
1086 | {
1087 | "name": "ifElse"
1088 | },
1089 | {
1090 | "name": "cond"
1091 | },
1092 | {
1093 | "name": "unless"
1094 | },
1095 | {
1096 | "name": "when"
1097 | }
1098 | ]
1099 | },
1100 | {
1101 | "type": "logic",
1102 | "action": "negate a value",
1103 | "func": [
1104 | {
1105 | "name": "not"
1106 | }
1107 | ]
1108 | },
1109 | {
1110 | "type": "logic",
1111 | "action": "know if either of two values are truthy",
1112 | "func": [
1113 | {
1114 | "name": "or"
1115 | }
1116 | ]
1117 | },
1118 | {
1119 | "type": "logic",
1120 | "action": "know if two values are truthy",
1121 | "func": [
1122 | {
1123 | "name": "and"
1124 | }
1125 | ]
1126 | },
1127 | {
1128 | "type": "logic",
1129 | "action": "invert a predicate function",
1130 | "func": [
1131 | {
1132 | "name": "complement"
1133 | }
1134 | ]
1135 | },
1136 | {
1137 | "type": "logic",
1138 | "action": "know if a value satisfies at least one of two predicates",
1139 | "func": [
1140 | {
1141 | "name": "either"
1142 | }
1143 | ]
1144 | },
1145 | {
1146 | "type": "logic",
1147 | "action": "know if a value satisfies two predicates",
1148 | "func": [
1149 | {
1150 | "name": "both"
1151 | }
1152 | ]
1153 | },
1154 | {
1155 | "type": "logic",
1156 | "action": "know if a value satisfies at least one of a list of predicates",
1157 | "func": [
1158 | {
1159 | "name": "anyPass"
1160 | }
1161 | ]
1162 | },
1163 | {
1164 | "type": "logic",
1165 | "action": "know if a value satisfies at every one of a list of predicates",
1166 | "func": [
1167 | {
1168 | "name": "allPass"
1169 | }
1170 | ]
1171 | },
1172 | {
1173 | "type": "logic",
1174 | "action": "produce an empty value",
1175 | "func": [
1176 | {
1177 | "name": "empty"
1178 | }
1179 | ]
1180 | },
1181 | {
1182 | "type": "logic",
1183 | "action": "know if a value is empty",
1184 | "func": [
1185 | {
1186 | "name": "isEmpty"
1187 | }
1188 | ]
1189 | },
1190 | {
1191 | "type": "relation",
1192 | "action": "compare for value equality",
1193 | "func": [
1194 | {
1195 | "name": "equals"
1196 | }
1197 | ]
1198 | },
1199 | {
1200 | "type": "relation",
1201 | "action": "compare for reference equality",
1202 | "func": [
1203 | {
1204 | "name": "identical"
1205 | }
1206 | ]
1207 | },
1208 | {
1209 | "type": "relation",
1210 | "action": "know if a value is less than another",
1211 | "func": [
1212 | {
1213 | "name": "lt"
1214 | }
1215 | ]
1216 | },
1217 | {
1218 | "type": "relation",
1219 | "action": "know if a value is less than or equal to another",
1220 | "func": [
1221 | {
1222 | "name": "lte"
1223 | }
1224 | ]
1225 | },
1226 | {
1227 | "type": "relation",
1228 | "action": "know if a value is greater than another",
1229 | "func": [
1230 | {
1231 | "name": "gt"
1232 | }
1233 | ]
1234 | },
1235 | {
1236 | "type": "relation",
1237 | "action": "know if a value is greater than or equal to another",
1238 | "func": [
1239 | {
1240 | "name": "gte"
1241 | }
1242 | ]
1243 | },
1244 | {
1245 | "type": "relation",
1246 | "action": "find the smallest of two values",
1247 | "func": [
1248 | {
1249 | "name": "min"
1250 | }
1251 | ]
1252 | },
1253 | {
1254 | "type": "relation",
1255 | "action": "find the smallest of two values based on custom logic",
1256 | "func": [
1257 | {
1258 | "name": "minBy"
1259 | }
1260 | ]
1261 | },
1262 | {
1263 | "type": "relation",
1264 | "action": "find the largest of two values",
1265 | "func": [
1266 | {
1267 | "name": "max"
1268 | }
1269 | ]
1270 | },
1271 | {
1272 | "type": "relation",
1273 | "action": "find the largest of two values based on custom logic",
1274 | "func": [
1275 | {
1276 | "name": "maxBy"
1277 | }
1278 | ]
1279 | },
1280 | {
1281 | "type": "math",
1282 | "action": "increment a number by one",
1283 | "func": [
1284 | {
1285 | "name": "inc"
1286 | }
1287 | ]
1288 | },
1289 | {
1290 | "type": "math",
1291 | "action": "decrement a number by one",
1292 | "func": [
1293 | {
1294 | "name": "dec"
1295 | }
1296 | ]
1297 | },
1298 | {
1299 | "type": "math",
1300 | "action": "add two numbers",
1301 | "func": [
1302 | {
1303 | "name": "add"
1304 | }
1305 | ]
1306 | },
1307 | {
1308 | "type": "math",
1309 | "action": "subtract one number from another",
1310 | "func": [
1311 | {
1312 | "name": "subtract"
1313 | }
1314 | ]
1315 | },
1316 | {
1317 | "type": "math",
1318 | "action": "multiple two numbers",
1319 | "func": [
1320 | {
1321 | "name": "multiply"
1322 | }
1323 | ]
1324 | },
1325 | {
1326 | "type": "math",
1327 | "action": "divide one number by another",
1328 | "func": [
1329 | {
1330 | "name": "divide"
1331 | }
1332 | ]
1333 | },
1334 | {
1335 | "type": "math",
1336 | "action": "negate a number",
1337 | "func": [
1338 | {
1339 | "name": "negate"
1340 | }
1341 | ]
1342 | },
1343 | {
1344 | "type": "math",
1345 | "action": "divide one number by another and get the remainder",
1346 | "func": [
1347 | {
1348 | "name": "modulo"
1349 | },
1350 | {
1351 | "name": "mathMod"
1352 | }
1353 | ]
1354 | }
1355 | ]
1356 |
--------------------------------------------------------------------------------
/src/data.json:
--------------------------------------------------------------------------------
1 | [{"type":"list","action":"change every value","func":[{"name":"map","longname":"R.map","description":"Takes a function and\na [functor](https://github.com/fantasyland/fantasy-land#functor),\napplies the function to each of the functor's values, and returns\na functor of the same shape.\n\nRamda provides suitable `map` implementations for `Array` and `Object`,\nso this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.\n\nDispatches to the `map` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.\n\nAlso treats functions as functors and will compose them together.","signature":"Functor f => (a -> b) -> f a -> f b","example":" const double = x => x * 2;\n\n R.map(double, [1, 2, 3]); //=> [2, 4, 6]\n\n R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}"}]},{"type":"object","action":"pull a property off each value","func":[{"name":"pick","longname":"R.pick","description":"Returns a partial copy of an object containing only the keys specified. If\nthe key does not exist, the property is ignored.","signature":"[k] -> {k: v} -> {k: v}","example":" R.pick(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4}\n R.pick(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1}"}]},{"type":"list","action":"receive the index of each element along with the value when iterating over a list","func":[{"name":"addIndex","longname":"R.addIndex","description":"Creates a new list iteration function from an existing one by adding two new\nparameters to its callback function: the current index, and the entire list.\n\nThis would turn, for instance, [`R.map`](#map) function into one that\nmore closely resembles `Array.prototype.map`. Note that this will only work\nfor functions in which the iteration callback function is the first\nparameter, and where the list is the last parameter. (This latter might be\nunimportant if the list parameter is not used.)","signature":"((a ... -> b) ... -> [a] -> *) -> ((a ..., Int, [a] -> b) ... -> [a] -> *)","example":" const mapIndexed = R.addIndex(R.map);\n mapIndexed((val, idx) => idx + '-' + val, ['f', 'o', 'o', 'b', 'a', 'r']);\n //=> ['0-f', '1-o', '2-o', '3-b', '4-a', '5-r']"}]},{"type":"list","action":"pull a property off each value","func":[{"name":"pluck","longname":"R.pluck","description":"Returns a new list by plucking the same named property off all objects in\nthe list supplied.\n\n`pluck` will work on\nany [functor](https://github.com/fantasyland/fantasy-land#functor) in\naddition to arrays, as it is equivalent to `R.map(R.prop(k), f)`.","signature":"Functor f => k -> f {k: v} -> f v","example":" var getAges = R.pluck('age');\n getAges([{name: 'fred', age: 29}, {name: 'wilma', age: 27}]); //=> [29, 27]\n\n R.pluck(0, [[1, 2], [3, 4]]); //=> [1, 3]\n R.pluck('val', {a: {val: 3}, b: {val: 5}}); //=> {a: 3, b: 5}"}]},{"type":"list","action":"select values based on custom logic","func":[{"name":"filter","longname":"R.filter","description":"Takes a predicate and a `Filterable`, and returns a new filterable of the\nsame type containing the members of the given filterable which satisfy the\ngiven predicate. Filterable objects include plain objects or any object\nthat has a filter method such as `Array`.\n\nDispatches to the `filter` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"Filterable f => (a -> Boolean) -> f a -> f a","example":" const isEven = n => n % 2 === 0;\n\n R.filter(isEven, [1, 2, 3, 4]); //=> [2, 4]\n\n R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}"}]},{"type":"list","action":"select values from a specific index range","func":[{"name":"slice","longname":"R.slice","description":"Returns the elements of the given list or string (or object with a `slice`\nmethod) from `fromIndex` (inclusive) to `toIndex` (exclusive).\n\nDispatches to the `slice` method of the third argument, if present.","signature":"Number -> Number -> [a] -> [a]","example":" R.slice(1, 3, ['a', 'b', 'c', 'd']); //=> ['b', 'c']\n R.slice(1, Infinity, ['a', 'b', 'c', 'd']); //=> ['b', 'c', 'd']\n R.slice(0, -1, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c']\n R.slice(-3, -1, ['a', 'b', 'c', 'd']); //=> ['b', 'c']\n R.slice(0, 3, 'ramda'); //=> 'ram'"}]},{"type":"list","action":"select values from the start","func":[{"name":"take","longname":"R.take","description":"Returns the first `n` elements of the given list, string, or\ntransducer/transformer (or object with a `take` method).\n\nDispatches to the `take` method of the second argument, if present.","signature":"Number -> [a] -> [a]","example":" R.take(1, ['foo', 'bar', 'baz']); //=> ['foo']\n R.take(2, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']\n R.take(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n R.take(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n R.take(3, 'ramda'); //=> 'ram'\n\n const personnel = [\n 'Dave Brubeck',\n 'Paul Desmond',\n 'Eugene Wright',\n 'Joe Morello',\n 'Gerry Mulligan',\n 'Bob Bates',\n 'Joe Dodge',\n 'Ron Crotty'\n ];\n\n const takeFive = R.take(5);\n takeFive(personnel);\n //=> ['Dave Brubeck', 'Paul Desmond', 'Eugene Wright', 'Joe Morello', 'Gerry Mulligan']"}]},{"type":"list","action":"select values from the start based on custom logic","func":[{"name":"takeWhile","longname":"R.takeWhile","description":"Returns a new list containing the first `n` elements of a given list,\npassing each value to the supplied predicate function, and terminating when\nthe predicate function returns `false`. Excludes the element that caused the\npredicate function to fail. The predicate function is passed one argument:\n*(value)*.\n\nDispatches to the `takeWhile` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> [a]","example":" const isNotFour = x => x !== 4;\n\n R.takeWhile(isNotFour, [1, 2, 3, 4, 3, 2, 1]); //=> [1, 2, 3]\n\n R.takeWhile(x => x !== 'd' , 'Ramda'); //=> 'Ram'"}]},{"type":"list","action":"select values from the end","func":[{"name":"takeLast","longname":"R.takeLast","description":"Returns a new list containing the last `n` elements of the given list.\nIf `n > list.length`, returns a list of `list.length` elements.","signature":"Number -> [a] -> [a]","example":" R.takeLast(1, ['foo', 'bar', 'baz']); //=> ['baz']\n R.takeLast(2, ['foo', 'bar', 'baz']); //=> ['bar', 'baz']\n R.takeLast(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n R.takeLast(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n R.takeLast(3, 'ramda'); //=> 'mda'"}]},{"type":"list","action":"select values from the end based on custom logic","func":[{"name":"takeLastWhile","longname":"R.takeLastWhile","description":"Returns a new list containing the last `n` elements of a given list, passing\neach value to the supplied predicate function, and terminating when the\npredicate function returns `false`. Excludes the element that caused the\npredicate function to fail. The predicate function is passed one argument:\n*(value)*.","signature":"(a -> Boolean) -> [a] -> [a]","example":" const isNotOne = x => x !== 1;\n\n R.takeLastWhile(isNotOne, [1, 2, 3, 4]); //=> [2, 3, 4]\n\n R.takeLastWhile(x => x !== 'R' , 'Ramda'); //=> 'amda'"}]},{"type":"list","action":"remove the last value","func":[{"name":"init","longname":"R.init","description":"Returns all but the last element of the given list or string.","signature":"[a] -> [a]","example":" R.init([1, 2, 3]); //=> [1, 2]\n R.init([1, 2]); //=> [1]\n R.init([1]); //=> []\n R.init([]); //=> []\n\n R.init('abc'); //=> 'ab'\n R.init('ab'); //=> 'a'\n R.init('a'); //=> ''\n R.init(''); //=> ''"}]},{"type":"list","action":"remove specific values","func":[{"name":"without","longname":"R.without","description":"Returns a new list without values in the first argument.\n[`R.equals`](#equals) is used to determine equality.\n\nActs as a transducer if a transformer is given in list position.","signature":"[a] -> [a] -> [a]","example":" R.without([1, 2], [1, 2, 1, 3, 4]); //=> [3, 4]"}]},{"type":"list","action":"remove values based on custom logic","func":[{"name":"reject","longname":"R.reject","description":"The complement of [`filter`](#filter).\n\nActs as a transducer if a transformer is given in list position. Filterable\nobjects include plain objects or any object that has a filter method such\nas `Array`.","signature":"Filterable f => (a -> Boolean) -> f a -> f a","example":" const isOdd = (n) => n % 2 === 1;\n\n R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4]\n\n R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}"}]},{"type":"list","action":"dedupe, remove all duplicates","func":[{"name":"uniq","longname":"R.uniq","description":"Returns a new list containing only one copy of each element in the original\nlist. [`R.equals`](#equals) is used to determine equality.","signature":"[a] -> [a]","example":" R.uniq([1, 1, 2, 1]); //=> [1, 2]\n R.uniq([1, '1']); //=> [1, '1']\n R.uniq([[42], [42]]); //=> [[42]]"}]},{"type":"list","action":"dedupe, remove all duplicates based on custom logic","func":[{"name":"uniqWith","longname":"R.uniqWith","description":"Returns a new list containing only one copy of each element in the original\nlist, based upon the value returned by applying the supplied predicate to\ntwo list elements. Prefers the first item if two items compare equal based\non the predicate.","signature":"((a, a) -> Boolean) -> [a] -> [a]","example":" const strEq = R.eqBy(String);\n R.uniqWith(strEq)([1, '1', 2, 1]); //=> [1, 2]\n R.uniqWith(strEq)([{}, {}]); //=> [{}]\n R.uniqWith(strEq)([1, '1', 1]); //=> [1]\n R.uniqWith(strEq)(['1', 1, 1]); //=> ['1']"}]},{"type":"list","action":"remove values based on index","func":[{"name":"remove","longname":"R.remove","description":"Removes the sub-list of `list` starting at index `start` and containing\n`count` elements. _Note that this is not destructive_: it returns a copy of\nthe list with the changes.\nNo lists have been harmed in the application of this function.","signature":"Number -> Number -> [a] -> [a]","example":" R.remove(2, 3, [1,2,3,4,5,6,7,8]); //=> [1,2,6,7,8]"}]},{"type":"list","action":"remove values from the start","func":[{"name":"drop","longname":"R.drop","description":"Returns all but the first `n` elements of the given list, string, or\ntransducer/transformer (or object with a `drop` method).\n\nDispatches to the `drop` method of the second argument, if present.","signature":"Number -> [a] -> [a]","example":" R.drop(1, ['foo', 'bar', 'baz']); //=> ['bar', 'baz']\n R.drop(2, ['foo', 'bar', 'baz']); //=> ['baz']\n R.drop(3, ['foo', 'bar', 'baz']); //=> []\n R.drop(4, ['foo', 'bar', 'baz']); //=> []\n R.drop(3, 'ramda'); //=> 'da'"}]},{"type":"list","action":"remove values from the start based on custom logic","func":[{"name":"dropWhile","longname":"R.dropWhile","description":"Returns a new list excluding the leading elements of a given list which\nsatisfy the supplied predicate function. It passes each value to the supplied\npredicate function, skipping elements while the predicate function returns\n`true`. The predicate function is applied to one argument: *(value)*.\n\nDispatches to the `dropWhile` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> [a]","example":" const lteTwo = x => x <= 2;\n\n R.dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=> [3, 4, 3, 2, 1]\n\n R.dropWhile(x => x !== 'd' , 'Ramda'); //=> 'da'"}]},{"type":"list","action":"remove values from the end","func":[{"name":"dropLast","longname":"R.dropLast","description":"Returns a list containing all but the last `n` elements of the given `list`.\n\nActs as a transducer if a transformer is given in list position.","signature":"Number -> [a] -> [a]","example":" R.dropLast(1, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']\n R.dropLast(2, ['foo', 'bar', 'baz']); //=> ['foo']\n R.dropLast(3, ['foo', 'bar', 'baz']); //=> []\n R.dropLast(4, ['foo', 'bar', 'baz']); //=> []\n R.dropLast(3, 'ramda'); //=> 'ra'"}]},{"type":"list","action":"remove values from the end based on custom logic","func":[{"name":"dropLastWhile","longname":"R.dropLastWhile","description":"Returns a new list excluding all the tailing elements of a given list which\nsatisfy the supplied predicate function. It passes each value from the right\nto the supplied predicate function, skipping elements until the predicate\nfunction returns a `falsy` value. The predicate function is applied to one argument:\n*(value)*.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> [a]","example":" const lteThree = x => x <= 3;\n\n R.dropLastWhile(lteThree, [1, 2, 3, 4, 3, 2, 1]); //=> [1, 2, 3, 4]\n\n R.dropLastWhile(x => x !== 'd' , 'Ramda'); //=> 'Ramd'"}]},{"type":"list","action":"compute the sum","func":[{"name":"sum","longname":"R.sum","description":"Adds together all the elements of a list.","signature":"[Number] -> Number","example":" R.sum([2,4,6,8,100,1]); //=> 121"}]},{"type":"list","action":"compute the product","func":[{"name":"product","longname":"R.product","description":"Multiplies together all the elements of a list.","signature":"[Number] -> Number","example":" R.product([2,4,6,8,100,1]); //=> 38400"}]},{"type":"list","action":"compute the average","func":[{"name":"mean","longname":"R.mean","description":"Returns the mean of the given list of numbers.","signature":"[Number] -> Number","example":" R.mean([2, 7, 9]); //=> 6\n R.mean([]); //=> NaN"}]},{"type":"list","action":"compute the median","func":[{"name":"median","longname":"R.median","description":"Returns the median of the given list of numbers.","signature":"[Number] -> Number","example":" R.median([2, 9, 7]); //=> 7\n R.median([7, 2, 10, 9]); //=> 8\n R.median([]); //=> NaN"}]},{"type":"list","action":"compute based on custom logic and only output the final value","func":[{"name":"reduce","longname":"R.reduce","description":"Returns a single item by iterating through the list, successively calling\nthe iterator function and passing it an accumulator value and the current\nvalue from the array, and then passing the result to the next call.\n\nThe iterator function receives two values: *(acc, value)*. It may use\n[`R.reduced`](#reduced) to shortcut the iteration.\n\nThe arguments' order of [`reduceRight`](#reduceRight)'s iterator function\nis *(value, acc)*.\n\nNote: `R.reduce` does not skip deleted or unassigned indices (sparse\narrays), unlike the native `Array.prototype.reduce` method. For more details\non this behavior, see:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce#Description\n\nDispatches to the `reduce` method of the third argument, if present. When\ndoing so, it is up to the user to handle the [`R.reduced`](#reduced)\nshortcuting, as this is not implemented by `reduce`.","signature":"((a, b) -> a) -> a -> [b] -> a","example":" R.reduce(R.subtract, 0, [1, 2, 3, 4]) // => ((((0 - 1) - 2) - 3) - 4) = -10\n // - -10\n // / \\ / \\\n // - 4 -6 4\n // / \\ / \\\n // - 3 ==> -3 3\n // / \\ / \\\n // - 2 -1 2\n // / \\ / \\\n // 0 1 0 1"},{"name":"reduceRight","longname":"R.reduceRight","description":"Returns a single item by iterating through the list, successively calling\nthe iterator function and passing it an accumulator value and the current\nvalue from the array, and then passing the result to the next call.\n\nSimilar to [`reduce`](#reduce), except moves through the input list from the\nright to the left.\n\nThe iterator function receives two values: *(value, acc)*, while the arguments'\norder of `reduce`'s iterator function is *(acc, value)*.\n\nNote: `R.reduceRight` does not skip deleted or unassigned indices (sparse\narrays), unlike the native `Array.prototype.reduceRight` method. For more details\non this behavior, see:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight#Description","signature":"((a, b) -> b) -> b -> [a] -> b","example":" R.reduceRight(R.subtract, 0, [1, 2, 3, 4]) // => (1 - (2 - (3 - (4 - 0)))) = -2\n // - -2\n // / \\ / \\\n // 1 - 1 3\n // / \\ / \\\n // 2 - ==> 2 -1\n // / \\ / \\\n // 3 - 3 4\n // / \\ / \\\n // 4 0 4 0"}]},{"type":"list","action":"compute based on custom logic and output the values as they are calculated","func":[{"name":"scan","longname":"R.scan","description":"Scan is similar to [`reduce`](#reduce), but returns a list of successively\nreduced values from the left","signature":"((a, b) -> a) -> a -> [b] -> [a]","example":" const numbers = [1, 2, 3, 4];\n const factorials = R.scan(R.multiply, 1, numbers); //=> [1, 1, 2, 6, 24]"}]},{"type":"list","action":"take the first value","func":[{"name":"head","longname":"R.head","description":"Returns the first element of the given list or string. In some libraries\nthis function is named `first`.","signature":"[a] -> a | Undefined","example":" R.head(['fi', 'fo', 'fum']); //=> 'fi'\n R.head([]); //=> undefined\n\n R.head('abc'); //=> 'a'\n R.head(''); //=> ''"}]},{"type":"list","action":"take the last value","func":[{"name":"last","longname":"R.last","description":"Returns the last element of the given list or string.","signature":"[a] -> a | Undefined","example":" R.last(['fi', 'fo', 'fum']); //=> 'fum'\n R.last([]); //=> undefined\n\n R.last('abc'); //=> 'c'\n R.last(''); //=> ''"}]},{"type":"list","action":"take a value from a specific index","func":[{"name":"nth","longname":"R.nth","description":"Returns the nth element of the given list or string. If n is negative the\nelement at index length + n is returned.","signature":"Number -> [a] -> a | Undefined","example":" const list = ['foo', 'bar', 'baz', 'quux'];\n R.nth(1, list); //=> 'bar'\n R.nth(-1, list); //=> 'quux'\n R.nth(-99, list); //=> undefined\n\n R.nth(2, 'abc'); //=> 'c'\n R.nth(3, 'abc'); //=> ''"}]},{"type":"list","action":"take the first occurrence of a value based on custom logic","func":[{"name":"find","longname":"R.find","description":"Returns the first element of the list which matches the predicate, or\n`undefined` if no element matches.\n\nDispatches to the `find` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> a | undefined","example":" const xs = [{a: 1}, {a: 2}, {a: 3}];\n R.find(R.propEq('a', 2))(xs); //=> {a: 2}\n R.find(R.propEq('a', 4))(xs); //=> undefined"}]},{"type":"list","action":"take the last occurrence of a value based on custom logic","func":[{"name":"findLast","longname":"R.findLast","description":"Returns the last element of the list which matches the predicate, or\n`undefined` if no element matches.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> a | undefined","example":" const xs = [{a: 1, b: 0}, {a:1, b: 1}];\n R.findLast(R.propEq('a', 1))(xs); //=> {a: 1, b: 1}\n R.findLast(R.propEq('a', 4))(xs); //=> undefined"}]},{"type":"list","action":"know if a specific value is present","func":[{"name":"contains"}]},{"type":"list","action":"know where the first occurrence of a value is","func":[{"name":"indexOf","longname":"R.indexOf","description":"Returns the position of the first occurrence of an item in an array, or -1\nif the item is not included in the array. [`R.equals`](#equals) is used to\ndetermine equality.","signature":"a -> [a] -> Number","example":" R.indexOf(3, [1,2,3,4]); //=> 2\n R.indexOf(10, [1,2,3,4]); //=> -1"}]},{"type":"list","action":"know where the first occurrence of a value is based on custom logic","func":[{"name":"findIndex","longname":"R.findIndex","description":"Returns the index of the first element of the list which matches the\npredicate, or `-1` if no element matches.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> Number","example":" const xs = [{a: 1}, {a: 2}, {a: 3}];\n R.findIndex(R.propEq('a', 2))(xs); //=> 1\n R.findIndex(R.propEq('a', 4))(xs); //=> -1"}]},{"type":"list","action":"know where the last occurrence of a value is","func":[{"name":"lastIndexOf","longname":"R.lastIndexOf","description":"Returns the position of the last occurrence of an item in an array, or -1 if\nthe item is not included in the array. [`R.equals`](#equals) is used to\ndetermine equality.","signature":"a -> [a] -> Number","example":" R.lastIndexOf(3, [-1,3,3,0,1,2,3,4]); //=> 6\n R.lastIndexOf(10, [1,2,3,4]); //=> -1"}]},{"type":"list","action":"know where the last occurrence of a value is based on custom logic","func":[{"name":"findLastIndex","longname":"R.findLastIndex","description":"Returns the index of the last element of the list which matches the\npredicate, or `-1` if no element matches.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> Number","example":" const xs = [{a: 1, b: 0}, {a:1, b: 1}];\n R.findLastIndex(R.propEq('a', 1))(xs); //=> 1\n R.findLastIndex(R.propEq('a', 4))(xs); //=> -1"}]},{"type":"list","action":"know if a condition is satisfied by all of the values","func":[{"name":"all","longname":"R.all","description":"Returns `true` if all elements of the list match the predicate, `false` if\nthere are any that don't.\n\nDispatches to the `all` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> Boolean","example":" const equals3 = R.equals(3);\n R.all(equals3)([3, 3, 3, 3]); //=> true\n R.all(equals3)([3, 3, 1, 3]); //=> false"}]},{"type":"list","action":"know if a condition is satisfied by any of the values","func":[{"name":"any","longname":"R.any","description":"Returns `true` if at least one of the elements of the list match the predicate,\n`false` otherwise.\n\nDispatches to the `any` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> Boolean","example":" const lessThan0 = R.flip(R.lt)(0);\n const lessThan2 = R.flip(R.lt)(2);\n R.any(lessThan0)([1, 2]); //=> false\n R.any(lessThan2)([1, 2]); //=> true"}]},{"type":"list","action":"know if a condition is satisfied by none of the values","func":[{"name":"none","longname":"R.none","description":"Returns `true` if no elements of the list match the predicate, `false`\notherwise.\n\nDispatches to the `all` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> Boolean) -> [a] -> Boolean","example":" const isEven = n => n % 2 === 0;\n const isOdd = n => n % 2 === 1;\n\n R.none(isEven, [1, 3, 5, 7, 9, 11]); //=> true\n R.none(isOdd, [1, 3, 5, 7, 8, 11]); //=> false"}]},{"type":"list","action":"replace a value at a specific index","func":[{"name":"update","longname":"R.update","description":"Returns a new copy of the array with the element at the provided index\nreplaced with the given value.","signature":"Number -> a -> [a] -> [a]","example":" R.update(1, '_', ['a', 'b', 'c']); //=> ['a', '_', 'c']\n R.update(-1, '_', ['a', 'b', 'c']); //=> ['a', 'b', '_']"}]},{"type":"list","action":"replace a value at a specific index based on custom logic","func":[{"name":"adjust","longname":"R.adjust","description":"Applies a function to the value at the given index of an array, returning a\nnew copy of the array with the element at the given index replaced with the\nresult of the function application.","signature":"Number -> (a -> a) -> [a] -> [a]","example":" R.adjust(1, R.toUpper, ['a', 'b', 'c', 'd']); //=> ['a', 'B', 'c', 'd']\n R.adjust(-1, R.toUpper, ['a', 'b', 'c', 'd']); //=> ['a', 'b', 'c', 'D']"},{"name":"lensPath","longname":"R.lensPath","description":"Returns a lens whose focus is the specified path.","signature":"[Idx] -> Lens s a","example":" const xHeadYLens = R.lensPath(['x', 0, 'y']);\n\n R.view(xHeadYLens, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\n //=> 2\n R.set(xHeadYLens, 1, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\n //=> {x: [{y: 1, z: 3}, {y: 4, z: 5}]}\n R.over(xHeadYLens, R.negate, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\n //=> {x: [{y: -2, z: 3}, {y: 4, z: 5}]}"}]},{"type":"list","action":"add a value at the start","func":[{"name":"prepend","longname":"R.prepend","description":"Returns a new list with the given element at the front, followed by the\ncontents of the list.","signature":"a -> [a] -> [a]","example":" R.prepend('fee', ['fi', 'fo', 'fum']); //=> ['fee', 'fi', 'fo', 'fum']"}]},{"type":"list","action":"add a value at the end","func":[{"name":"append","longname":"R.append","description":"Returns a new list containing the contents of the given list, followed by\nthe given element.","signature":"a -> [a] -> [a]","example":" R.append('tests', ['write', 'more']); //=> ['write', 'more', 'tests']\n R.append('tests', []); //=> ['tests']\n R.append(['tests'], ['write', 'more']); //=> ['write', 'more', ['tests']]"}]},{"type":"list","action":"add a value at a specific index","func":[{"name":"insert","longname":"R.insert","description":"Inserts the supplied element into the list, at the specified `index`. _Note that\nthis is not destructive_: it returns a copy of the list with the changes.\nNo lists have been harmed in the application of this function.","signature":"Number -> a -> [a] -> [a]","example":" R.insert(2, 'x', [1,2,3,4]); //=> [1,2,'x',3,4]"}]},{"type":"list","action":"add multiple values at a specific index","func":[{"name":"insertAll","longname":"R.insertAll","description":"Inserts the sub-list into the list, at the specified `index`. _Note that this is not\ndestructive_: it returns a copy of the list with the changes.\nNo lists have been harmed in the application of this function.","signature":"Number -> [a] -> [a] -> [a]","example":" R.insertAll(2, ['x','y','z'], [1,2,3,4]); //=> [1,2,'x','y','z',3,4]"}]},{"type":"list","action":"group values based on custom logic","func":[{"name":"groupBy","longname":"R.groupBy","description":"Splits a list into sub-lists stored in an object, based on the result of\ncalling a String-returning function on each element, and grouping the\nresults according to values returned.\n\nDispatches to the `groupBy` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> String) -> [a] -> {String: [a]}","example":" const byGrade = R.groupBy(function(student) {\n const score = student.score;\n return score < 65 ? 'F' :\n score < 70 ? 'D' :\n score < 80 ? 'C' :\n score < 90 ? 'B' : 'A';\n });\n const students = [{name: 'Abby', score: 84},\n {name: 'Eddy', score: 58},\n // ...\n {name: 'Jack', score: 69}];\n byGrade(students);\n // {\n // 'A': [{name: 'Dianne', score: 99}],\n // 'B': [{name: 'Abby', score: 84}]\n // // ...,\n // 'F': [{name: 'Eddy', score: 58}]\n // }"}]},{"type":"list","action":"know how many values it contains","func":[{"name":"length","longname":"R.length","description":"Returns the number of elements in the array by returning `list.length`.","signature":"[a] -> Number","example":" R.length([]); //=> 0\n R.length([1, 2, 3]); //=> 3"}]},{"type":"list","action":"get a specific range of integer values","func":[{"name":"range","longname":"R.range","description":"Returns a list of numbers from `from` (inclusive) to `to` (exclusive).","signature":"Number -> Number -> [Number]","example":" R.range(1, 5); //=> [1, 2, 3, 4]\n R.range(50, 53); //=> [50, 51, 52]"}]},{"type":"list","action":"split at a specific index","func":[{"name":"splitAt","longname":"R.splitAt","description":"Splits a given list or string at a given index.","signature":"Number -> [a] -> [[a], [a]]","example":" R.splitAt(1, [1, 2, 3]); //=> [[1], [2, 3]]\n R.splitAt(5, 'hello world'); //=> ['hello', ' world']\n R.splitAt(-1, 'foobar'); //=> ['fooba', 'r']"}]},{"type":"list","action":"split based on custom logic","func":[{"name":"splitWhen","longname":"R.splitWhen","description":"Takes a list and a predicate and returns a pair of lists with the following properties:\n\n - the result of concatenating the two output lists is equivalent to the input list;\n - none of the elements of the first output list satisfies the predicate; and\n - if the second output list is non-empty, its first element satisfies the predicate.","signature":"(a -> Boolean) -> [a] -> [[a], [a]]","example":" R.splitWhen(R.equals(2), [1, 2, 3, 1, 2, 3]); //=> [[1], [2, 3, 1, 2, 3]]"}]},{"type":"list","action":"split into chunks of a specific length","func":[{"name":"splitEvery","longname":"R.splitEvery","description":"Splits a collection into slices of the specified length.","signature":"Number -> [a] -> [[a]]","example":" R.splitEvery(3, [1, 2, 3, 4, 5, 6, 7]); //=> [[1, 2, 3], [4, 5, 6], [7]]\n R.splitEvery(3, 'foobarbaz'); //=> ['foo', 'bar', 'baz']"}]},{"type":"list","action":"reverse","func":[{"name":"reverse","longname":"R.reverse","description":"Returns a new list or string with the elements or characters in reverse\norder.","signature":"[a] -> [a]","example":" R.reverse([1, 2, 3]); //=> [3, 2, 1]\n R.reverse([1, 2]); //=> [2, 1]\n R.reverse([1]); //=> [1]\n R.reverse([]); //=> []\n\n R.reverse('abc'); //=> 'cba'\n R.reverse('ab'); //=> 'ba'\n R.reverse('a'); //=> 'a'\n R.reverse(''); //=> ''"}]},{"type":"list","action":"sort","func":[{"name":"sort","longname":"R.sort","description":"Returns a copy of the list, sorted according to the comparator function,\nwhich should accept two values at a time and return a negative number if the\nfirst value is smaller, a positive number if it's larger, and zero if they\nare equal. Please note that this is a **copy** of the list. It does not\nmodify the original.","signature":"((a, a) -> Number) -> [a] -> [a]","example":" const diff = function(a, b) { return a - b; };\n R.sort(diff, [4,2,7,5]); //=> [2, 4, 5, 7]"}]},{"type":"list","action":"sort based on custom logic","func":[{"name":"sortBy","longname":"R.sortBy","description":"Sorts the list according to the supplied function.","signature":"Ord b => (a -> b) -> [a] -> [a]","example":" const sortByFirstItem = R.sortBy(R.prop(0));\n const pairs = [[-1, 1], [-2, 2], [-3, 3]];\n sortByFirstItem(pairs); //=> [[-3, 3], [-2, 2], [-1, 1]]\n\n const sortByNameCaseInsensitive = R.sortBy(R.compose(R.toLower, R.prop('name')));\n const alice = {\n name: 'ALICE',\n age: 101\n };\n const bob = {\n name: 'Bob',\n age: -10\n };\n const clara = {\n name: 'clara',\n age: 314.159\n };\n const people = [clara, bob, alice];\n sortByNameCaseInsensitive(people); //=> [alice, bob, clara]"}]},{"type":"list","action":"concatenate two lists","func":[{"name":"concat","longname":"R.concat","description":"Returns the result of concatenating the given lists or strings.\n\nNote: `R.concat` expects both arguments to be of the same type,\nunlike the native `Array.prototype.concat` method. It will throw\nan error if you `concat` an Array with a non-Array value.\n\nDispatches to the `concat` method of the first argument, if present.\nCan also concatenate two members of a [fantasy-land\ncompatible semigroup](https://github.com/fantasyland/fantasy-land#semigroup).","signature":"[a] -> [a] -> [a]","example":" R.concat('ABC', 'DEF'); // 'ABCDEF'\n R.concat([4, 5, 6], [1, 2, 3]); //=> [4, 5, 6, 1, 2, 3]\n R.concat([], []); //=> []"}]},{"type":"list","action":"find the common values in two lists","func":[{"name":"intersection","longname":"R.intersection","description":"Combines two lists into a set (i.e. no duplicates) composed of those\nelements common to both lists.","signature":"[*] -> [*] -> [*]","example":" R.intersection([1,2,3,4], [7,6,5,4,3]); //=> [4, 3]"}]},{"type":"list","action":"find the common values in two lists based on custom logic","func":[{"name":"intersectionWith"}]},{"type":"list","action":"find the distinct values compared to another list","func":[{"name":"difference","longname":"R.difference","description":"Finds the set (i.e. no duplicates) of all elements in the first list not\ncontained in the second list. Objects and Arrays are compared in terms of\nvalue equality, not reference equality.","signature":"[*] -> [*] -> [*]","example":" R.difference([1,2,3,4], [7,6,5,4,3]); //=> [1,2]\n R.difference([7,6,5,4,3], [1,2,3,4]); //=> [7,6,5]\n R.difference([{a: 1}, {b: 2}], [{a: 1}, {c: 3}]) //=> [{b: 2}]"}]},{"type":"list","action":"find the distinct values compared to another list based on custom logic","func":[{"name":"differenceWith","longname":"R.differenceWith","description":"Finds the set (i.e. no duplicates) of all elements in the first list not\ncontained in the second list. Duplication is determined according to the\nvalue returned by applying the supplied predicate to two list elements.","signature":"((a, a) -> Boolean) -> [a] -> [a] -> [a]","example":" const cmp = (x, y) => x.a === y.a;\n const l1 = [{a: 1}, {a: 2}, {a: 3}];\n const l2 = [{a: 3}, {a: 4}];\n R.differenceWith(cmp, l1, l2); //=> [{a: 1}, {a: 2}]"}]},{"type":"list","action":"combine two lists into a list of unique values","func":[{"name":"union","longname":"R.union","description":"Combines two lists into a set (i.e. no duplicates) composed of the elements\nof each list.","signature":"[*] -> [*] -> [*]","example":" R.union([1, 2, 3], [2, 3, 4]); //=> [1, 2, 3, 4]"}]},{"type":"list","action":"combine two lists into a list of unique values based on custom logic","func":[{"name":"unionWith","longname":"R.unionWith","description":"Combines two lists into a set (i.e. no duplicates) composed of the elements\nof each list. Duplication is determined according to the value returned by\napplying the supplied predicate to two list elements.","signature":"((a, a) -> Boolean) -> [*] -> [*] -> [*]","example":" const l1 = [{a: 1}, {a: 2}];\n const l2 = [{a: 1}, {a: 4}];\n R.unionWith(R.eqBy(R.prop('a')), l1, l2); //=> [{a: 1}, {a: 2}, {a: 4}]"}]},{"type":"list","action":"combine two lists into a list of pairs","func":[{"name":"zip","longname":"R.zip","description":"Creates a new list out of the two supplied by pairing up equally-positioned\nitems from both lists. The returned list is truncated to the length of the\nshorter of the two input lists.\nNote: `zip` is equivalent to `zipWith(function(a, b) { return [a, b] })`.","signature":"[a] -> [b] -> [[a,b]]","example":" R.zip([1, 2, 3], ['a', 'b', 'c']); //=> [[1, 'a'], [2, 'b'], [3, 'c']]"}]},{"type":"list","action":"combine two lists into a list of pairs based on custom logic","func":[{"name":"zipWith","longname":"R.zipWith","description":"Creates a new list out of the two supplied by applying the function to each\nequally-positioned pair in the lists. The returned list is truncated to the\nlength of the shorter of the two input lists.","signature":"((a, b) -> c) -> [a] -> [b] -> [c]","example":" const f = (x, y) => {\n // ...\n };\n R.zipWith(f, [1, 2, 3], ['a', 'b', 'c']);\n //=> [f(1, 'a'), f(2, 'b'), f(3, 'c')]"}]},{"type":"list","action":"convert list of objects into one object","func":[{"name":"indexBy","longname":"R.indexBy","description":"Given a function that generates a key, turns a list of objects into an\nobject indexing the objects by the given key. Note that if multiple\nobjects generate the same value for the indexing key only the last value\nwill be included in the generated object.\n\nActs as a transducer if a transformer is given in list position.","signature":"(a -> String) -> [{k: v}] -> {k: {k: v}}","example":" const list = [{id: 'xyz', title: 'A'}, {id: 'abc', title: 'B'}];\n R.indexBy(R.prop('id'), list);\n //=> {abc: {id: 'abc', title: 'B'}, xyz: {id: 'xyz', title: 'A'}}"}]},{"type":"list","action":"split a list into two sub lists based on a single predicate function","func":[{"name":"partition","longname":"R.partition","description":"Takes a predicate and a list or other `Filterable` object and returns the\npair of filterable objects of the same type of elements which do and do not\nsatisfy, the predicate, respectively. Filterable objects include plain objects or any object\nthat has a filter method such as `Array`.","signature":"Filterable f => (a -> Boolean) -> f a -> [f a, f a]","example":" R.partition(R.includes('s'), ['sss', 'ttt', 'foo', 'bars']);\n // => [ [ 'sss', 'bars' ], [ 'ttt', 'foo' ] ]\n\n R.partition(R.includes('s'), { a: 'sss', b: 'ttt', foo: 'bars' });\n // => [ { a: 'sss', foo: 'bars' }, { b: 'ttt' } ]"}]},{"type":"object","action":"change every value","func":[{"name":"mapObjIndexed","longname":"R.mapObjIndexed","description":"An Object-specific version of [`map`](#map). The function is applied to three\narguments: *(value, key, obj)*. If only the value is significant, use\n[`map`](#map) instead.","signature":"((*, String, Object) -> *) -> Object -> Object","example":" const xyz = { x: 1, y: 2, z: 3 };\n const prependKeyAndDouble = (num, key, obj) => key + (num * 2);\n\n R.mapObjIndexed(prependKeyAndDouble, xyz); //=> { x: 'x2', y: 'y4', z: 'z6' }"},{"name":"map","longname":"R.map","description":"Takes a function and\na [functor](https://github.com/fantasyland/fantasy-land#functor),\napplies the function to each of the functor's values, and returns\na functor of the same shape.\n\nRamda provides suitable `map` implementations for `Array` and `Object`,\nso this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.\n\nDispatches to the `map` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.\n\nAlso treats functions as functors and will compose them together.","signature":"Functor f => (a -> b) -> f a -> f b","example":" const double = x => x * 2;\n\n R.map(double, [1, 2, 3]); //=> [2, 4, 6]\n\n R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}"}]},{"type":"object","action":"select a specific key's value","func":[{"name":"prop","longname":"R.prop","description":"Returns a function that when supplied an object returns the indicated\nproperty of that object, if it exists.","signature":"s -> {s: a} -> a | Undefined","example":" R.prop('x', {x: 100}); //=> 100\n R.prop('x', {}); //=> undefined\n R.compose(R.inc, R.prop('x'))({ x: 3 }) //=> 4"},{"name":"path","longname":"R.path","description":"Retrieve the value at a given path.","signature":"[Idx] -> {a} -> a | Undefined","example":" R.path(['a', 'b'], {a: {b: 2}}); //=> 2\n R.path(['a', 'b'], {c: {b: 2}}); //=> undefined"}]},{"type":"object","action":"select a specific key's value or return a default if it is not found","func":[{"name":"propOr","longname":"R.propOr","description":"If the given, non-null object has an own property with the specified name,\nreturns the value of that property. Otherwise returns the provided default\nvalue.","signature":"a -> String -> Object -> a","example":" const alice = {\n name: 'ALICE',\n age: 101\n };\n const favorite = R.prop('favoriteLibrary');\n const favoriteWithDefault = R.propOr('Ramda', 'favoriteLibrary');\n\n favorite(alice); //=> undefined\n favoriteWithDefault(alice); //=> 'Ramda'"},{"name":"pathOr","longname":"R.pathOr","description":"If the given, non-null object has a value at the given path, returns the\nvalue at that path. Otherwise returns the provided default value.","signature":"a -> [Idx] -> {a} -> a","example":" R.pathOr('N/A', ['a', 'b'], {a: {b: 2}}); //=> 2\n R.pathOr('N/A', ['a', 'b'], {c: {b: 2}}); //=> \"N/A\""}]},{"type":"object","action":"select specific keys' values","func":[{"name":"props","longname":"R.props","description":"Acts as multiple `prop`: array of keys in, array of values out. Preserves\norder.","signature":"[k] -> {k: v} -> [v]","example":" R.props(['x', 'y'], {x: 1, y: 2}); //=> [1, 2]\n R.props(['c', 'a', 'b'], {b: 2, a: 1}); //=> [undefined, 1, 2]\n\n const fullName = R.compose(R.join(' '), R.props(['first', 'last']));\n fullName({last: 'Bullet-Tooth', age: 33, first: 'Tony'}); //=> 'Tony Bullet-Tooth'"}]},{"type":"object","action":"select specific keys","func":[{"name":"pick","longname":"R.pick","description":"Returns a partial copy of an object containing only the keys specified. If\nthe key does not exist, the property is ignored.","signature":"[k] -> {k: v} -> {k: v}","example":" R.pick(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4}\n R.pick(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1}"},{"name":"pickAll","longname":"R.pickAll","description":"Similar to `pick` except that this one includes a `key: undefined` pair for\nproperties that don't exist.","signature":"[k] -> {k: v} -> {k: v}","example":" R.pickAll(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, d: 4}\n R.pickAll(['a', 'e', 'f'], {a: 1, b: 2, c: 3, d: 4}); //=> {a: 1, e: undefined, f: undefined}"}]},{"type":"object","action":"select keys based on custom logic","func":[{"name":"filter","longname":"R.filter","description":"Takes a predicate and a `Filterable`, and returns a new filterable of the\nsame type containing the members of the given filterable which satisfy the\ngiven predicate. Filterable objects include plain objects or any object\nthat has a filter method such as `Array`.\n\nDispatches to the `filter` method of the second argument, if present.\n\nActs as a transducer if a transformer is given in list position.","signature":"Filterable f => (a -> Boolean) -> f a -> f a","example":" const isEven = n => n % 2 === 0;\n\n R.filter(isEven, [1, 2, 3, 4]); //=> [2, 4]\n\n R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}"},{"name":"pickBy","longname":"R.pickBy","description":"Returns a partial copy of an object containing only the keys that satisfy\nthe supplied predicate.","signature":"((v, k) -> Boolean) -> {k: v} -> {k: v}","example":" const isUpperCase = (val, key) => key.toUpperCase() === key;\n R.pickBy(isUpperCase, {a: 1, b: 2, A: 3, B: 4}); //=> {A: 3, B: 4}"}]},{"type":"object","action":"remove a specific key","func":[{"name":"dissoc","longname":"R.dissoc","description":"Returns a new object that does not contain a `prop` property.","signature":"String -> {k: v} -> {k: v}","example":" R.dissoc('b', {a: 1, b: 2, c: 3}); //=> {a: 1, c: 3}"},{"name":"dissocPath","longname":"R.dissocPath","description":"Makes a shallow clone of an object, omitting the property at the given path.\nNote that this copies and flattens prototype properties onto the new object\nas well. All non-primitive properties are copied by reference.","signature":"[Idx] -> {k: v} -> {k: v}","example":" R.dissocPath(['a', 'b', 'c'], {a: {b: {c: 42}}}); //=> {a: {b: {}}}"}]},{"type":"object","action":"remove specific keys","func":[{"name":"omit","longname":"R.omit","description":"Returns a partial copy of an object omitting the keys specified.","signature":"[String] -> {String: *} -> {String: *}","example":" R.omit(['a', 'd'], {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, c: 3}"}]},{"type":"object","action":"remove specific keys based on custom logic","func":[{"name":"reject","longname":"R.reject","description":"The complement of [`filter`](#filter).\n\nActs as a transducer if a transformer is given in list position. Filterable\nobjects include plain objects or any object that has a filter method such\nas `Array`.","signature":"Filterable f => (a -> Boolean) -> f a -> f a","example":" const isOdd = (n) => n % 2 === 1;\n\n R.reject(isOdd, [1, 2, 3, 4]); //=> [2, 4]\n\n R.reject(isOdd, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}"}]},{"type":"object","action":"add a specific key and value","func":[{"name":"assoc","longname":"R.assoc","description":"Makes a shallow clone of an object, setting or overriding the specified\nproperty with the given value. Note that this copies and flattens prototype\nproperties onto the new object as well. All non-primitive properties are\ncopied by reference.","signature":"String -> a -> {k: v} -> {k: v}","example":" R.assoc('c', 3, {a: 1, b: 2}); //=> {a: 1, b: 2, c: 3}"},{"name":"assocPath","longname":"R.assocPath","description":"Makes a shallow clone of an object, setting or overriding the nodes required\nto create the given path, and placing the specific value at the tail end of\nthat path. Note that this copies and flattens prototype properties onto the\nnew object as well. All non-primitive properties are copied by reference.","signature":"[Idx] -> a -> {a} -> {a}","example":" R.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}}\n\n // Any missing or non-object keys in path will be overridden\n R.assocPath(['a', 'b', 'c'], 42, {a: 5}); //=> {a: {b: {c: 42}}}"}]},{"type":"object","action":"replace a specific value based on custom logic","func":[{"name":"lens","longname":"R.lens","description":"Returns a lens for the given getter and setter functions. The getter \"gets\"\nthe value of the focus; the setter \"sets\" the value of the focus. The setter\nshould not mutate the data structure.","signature":"(s -> a) -> ((a, s) -> s) -> Lens s a","example":" const xLens = R.lens(R.prop('x'), R.assoc('x'));\n\n R.view(xLens, {x: 1, y: 2}); //=> 1\n R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2}\n R.over(xLens, R.negate, {x: 1, y: 2}); //=> {x: -1, y: 2}"},{"name":"lensProp","longname":"R.lensProp","description":"Returns a lens whose focus is the specified property.","signature":"String -> Lens s a","example":" const xLens = R.lensProp('x');\n\n R.view(xLens, {x: 1, y: 2}); //=> 1\n R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2}\n R.over(xLens, R.negate, {x: 1, y: 2}); //=> {x: -1, y: 2}"},{"name":"lensPath","longname":"R.lensPath","description":"Returns a lens whose focus is the specified path.","signature":"[Idx] -> Lens s a","example":" const xHeadYLens = R.lensPath(['x', 0, 'y']);\n\n R.view(xHeadYLens, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\n //=> 2\n R.set(xHeadYLens, 1, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\n //=> {x: [{y: 1, z: 3}, {y: 4, z: 5}]}\n R.over(xHeadYLens, R.negate, {x: [{y: 2, z: 3}, {y: 4, z: 5}]});\n //=> {x: [{y: -2, z: 3}, {y: 4, z: 5}]}"}]},{"type":"object","action":"replace specific values based on custom logic","func":[{"name":"evolve","longname":"R.evolve","description":"Creates a new object by recursively evolving a shallow copy of `object`,\naccording to the `transformation` functions. All non-primitive properties\nare copied by reference.\n\nA `transformation` function will not be invoked if its corresponding key\ndoes not exist in the evolved object.","signature":"{k: (v -> v)} -> {k: v} -> {k: v}","example":" const tomato = {firstName: ' Tomato ', data: {elapsed: 100, remaining: 1400}, id:123};\n const transformations = {\n firstName: R.trim,\n lastName: R.trim, // Will not get invoked.\n data: {elapsed: R.add(1), remaining: R.add(-1)}\n };\n R.evolve(transformations, tomato); //=> {firstName: 'Tomato', data: {elapsed: 101, remaining: 1399}, id:123}"}]},{"type":"object","action":"know if a specific key is present","func":[{"name":"has","longname":"R.has","description":"Returns whether or not an object has an own property with the specified name","signature":"s -> {s: x} -> Boolean","example":" const hasName = R.has('name');\n hasName({name: 'alice'}); //=> true\n hasName({name: 'bob'}); //=> true\n hasName({}); //=> false\n\n const point = {x: 0, y: 0};\n const pointHas = R.has(R.__, point);\n pointHas('x'); //=> true\n pointHas('y'); //=> true\n pointHas('z'); //=> false"},{"name":"hasIn","longname":"R.hasIn","description":"Returns whether or not an object or its prototype chain has a property with\nthe specified name","signature":"s -> {s: x} -> Boolean","example":" function Rectangle(width, height) {\n this.width = width;\n this.height = height;\n }\n Rectangle.prototype.area = function() {\n return this.width * this.height;\n };\n\n const square = new Rectangle(2, 2);\n R.hasIn('width', square); //=> true\n R.hasIn('area', square); //=> true"}]},{"type":"object","action":"know if a specific key has a specific value","func":[{"name":"propEq","longname":"R.propEq","description":"Returns `true` if the specified object property is equal, in\n[`R.equals`](#equals) terms, to the given value; `false` otherwise.\nYou can test multiple properties with [`R.whereEq`](#whereEq).","signature":"String -> a -> Object -> Boolean","example":" const abby = {name: 'Abby', age: 7, hair: 'blond'};\n const fred = {name: 'Fred', age: 12, hair: 'brown'};\n const rusty = {name: 'Rusty', age: 10, hair: 'brown'};\n const alois = {name: 'Alois', age: 15, disposition: 'surly'};\n const kids = [abby, fred, rusty, alois];\n const hasBrownHair = R.propEq('hair', 'brown');\n R.filter(hasBrownHair, kids); //=> [fred, rusty]"},{"name":"pathEq","longname":"R.pathEq","description":"Determines whether a nested path on an object has a specific value, in\n[`R.equals`](#equals) terms. Most likely used to filter a list.","signature":"[Idx] -> a -> {a} -> Boolean","example":" const user1 = { address: { zipCode: 90210 } };\n const user2 = { address: { zipCode: 55555 } };\n const user3 = { name: 'Bob' };\n const users = [ user1, user2, user3 ];\n const isFamous = R.pathEq(['address', 'zipCode'], 90210);\n R.filter(isFamous, users); //=> [ user1 ]"}]},{"type":"object","action":"know if a specific key's value satisfies a custom predicate","func":[{"name":"propSatisfies","longname":"R.propSatisfies","description":"Returns `true` if the specified object property satisfies the given\npredicate; `false` otherwise. You can test multiple properties with\n[`R.where`](#where).","signature":"(a -> Boolean) -> String -> {String: a} -> Boolean","example":" R.propSatisfies(x => x > 0, 'x', {x: 1, y: 2}); //=> true"},{"name":"pathSatisfies","longname":"R.pathSatisfies","description":"Returns `true` if the specified object property at given path satisfies the\ngiven predicate; `false` otherwise.","signature":"(a -> Boolean) -> [Idx] -> {a} -> Boolean","example":" R.pathSatisfies(y => y > 0, ['x', 'y'], {x: {y: 2}}); //=> true"}]},{"type":"object","action":"know if specific keys have specific values","func":[{"name":"whereEq","longname":"R.whereEq","description":"Takes a spec object and a test object; returns true if the test satisfies\nthe spec, false otherwise. An object satisfies the spec if, for each of the\nspec's own properties, accessing that property of the object gives the same\nvalue (in [`R.equals`](#equals) terms) as accessing that property of the\nspec.\n\n`whereEq` is a specialization of [`where`](#where).","signature":"{String: *} -> {String: *} -> Boolean","example":" // pred :: Object -> Boolean\n const pred = R.whereEq({a: 1, b: 2});\n\n pred({a: 1}); //=> false\n pred({a: 1, b: 2}); //=> true\n pred({a: 1, b: 2, c: 3}); //=> true\n pred({a: 1, b: 1}); //=> false"}]},{"type":"object","action":"know if specific keys' values satisfy custom predicates","func":[{"name":"where","longname":"R.where","description":"Takes a spec object and a test object; returns true if the test satisfies\nthe spec. Each of the spec's own properties must be a predicate function.\nEach predicate is applied to the value of the corresponding property of the\ntest object. `where` returns true if all the predicates return true, false\notherwise.\n\n`where` is well suited to declaratively expressing constraints for other\nfunctions such as [`filter`](#filter) and [`find`](#find).","signature":"{String: (* -> Boolean)} -> {String: *} -> Boolean","example":" // pred :: Object -> Boolean\n const pred = R.where({\n a: R.equals('foo'),\n b: R.complement(R.equals('bar')),\n x: R.gt(R.__, 10),\n y: R.lt(R.__, 20)\n });\n\n pred({a: 'foo', b: 'xxx', x: 11, y: 19}); //=> true\n pred({a: 'xxx', b: 'xxx', x: 11, y: 19}); //=> false\n pred({a: 'foo', b: 'bar', x: 11, y: 19}); //=> false\n pred({a: 'foo', b: 'xxx', x: 10, y: 19}); //=> false\n pred({a: 'foo', b: 'xxx', x: 11, y: 20}); //=> false"}]},{"type":"object","action":"list all the keys","func":[{"name":"keys","longname":"R.keys","description":"Returns a list containing the names of all the enumerable own properties of\nthe supplied object.\nNote that the order of the output array is not guaranteed to be consistent\nacross different JS platforms.","signature":"{k: v} -> [k]","example":" R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']"},{"name":"keysIn","longname":"R.keysIn","description":"Returns a list containing the names of all the properties of the supplied\nobject, including prototype properties.\nNote that the order of the output array is not guaranteed to be consistent\nacross different JS platforms.","signature":"{k: v} -> [k]","example":" const F = function() { this.x = 'X'; };\n F.prototype.y = 'Y';\n const f = new F();\n R.keysIn(f); //=> ['x', 'y']"}]},{"type":"object","action":"list all the values","func":[{"name":"values","longname":"R.values","description":"Returns a list of all the enumerable own properties of the supplied object.\nNote that the order of the output array is not guaranteed across different\nJS platforms.","signature":"{k: v} -> [v]","example":" R.values({a: 1, b: 2, c: 3}); //=> [1, 2, 3]"},{"name":"valuesIn","longname":"R.valuesIn","description":"Returns a list of all the properties, including prototype properties, of the\nsupplied object.\nNote that the order of the output array is not guaranteed to be consistent\nacross different JS platforms.","signature":"{k: v} -> [v]","example":" const F = function() { this.x = 'X'; };\n F.prototype.y = 'Y';\n const f = new F();\n R.valuesIn(f); //=> ['X', 'Y']"}]},{"type":"object","action":"convert to a list of pairs","func":[{"name":"toPairs","longname":"R.toPairs","description":"Converts an object into an array of key, value arrays. Only the object's\nown properties are used.\nNote that the order of the output array is not guaranteed to be consistent\nacross different JS platforms.","signature":"{String: *} -> [[String,*]]","example":" R.toPairs({a: 1, b: 2, c: 3}); //=> [['a', 1], ['b', 2], ['c', 3]]"},{"name":"toPairsIn","longname":"R.toPairsIn","description":"Converts an object into an array of key, value arrays. The object's own\nproperties and prototype properties are used. Note that the order of the\noutput array is not guaranteed to be consistent across different JS\nplatforms.","signature":"{String: *} -> [[String,*]]","example":" const F = function() { this.x = 'X'; };\n F.prototype.y = 'Y';\n const f = new F();\n R.toPairsIn(f); //=> [['x','X'], ['y','Y']]"}]},{"type":"object","action":"know if two objects share the same key and value","func":[{"name":"eqProps","longname":"R.eqProps","description":"Reports whether two objects have the same value, in [`R.equals`](#equals)\nterms, for the specified property. Useful as a curried predicate.","signature":"k -> {k: v} -> {k: v} -> Boolean","example":" const o1 = { a: 1, b: 2, c: 3, d: 4 };\n const o2 = { a: 10, b: 20, c: 3, d: 40 };\n R.eqProps('a', o1, o2); //=> false\n R.eqProps('c', o1, o2); //=> true"}]},{"type":"object","action":"create an object with a single key and value","func":[{"name":"objOf","longname":"R.objOf","description":"Creates an object containing a single key:value pair.","signature":"String -> a -> {String:a}","example":" const matchPhrases = R.compose(\n R.objOf('must'),\n R.map(R.objOf('match_phrase'))\n );\n matchPhrases(['foo', 'bar', 'baz']); //=> {must: [{match_phrase: 'foo'}, {match_phrase: 'bar'}, {match_phrase: 'baz'}]}"}]},{"type":"object","action":"create an object with multiple keys and values","func":[{"name":"zipObj","longname":"R.zipObj","description":"Creates a new object out of a list of keys and a list of values.\nKey/value pairing is truncated to the length of the shorter of the two lists.\nNote: `zipObj` is equivalent to `pipe(zip, fromPairs)`.","signature":"[String] -> [*] -> {String: *}","example":" R.zipObj(['a', 'b', 'c'], [1, 2, 3]); //=> {a: 1, b: 2, c: 3}"}]},{"type":"object","action":"clone an object","func":[{"name":"clone","longname":"R.clone","description":"Creates a deep copy of the value which may contain (nested) `Array`s and\n`Object`s, `Number`s, `String`s, `Boolean`s and `Date`s. `Function`s are\nassigned by reference rather than copied\n\nDispatches to a `clone` method if present.","signature":"{*} -> {*}","example":" const objects = [{}, {}, {}];\n const objectsClone = R.clone(objects);\n objects === objectsClone; //=> false\n objects[0] === objectsClone[0]; //=> false"}]},{"type":"object","action":"merge two objects into one object","func":[{"name":"merge","longname":"R.merge","description":"Create a new object with the own properties of the first object merged with\nthe own properties of the second object. If a key exists in both objects,\nthe value from the second object will be used.","signature":"{k: v} -> {k: v} -> {k: v}","example":" R.merge({ 'name': 'fred', 'age': 10 }, { 'age': 40 });\n //=> { 'name': 'fred', 'age': 40 }\n\n const withDefaults = R.merge({x: 0, y: 0});\n withDefaults({y: 2}); //=> {x: 0, y: 2}"}]},{"type":"object","action":"merge two objects into one object based on custom duplicate key logic","func":[{"name":"mergeWith","longname":"R.mergeWith","description":"Creates a new object with the own properties of the two provided objects. If\na key exists in both objects, the provided function is applied to the values\nassociated with the key in each object, with the result being used as the\nvalue associated with the key in the returned object.","signature":"((a, a) -> a) -> {a} -> {a} -> {a}","example":" R.mergeWith(R.concat,\n { a: true, values: [10, 20] },\n { b: true, values: [15, 35] });\n //=> { a: true, b: true, values: [10, 20, 15, 35] }"}]},{"type":"object","action":"merge more than two objects into one object","func":[{"name":"mergeAll","longname":"R.mergeAll","description":"Merges a list of objects together into one object.","signature":"[{k: v}] -> {k: v}","example":" R.mergeAll([{foo:1},{bar:2},{baz:3}]); //=> {foo:1,bar:2,baz:3}\n R.mergeAll([{foo:1},{foo:2},{bar:2}]); //=> {foo:2,bar:2}"}]},{"type":"function","action":"combine functions","func":[{"name":"pipe","longname":"R.pipe","description":"Performs left-to-right function composition. The leftmost function may have\nany arity; the remaining functions must be unary.\n\nIn some libraries this function is named `sequence`.\n\n**Note:** The result of pipe is not automatically curried.","signature":"(((a, b, ..., n) -> o), (o -> p), ..., (x -> y), (y -> z)) -> ((a, b, ..., n) -> z)","example":" const f = R.pipe(Math.pow, R.negate, R.inc);\n\n f(3, 4); // -(3^4) + 1"},{"name":"compose","longname":"R.compose","description":"Performs right-to-left function composition. The rightmost function may have\nany arity; the remaining functions must be unary.\n\n**Note:** The result of compose is not automatically curried.","signature":"((y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)) -> ((a, b, ..., n) -> z)","example":" const classyGreeting = (firstName, lastName) => \"The name's \" + lastName + \", \" + firstName + \" \" + lastName\n const yellGreeting = R.compose(R.toUpper, classyGreeting);\n yellGreeting('James', 'Bond'); //=> \"THE NAME'S BOND, JAMES BOND\"\n\n R.compose(Math.abs, R.add(1), R.multiply(2))(-4) //=> 7"}]},{"type":"function","action":"combine promise returning functions","func":[{"name":"pipeP","longname":"R.pipeP","description":"Performs left-to-right composition of one or more Promise-returning\nfunctions. The leftmost function may have any arity; the remaining functions\nmust be unary.","signature":"((a -> Promise b), (b -> Promise c), ..., (y -> Promise z)) -> (a -> Promise z)","example":" // followersForUser :: String -> Promise [User]\n const followersForUser = R.pipeP(db.getUserById, db.getFollowers);"},{"name":"composeP","longname":"R.composeP","description":"Performs right-to-left composition of one or more Promise-returning\nfunctions. The rightmost function may have any arity; the remaining\nfunctions must be unary.","signature":"((y -> Promise z), (x -> Promise y), ..., (a -> Promise b)) -> (a -> Promise z)","example":" const db = {\n users: {\n JOE: {\n name: 'Joe',\n followers: ['STEVE', 'SUZY']\n }\n }\n }\n\n // We'll pretend to do a db lookup which returns a promise\n const lookupUser = (userId) => Promise.resolve(db.users[userId])\n const lookupFollowers = (user) => Promise.resolve(user.followers)\n lookupUser('JOE').then(lookupFollowers)\n\n // followersForUser :: String -> Promise [UserId]\n const followersForUser = R.composeP(lookupFollowers, lookupUser);\n followersForUser('JOE').then(followers => console.log('Followers:', followers))\n // Followers: [\"STEVE\",\"SUZY\"]"}]},{"type":"function","action":"curry a function","func":[{"name":"curry","longname":"R.curry","description":"Returns a curried equivalent of the provided function. The curried function\nhas two unusual capabilities. First, its arguments needn't be provided one\nat a time. If `f` is a ternary function and `g` is `R.curry(f)`, the\nfollowing are equivalent:\n\n - `g(1)(2)(3)`\n - `g(1)(2, 3)`\n - `g(1, 2)(3)`\n - `g(1, 2, 3)`\n\nSecondly, the special placeholder value [`R.__`](#__) may be used to specify\n\"gaps\", allowing partial application of any combination of arguments,\nregardless of their positions. If `g` is as above and `_` is [`R.__`](#__),\nthe following are equivalent:\n\n - `g(1, 2, 3)`\n - `g(_, 2, 3)(1)`\n - `g(_, _, 3)(1)(2)`\n - `g(_, _, 3)(1, 2)`\n - `g(_, 2)(1)(3)`\n - `g(_, 2)(1, 3)`\n - `g(_, 2)(_, 3)(1)`","signature":"(* -> a) -> (* -> a)","example":" const addFourNumbers = (a, b, c, d) => a + b + c + d;\n\n const curriedAddFourNumbers = R.curry(addFourNumbers);\n const f = curriedAddFourNumbers(1, 2);\n const g = f(3);\n g(4); //=> 10"}]},{"type":"function","action":"partially apply a function","func":[{"name":"partialRight","longname":"R.partialRight","description":"Takes a function `f` and a list of arguments, and returns a function `g`.\nWhen applied, `g` returns the result of applying `f` to the arguments\nprovided to `g` followed by the arguments provided initially.","signature":"((a, b, c, ..., n) -> x) -> [d, e, f, ..., n] -> ((a, b, c, ...) -> x)","example":" const greet = (salutation, title, firstName, lastName) =>\n salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';\n\n const greetMsJaneJones = R.partialRight(greet, ['Ms.', 'Jane', 'Jones']);\n\n greetMsJaneJones('Hello'); //=> 'Hello, Ms. Jane Jones!'"},{"name":"partial","longname":"R.partial","description":"Takes a function `f` and a list of arguments, and returns a function `g`.\nWhen applied, `g` returns the result of applying `f` to the arguments\nprovided initially followed by the arguments provided to `g`.","signature":"((a, b, c, ..., n) -> x) -> [a, b, c, ...] -> ((d, e, f, ..., n) -> x)","example":" const multiply2 = (a, b) => a * b;\n const double = R.partial(multiply2, [2]);\n double(2); //=> 4\n\n const greet = (salutation, title, firstName, lastName) =>\n salutation + ', ' + title + ' ' + firstName + ' ' + lastName + '!';\n\n const sayHello = R.partial(greet, ['Hello']);\n const sayHelloToMs = R.partial(sayHello, ['Ms.']);\n sayHelloToMs('Jane', 'Jones'); //=> 'Hello, Ms. Jane Jones!'"}]},{"type":"function","action":"uncurry a function","func":[{"name":"uncurry"}]},{"type":"function","action":"swap the argument order","func":[{"name":"flip","longname":"R.flip","description":"Returns a new function much like the supplied one, except that the first two\narguments' order is reversed.","signature":"((a, b, c, ...) -> z) -> (b -> a -> c -> ... -> z)","example":" const mergeThree = (a, b, c) => [].concat(a, b, c);\n\n mergeThree(1, 2, 3); //=> [1, 2, 3]\n\n R.flip(mergeThree)(1, 2, 3); //=> [2, 1, 3]"}]},{"type":"function","action":"apply a list of arguments","func":[{"name":"apply","longname":"R.apply","description":"Applies function `fn` to the argument list `args`. This is useful for\ncreating a fixed-arity function from a variadic function. `fn` should be a\nbound function if context is significant.","signature":"(*... -> a) -> [*] -> a","example":" const nums = [1, 2, 3, -99, 42, 6, 7];\n R.apply(Math.max, nums); //=> 42"}]},{"type":"function","action":"apply multiple functions to a single value and merge the results somehow","func":[{"name":"converge","longname":"R.converge","description":"Accepts a converging function and a list of branching functions and returns\na new function. The arity of the new function is the same as the arity of\nthe longest branching function. When invoked, this new function is applied\nto some arguments, and each branching function is applied to those same\narguments. The results of each branching function are passed as arguments\nto the converging function to produce the return value.","signature":"((x1, x2, ...) -> z) -> [((a, b, ...) -> x1), ((a, b, ...) -> x2), ...] -> (a -> b -> ... -> z)","example":" const average = R.converge(R.divide, [R.sum, R.length])\n average([1, 2, 3, 4, 5, 6, 7]) //=> 4\n\n const strangeConcat = R.converge(R.concat, [R.toUpper, R.toLower])\n strangeConcat(\"Yodel\") //=> \"YODELyodel\""}]},{"type":"function","action":"transform a function's arguments","func":[{"name":"useWith","longname":"R.useWith","description":"Accepts a function `fn` and a list of transformer functions and returns a\nnew curried function. When the new function is invoked, it calls the\nfunction `fn` with parameters consisting of the result of calling each\nsupplied handler on successive arguments to the new function.\n\nIf more arguments are passed to the returned function than transformer\nfunctions, those arguments are passed directly to `fn` as additional\nparameters. If you expect additional arguments that don't need to be\ntransformed, although you can ignore them, it's best to pass an identity\nfunction so that the new function reports the correct arity.","signature":"((x1, x2, ...) -> z) -> [(a -> x1), (b -> x2), ...] -> (a -> b -> ... -> z)","example":" R.useWith(Math.pow, [R.identity, R.identity])(3, 4); //=> 81\n R.useWith(Math.pow, [R.identity, R.identity])(3)(4); //=> 81\n R.useWith(Math.pow, [R.dec, R.inc])(3, 4); //=> 32\n R.useWith(Math.pow, [R.dec, R.inc])(3)(4); //=> 32"}]},{"type":"function","action":"apply a list of functions to each argument and collect the results","func":[{"name":"juxt","longname":"R.juxt","description":"juxt applies a list of functions to a list of values.","signature":"[(a, b, ..., m) -> n] -> ((a, b, ..., m) -> [n])","example":" const getRange = R.juxt([Math.min, Math.max]);\n getRange(3, 4, 9, -3); //=> [-3, 9]"}]},{"type":"function","action":"create a variadic function from one that takes an array","func":[{"name":"unapply","longname":"R.unapply","description":"Takes a function `fn`, which takes a single array argument, and returns a\nfunction which:\n\n - takes any number of positional arguments;\n - passes these arguments to `fn` as an array; and\n - returns the result.\n\nIn other words, `R.unapply` derives a variadic function from a function which\ntakes an array. `R.unapply` is the inverse of [`R.apply`](#apply).","signature":"([*...] -> a) -> (*... -> a)","example":" R.unapply(JSON.stringify)(1, 2, 3); //=> '[1,2,3]'"}]},{"type":"function","action":"restrict the number of accepted arguments to 1","func":[{"name":"unary","longname":"R.unary","description":"Wraps a function of any arity (including nullary) in a function that accepts\nexactly 1 parameter. Any extraneous parameters will not be passed to the\nsupplied function.","signature":"(* -> b) -> (a -> b)","example":" const takesTwoArgs = function(a, b) {\n return [a, b];\n };\n takesTwoArgs.length; //=> 2\n takesTwoArgs(1, 2); //=> [1, 2]\n\n const takesOneArg = R.unary(takesTwoArgs);\n takesOneArg.length; //=> 1\n // Only 1 argument is passed to the wrapped function\n takesOneArg(1, 2); //=> [1, undefined]"}]},{"type":"function","action":"restrict the number of accepted arguments to 2","func":[{"name":"binary","longname":"R.binary","description":"Wraps a function of any arity (including nullary) in a function that accepts\nexactly 2 parameters. Any extraneous parameters will not be passed to the\nsupplied function.","signature":"(* -> c) -> (a, b -> c)","example":" const takesThreeArgs = function(a, b, c) {\n return [a, b, c];\n };\n takesThreeArgs.length; //=> 3\n takesThreeArgs(1, 2, 3); //=> [1, 2, 3]\n\n const takesTwoArgs = R.binary(takesThreeArgs);\n takesTwoArgs.length; //=> 2\n // Only 2 arguments are passed to the wrapped function\n takesTwoArgs(1, 2, 3); //=> [1, 2, undefined]"}]},{"type":"function","action":"restrict the number of accepted arguments to specific number","func":[{"name":"nAry","longname":"R.nAry","description":"Wraps a function of any arity (including nullary) in a function that accepts\nexactly `n` parameters. Any extraneous parameters will not be passed to the\nsupplied function.","signature":"Number -> (* -> a) -> (* -> a)","example":" const takesTwoArgs = (a, b) => [a, b];\n\n takesTwoArgs.length; //=> 2\n takesTwoArgs(1, 2); //=> [1, 2]\n\n const takesOneArg = R.nAry(1, takesTwoArgs);\n takesOneArg.length; //=> 1\n // Only `n` arguments are passed to the wrapped function\n takesOneArg(1, 2); //=> [1, undefined]"}]},{"type":"function","action":"return the supplied argument unchanged","func":[{"name":"identity","longname":"R.identity","description":"A function that does nothing but return the parameter supplied to it. Good\nas a default or placeholder function.","signature":"a -> a","example":" R.identity(1); //=> 1\n\n const obj = {};\n R.identity(obj) === obj; //=> true"}]},{"type":"function","action":"turn a method into a function","func":[{"name":"invoker","longname":"R.invoker","description":"Turns a named method with a specified arity into a function that can be\ncalled directly supplied with arguments and a target object.\n\nThe returned function is curried and accepts `arity + 1` parameters where\nthe final parameter is the target object.","signature":"Number -> String -> (a -> b -> ... -> n -> Object -> *)","example":" const sliceFrom = R.invoker(1, 'slice');\n sliceFrom(6, 'abcdefghijklm'); //=> 'ghijklm'\n const sliceFrom6 = R.invoker(2, 'slice')(6);\n sliceFrom6(8, 'abcdefghijklm'); //=> 'gh'"}]},{"type":"function","action":"invoke a function only once","func":[{"name":"once","longname":"R.once","description":"Accepts a function `fn` and returns a function that guards invocation of\n`fn` such that `fn` can only ever be called once, no matter how many times\nthe returned function is invoked. The first value calculated is returned in\nsubsequent invocations.","signature":"(a... -> b) -> (a... -> b)","example":" const addOneOnce = R.once(x => x + 1);\n addOneOnce(10); //=> 11\n addOneOnce(addOneOnce(50)); //=> 11"}]},{"type":"function","action":"inspect values without affecting them","func":[{"name":"tap","longname":"R.tap","description":"Runs the given function with the supplied object, then returns the object.\n\nActs as a transducer if a transformer is given as second parameter.","signature":"(a -> *) -> a -> a","example":" const sayX = x => console.log('x is ' + x);\n R.tap(sayX, 100); //=> 100\n // logs 'x is 100'"}]},{"type":"function","action":"bind to a specific context","func":[{"name":"bind","longname":"R.bind","description":"Creates a function that is bound to a context.\nNote: `R.bind` does not provide the additional argument-binding capabilities of\n[Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).","signature":"(* -> *) -> {*} -> (* -> *)","example":" const log = R.bind(console.log, console);\n R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}\n // logs {a: 2}"}]},{"type":"function","action":"lift a function","func":[{"name":"liftN","longname":"R.liftN","description":"\"lifts\" a function to be the specified arity, so that it may \"map over\" that\nmany lists, Functions or other objects that satisfy the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).","signature":"Number -> (*... -> *) -> ([*]... -> [*])","example":" const madd3 = R.liftN(3, (...args) => R.sum(args));\n madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]"},{"name":"lift","longname":"R.lift","description":"\"lifts\" a function of arity > 1 so that it may \"map over\" a list, Function or other\nobject that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).","signature":"(*... -> *) -> ([*]... -> [*])","example":" const madd3 = R.lift((a, b, c) => a + b + c);\n\n madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]\n\n const madd5 = R.lift((a, b, c, d, e) => a + b + c + d + e);\n\n madd5([1,2], [3], [4, 5], [6], [7, 8]); //=> [21, 22, 22, 23, 22, 23, 23, 24]"}]},{"type":"function","action":"memoize","func":[{"name":"memoize"}]},{"type":"logic","action":"apply a function based on conditional logic","func":[{"name":"ifElse","longname":"R.ifElse","description":"Creates a function that will process either the `onTrue` or the `onFalse`\nfunction depending upon the result of the `condition` predicate.","signature":"(*... -> Boolean) -> (*... -> *) -> (*... -> *) -> (*... -> *)","example":" const incCount = R.ifElse(\n R.has('count'),\n R.over(R.lensProp('count'), R.inc),\n R.assoc('count', 1)\n );\n incCount({}); //=> { count: 1 }\n incCount({ count: 1 }); //=> { count: 2 }"},{"name":"cond","longname":"R.cond","description":"Returns a function, `fn`, which encapsulates `if/else, if/else, ...` logic.\n`R.cond` takes a list of [predicate, transformer] pairs. All of the arguments\nto `fn` are applied to each of the predicates in turn until one returns a\n\"truthy\" value, at which point `fn` returns the result of applying its\narguments to the corresponding transformer. If none of the predicates\nmatches, `fn` returns undefined.","signature":"[[(*... -> Boolean),(*... -> *)]] -> (*... -> *)","example":" const fn = R.cond([\n [R.equals(0), R.always('water freezes at 0°C')],\n [R.equals(100), R.always('water boils at 100°C')],\n [R.T, temp => 'nothing special happens at ' + temp + '°C']\n ]);\n fn(0); //=> 'water freezes at 0°C'\n fn(50); //=> 'nothing special happens at 50°C'\n fn(100); //=> 'water boils at 100°C'"},{"name":"unless","longname":"R.unless","description":"Tests the final argument by passing it to the given predicate function. If\nthe predicate is not satisfied, the function will return the result of\ncalling the `whenFalseFn` function with the same argument. If the predicate\nis satisfied, the argument is returned as is.","signature":"(a -> Boolean) -> (a -> a) -> a -> a","example":" let safeInc = R.unless(R.isNil, R.inc);\n safeInc(null); //=> null\n safeInc(1); //=> 2"},{"name":"when","longname":"R.when","description":"Tests the final argument by passing it to the given predicate function. If\nthe predicate is satisfied, the function will return the result of calling\nthe `whenTrueFn` function with the same argument. If the predicate is not\nsatisfied, the argument is returned as is.","signature":"(a -> Boolean) -> (a -> a) -> a -> a","example":" // truncate :: String -> String\n const truncate = R.when(\n R.propSatisfies(R.gt(R.__, 10), 'length'),\n R.pipe(R.take(10), R.append('…'), R.join(''))\n );\n truncate('12345'); //=> '12345'\n truncate('0123456789ABC'); //=> '0123456789…'"}]},{"type":"logic","action":"negate a value","func":[{"name":"not","longname":"R.not","description":"A function that returns the `!` of its argument. It will return `true` when\npassed false-y value, and `false` when passed a truth-y one.","signature":"* -> Boolean","example":" R.not(true); //=> false\n R.not(false); //=> true\n R.not(0); //=> true\n R.not(1); //=> false"}]},{"type":"logic","action":"know if either of two values are truthy","func":[{"name":"or","longname":"R.or","description":"Returns `true` if one or both of its arguments are `true`. Returns `false`\nif both arguments are `false`.","signature":"a -> b -> a | b","example":" R.or(true, true); //=> true\n R.or(true, false); //=> true\n R.or(false, true); //=> true\n R.or(false, false); //=> false"}]},{"type":"logic","action":"know if two values are truthy","func":[{"name":"and","longname":"R.and","description":"Returns `true` if both arguments are `true`; `false` otherwise.","signature":"a -> b -> a | b","example":" R.and(true, true); //=> true\n R.and(true, false); //=> false\n R.and(false, true); //=> false\n R.and(false, false); //=> false"}]},{"type":"logic","action":"invert a predicate function","func":[{"name":"complement","longname":"R.complement","description":"Takes a function `f` and returns a function `g` such that if called with the same arguments\nwhen `f` returns a \"truthy\" value, `g` returns `false` and when `f` returns a \"falsy\" value `g` returns `true`.\n\n`R.complement` may be applied to any functor","signature":"(*... -> *) -> (*... -> Boolean)","example":" const isNotNil = R.complement(R.isNil);\n isNil(null); //=> true\n isNotNil(null); //=> false\n isNil(7); //=> false\n isNotNil(7); //=> true"}]},{"type":"logic","action":"know if a value satisfies at least one of two predicates","func":[{"name":"either","longname":"R.either","description":"A function wrapping calls to the two functions in an `||` operation,\nreturning the result of the first function if it is truth-y and the result\nof the second function otherwise. Note that this is short-circuited,\nmeaning that the second function will not be invoked if the first returns a\ntruth-y value.\n\nIn addition to functions, `R.either` also accepts any fantasy-land compatible\napplicative functor.","signature":"(*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)","example":" const gt10 = x => x > 10;\n const even = x => x % 2 === 0;\n const f = R.either(gt10, even);\n f(101); //=> true\n f(8); //=> true\n\n R.either(Maybe.Just(false), Maybe.Just(55)); // => Maybe.Just(55)\n R.either([false, false, 'a'], [11]) // => [11, 11, \"a\"]"}]},{"type":"logic","action":"know if a value satisfies two predicates","func":[{"name":"both","longname":"R.both","description":"A function which calls the two provided functions and returns the `&&`\nof the results.\nIt returns the result of the first function if it is false-y and the result\nof the second function otherwise. Note that this is short-circuited,\nmeaning that the second function will not be invoked if the first returns a\nfalse-y value.\n\nIn addition to functions, `R.both` also accepts any fantasy-land compatible\napplicative functor.","signature":"(*... -> Boolean) -> (*... -> Boolean) -> (*... -> Boolean)","example":" const gt10 = R.gt(R.__, 10)\n const lt20 = R.lt(R.__, 20)\n const f = R.both(gt10, lt20);\n f(15); //=> true\n f(30); //=> false\n\n R.both(Maybe.Just(false), Maybe.Just(55)); // => Maybe.Just(false)\n R.both([false, false, 'a'], [11]); //=> [false, false, 11]"}]},{"type":"logic","action":"know if a value satisfies at least one of a list of predicates","func":[{"name":"anyPass","longname":"R.anyPass","description":"Takes a list of predicates and returns a predicate that returns true for a\ngiven list of arguments if at least one of the provided predicates is\nsatisfied by those arguments.\n\nThe function returned is a curried function whose arity matches that of the\nhighest-arity predicate.","signature":"[(*... -> Boolean)] -> (*... -> Boolean)","example":" const isClub = R.propEq('suit', '♣');\n const isSpade = R.propEq('suit', '♠');\n const isBlackCard = R.anyPass([isClub, isSpade]);\n\n isBlackCard({rank: '10', suit: '♣'}); //=> true\n isBlackCard({rank: 'Q', suit: '♠'}); //=> true\n isBlackCard({rank: 'Q', suit: '♦'}); //=> false"}]},{"type":"logic","action":"know if a value satisfies at every one of a list of predicates","func":[{"name":"allPass","longname":"R.allPass","description":"Takes a list of predicates and returns a predicate that returns true for a\ngiven list of arguments if every one of the provided predicates is satisfied\nby those arguments.\n\nThe function returned is a curried function whose arity matches that of the\nhighest-arity predicate.","signature":"[(*... -> Boolean)] -> (*... -> Boolean)","example":" const isQueen = R.propEq('rank', 'Q');\n const isSpade = R.propEq('suit', '♠︎');\n const isQueenOfSpades = R.allPass([isQueen, isSpade]);\n\n isQueenOfSpades({rank: 'Q', suit: '♣︎'}); //=> false\n isQueenOfSpades({rank: 'Q', suit: '♠︎'}); //=> true"}]},{"type":"logic","action":"produce an empty value","func":[{"name":"empty","longname":"R.empty","description":"Returns the empty value of its argument's type. Ramda defines the empty\nvalue of Array (`[]`), Object (`{}`), String (`''`), and Arguments. Other\ntypes are supported if they define `.empty`,\n`.prototype.empty` or implement the\n[FantasyLand Monoid spec](https://github.com/fantasyland/fantasy-land#monoid).\n\nDispatches to the `empty` method of the first argument, if present.","signature":"a -> a","example":" R.empty(Just(42)); //=> Nothing()\n R.empty([1, 2, 3]); //=> []\n R.empty('unicorns'); //=> ''\n R.empty({x: 1, y: 2}); //=> {}"}]},{"type":"logic","action":"know if a value is empty","func":[{"name":"isEmpty","longname":"R.isEmpty","description":"Returns `true` if the given value is its type's empty value; `false`\notherwise.","signature":"a -> Boolean","example":" R.isEmpty([1, 2, 3]); //=> false\n R.isEmpty([]); //=> true\n R.isEmpty(''); //=> true\n R.isEmpty(null); //=> false\n R.isEmpty({}); //=> true\n R.isEmpty({length: 0}); //=> false"}]},{"type":"relation","action":"compare for value equality","func":[{"name":"equals","longname":"R.equals","description":"Returns `true` if its arguments are equivalent, `false` otherwise. Handles\ncyclical data structures.\n\nDispatches symmetrically to the `equals` methods of both arguments, if\npresent.","signature":"a -> b -> Boolean","example":" R.equals(1, 1); //=> true\n R.equals(1, '1'); //=> false\n R.equals([1, 2, 3], [1, 2, 3]); //=> true\n\n const a = {}; a.v = a;\n const b = {}; b.v = b;\n R.equals(a, b); //=> true"}]},{"type":"relation","action":"compare for reference equality","func":[{"name":"identical","longname":"R.identical","description":"Returns true if its arguments are identical, false otherwise. Values are\nidentical if they reference the same memory. `NaN` is identical to `NaN`;\n`0` and `-0` are not identical.\n\nNote this is merely a curried version of ES6 `Object.is`.","signature":"a -> a -> Boolean","example":" const o = {};\n R.identical(o, o); //=> true\n R.identical(1, 1); //=> true\n R.identical(1, '1'); //=> false\n R.identical([], []); //=> false\n R.identical(0, -0); //=> false\n R.identical(NaN, NaN); //=> true"}]},{"type":"relation","action":"know if a value is less than another","func":[{"name":"lt","longname":"R.lt","description":"Returns `true` if the first argument is less than the second; `false`\notherwise.","signature":"Ord a => a -> a -> Boolean","example":" R.lt(2, 1); //=> false\n R.lt(2, 2); //=> false\n R.lt(2, 3); //=> true\n R.lt('a', 'z'); //=> true\n R.lt('z', 'a'); //=> false"}]},{"type":"relation","action":"know if a value is less than or equal to another","func":[{"name":"lte","longname":"R.lte","description":"Returns `true` if the first argument is less than or equal to the second;\n`false` otherwise.","signature":"Ord a => a -> a -> Boolean","example":" R.lte(2, 1); //=> false\n R.lte(2, 2); //=> true\n R.lte(2, 3); //=> true\n R.lte('a', 'z'); //=> true\n R.lte('z', 'a'); //=> false"}]},{"type":"relation","action":"know if a value is greater than another","func":[{"name":"gt","longname":"R.gt","description":"Returns `true` if the first argument is greater than the second; `false`\notherwise.","signature":"Ord a => a -> a -> Boolean","example":" R.gt(2, 1); //=> true\n R.gt(2, 2); //=> false\n R.gt(2, 3); //=> false\n R.gt('a', 'z'); //=> false\n R.gt('z', 'a'); //=> true"}]},{"type":"relation","action":"know if a value is greater than or equal to another","func":[{"name":"gte","longname":"R.gte","description":"Returns `true` if the first argument is greater than or equal to the second;\n`false` otherwise.","signature":"Ord a => a -> a -> Boolean","example":" R.gte(2, 1); //=> true\n R.gte(2, 2); //=> true\n R.gte(2, 3); //=> false\n R.gte('a', 'z'); //=> false\n R.gte('z', 'a'); //=> true"}]},{"type":"relation","action":"find the smallest of two values","func":[{"name":"min","longname":"R.min","description":"Returns the smaller of its two arguments.","signature":"Ord a => a -> a -> a","example":" R.min(789, 123); //=> 123\n R.min('a', 'b'); //=> 'a'"}]},{"type":"relation","action":"find the smallest of two values based on custom logic","func":[{"name":"minBy","longname":"R.minBy","description":"Takes a function and two values, and returns whichever value produces the\nsmaller result when passed to the provided function.","signature":"Ord b => (a -> b) -> a -> a -> a","example":" // square :: Number -> Number\n const square = n => n * n;\n\n R.minBy(square, -3, 2); //=> 2\n\n R.reduce(R.minBy(square), Infinity, [3, -5, 4, 1, -2]); //=> 1\n R.reduce(R.minBy(square), Infinity, []); //=> Infinity"}]},{"type":"relation","action":"find the largest of two values","func":[{"name":"max","longname":"R.max","description":"Returns the larger of its two arguments.","signature":"Ord a => a -> a -> a","example":" R.max(789, 123); //=> 789\n R.max('a', 'b'); //=> 'b'"}]},{"type":"relation","action":"find the largest of two values based on custom logic","func":[{"name":"maxBy","longname":"R.maxBy","description":"Takes a function and two values, and returns whichever value produces the\nlarger result when passed to the provided function.","signature":"Ord b => (a -> b) -> a -> a -> a","example":" // square :: Number -> Number\n const square = n => n * n;\n\n R.maxBy(square, -3, 2); //=> -3\n\n R.reduce(R.maxBy(square), 0, [3, -5, 4, 1, -2]); //=> -5\n R.reduce(R.maxBy(square), 0, []); //=> 0"}]},{"type":"math","action":"increment a number by one","func":[{"name":"inc","longname":"R.inc","description":"Increments its argument.","signature":"Number -> Number","example":" R.inc(42); //=> 43"}]},{"type":"math","action":"decrement a number by one","func":[{"name":"dec","longname":"R.dec","description":"Decrements its argument.","signature":"Number -> Number","example":" R.dec(42); //=> 41"}]},{"type":"math","action":"add two numbers","func":[{"name":"add","longname":"R.add","description":"Adds two values.","signature":"Number -> Number -> Number","example":" R.add(2, 3); //=> 5\n R.add(7)(10); //=> 17"}]},{"type":"math","action":"subtract one number from another","func":[{"name":"subtract","longname":"R.subtract","description":"Subtracts its second argument from its first argument.","signature":"Number -> Number -> Number","example":" R.subtract(10, 8); //=> 2\n\n const minus5 = R.subtract(R.__, 5);\n minus5(17); //=> 12\n\n const complementaryAngle = R.subtract(90);\n complementaryAngle(30); //=> 60\n complementaryAngle(72); //=> 18"}]},{"type":"math","action":"multiple two numbers","func":[{"name":"multiply","longname":"R.multiply","description":"Multiplies two numbers. Equivalent to `a * b` but curried.","signature":"Number -> Number -> Number","example":" const double = R.multiply(2);\n const triple = R.multiply(3);\n double(3); //=> 6\n triple(4); //=> 12\n R.multiply(2, 5); //=> 10"}]},{"type":"math","action":"divide one number by another","func":[{"name":"divide","longname":"R.divide","description":"Divides two numbers. Equivalent to `a / b`.","signature":"Number -> Number -> Number","example":" R.divide(71, 100); //=> 0.71\n\n const half = R.divide(R.__, 2);\n half(42); //=> 21\n\n const reciprocal = R.divide(1);\n reciprocal(4); //=> 0.25"}]},{"type":"math","action":"negate a number","func":[{"name":"negate","longname":"R.negate","description":"Negates its argument.","signature":"Number -> Number","example":" R.negate(42); //=> -42"}]},{"type":"math","action":"divide one number by another and get the remainder","func":[{"name":"modulo","longname":"R.modulo","description":"Divides the first parameter by the second and returns the remainder. Note\nthat this function preserves the JavaScript-style behavior for modulo. For\nmathematical modulo see [`mathMod`](#mathMod).","signature":"Number -> Number -> Number","example":" R.modulo(17, 3); //=> 2\n // JS behavior:\n R.modulo(-17, 3); //=> -2\n R.modulo(17, -3); //=> 2\n\n const isOdd = R.modulo(R.__, 2);\n isOdd(42); //=> 0\n isOdd(21); //=> 1"},{"name":"mathMod","longname":"R.mathMod","description":"`mathMod` behaves like the modulo operator should mathematically, unlike the\n`%` operator (and by extension, [`R.modulo`](#modulo)). So while\n`-17 % 5` is `-2`, `mathMod(-17, 5)` is `3`. `mathMod` requires Integer\narguments, and returns NaN when the modulus is zero or negative.","signature":"Number -> Number -> Number","example":" R.mathMod(-17, 5); //=> 3\n R.mathMod(17, 5); //=> 2\n R.mathMod(17, -5); //=> NaN\n R.mathMod(17, 0); //=> NaN\n R.mathMod(17.2, 5); //=> NaN\n R.mathMod(17, 5.3); //=> NaN\n\n const clock = R.mathMod(R.__, 12);\n clock(15); //=> 3\n clock(24); //=> 0\n\n const seventeenMod = R.mathMod(17);\n seventeenMod(3); //=> 2\n seventeenMod(4); //=> 1\n seventeenMod(10); //=> 7"}]}]
--------------------------------------------------------------------------------