Skip to content

Commit 406fc1f

Browse files
Merge pull request #119 from logic-building/MiscFunRename
Misc fun rename. Added P at the end as per common lisp for the predicate.
2 parents e9d014e + 236fe10 commit 406fc1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1132
-1119
lines changed

fp/dropptr.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package fp
22

3-
// DropInt returns a new list after dropping the given item
3+
// DropIntPtr returns a new list after dropping the given item
44
func DropIntPtr(num *int, list []*int) []*int {
55
var newList []*int
66
for _, v := range list {
@@ -11,7 +11,7 @@ func DropIntPtr(num *int, list []*int) []*int {
1111
return newList
1212
}
1313

14-
// DropInts returns a new list after dropping the given items
14+
// DropIntsPtr returns a new list after dropping the given items
1515
func DropIntsPtr(nums []*int, list []*int) []*int {
1616
var newList []*int
1717
for _, v := range list {
@@ -22,7 +22,7 @@ func DropIntsPtr(nums []*int, list []*int) []*int {
2222
return newList
2323
}
2424

25-
// DropInt64 returns a new list after dropping the given item
25+
// DropInt64Ptr returns a new list after dropping the given item
2626
func DropInt64Ptr(num *int64, list []*int64) []*int64 {
2727
var newList []*int64
2828
for _, v := range list {
@@ -33,7 +33,7 @@ func DropInt64Ptr(num *int64, list []*int64) []*int64 {
3333
return newList
3434
}
3535

36-
// DropInts returns a new list after dropping the given items
36+
// DropInts64Ptr returns a new list after dropping the given items
3737
func DropInts64Ptr(nums []*int64, list []*int64) []*int64 {
3838
var newList []*int64
3939
for _, v := range list {
@@ -44,7 +44,7 @@ func DropInts64Ptr(nums []*int64, list []*int64) []*int64 {
4444
return newList
4545
}
4646

47-
// DropInt32 returns a new list after dropping the given item
47+
// DropInt32Ptr returns a new list after dropping the given item
4848
func DropInt32Ptr(num *int32, list []*int32) []*int32 {
4949
var newList []*int32
5050
for _, v := range list {
@@ -55,7 +55,7 @@ func DropInt32Ptr(num *int32, list []*int32) []*int32 {
5555
return newList
5656
}
5757

58-
// DropInts returns a new list after dropping the given items
58+
// DropInts32Ptr returns a new list after dropping the given items
5959
func DropInts32Ptr(nums []*int32, list []*int32) []*int32 {
6060
var newList []*int32
6161
for _, v := range list {
@@ -66,7 +66,7 @@ func DropInts32Ptr(nums []*int32, list []*int32) []*int32 {
6666
return newList
6767
}
6868

69-
// DropInt16 returns a new list after dropping the given item
69+
// DropInt16Ptr returns a new list after dropping the given item
7070
func DropInt16Ptr(num *int16, list []*int16) []*int16 {
7171
var newList []*int16
7272
for _, v := range list {
@@ -77,7 +77,7 @@ func DropInt16Ptr(num *int16, list []*int16) []*int16 {
7777
return newList
7878
}
7979

80-
// DropInts returns a new list after dropping the given items
80+
// DropInts16Ptr returns a new list after dropping the given items
8181
func DropInts16Ptr(nums []*int16, list []*int16) []*int16 {
8282
var newList []*int16
8383
for _, v := range list {
@@ -88,7 +88,7 @@ func DropInts16Ptr(nums []*int16, list []*int16) []*int16 {
8888
return newList
8989
}
9090

91-
// DropInt8 returns a new list after dropping the given item
91+
// DropInt8Ptr returns a new list after dropping the given item
9292
func DropInt8Ptr(num *int8, list []*int8) []*int8 {
9393
var newList []*int8
9494
for _, v := range list {
@@ -99,7 +99,7 @@ func DropInt8Ptr(num *int8, list []*int8) []*int8 {
9999
return newList
100100
}
101101

102-
// DropInts returns a new list after dropping the given items
102+
// DropInts8Ptr returns a new list after dropping the given items
103103
func DropInts8Ptr(nums []*int8, list []*int8) []*int8 {
104104
var newList []*int8
105105
for _, v := range list {
@@ -110,7 +110,7 @@ func DropInts8Ptr(nums []*int8, list []*int8) []*int8 {
110110
return newList
111111
}
112112

113-
// DropUint returns a new list after dropping the given item
113+
// DropUintPtr returns a new list after dropping the given item
114114
func DropUintPtr(num *uint, list []*uint) []*uint {
115115
var newList []*uint
116116
for _, v := range list {
@@ -121,7 +121,7 @@ func DropUintPtr(num *uint, list []*uint) []*uint {
121121
return newList
122122
}
123123

124-
// DropInts returns a new list after dropping the given items
124+
// DropUintsPtr returns a new list after dropping the given items
125125
func DropUintsPtr(nums []*uint, list []*uint) []*uint {
126126
var newList []*uint
127127
for _, v := range list {
@@ -132,7 +132,7 @@ func DropUintsPtr(nums []*uint, list []*uint) []*uint {
132132
return newList
133133
}
134134

135-
// DropUint64 returns a new list after dropping the given item
135+
// DropUint64Ptr returns a new list after dropping the given item
136136
func DropUint64Ptr(num *uint64, list []*uint64) []*uint64 {
137137
var newList []*uint64
138138
for _, v := range list {
@@ -143,7 +143,7 @@ func DropUint64Ptr(num *uint64, list []*uint64) []*uint64 {
143143
return newList
144144
}
145145

146-
// DropInts returns a new list after dropping the given items
146+
// DropUint64sPtr returns a new list after dropping the given items
147147
func DropUint64sPtr(nums []*uint64, list []*uint64) []*uint64 {
148148
var newList []*uint64
149149
for _, v := range list {
@@ -154,7 +154,7 @@ func DropUint64sPtr(nums []*uint64, list []*uint64) []*uint64 {
154154
return newList
155155
}
156156

157-
// DropUint32 returns a new list after dropping the given item
157+
// DropUint32Ptr returns a new list after dropping the given item
158158
func DropUint32Ptr(num *uint32, list []*uint32) []*uint32 {
159159
var newList []*uint32
160160
for _, v := range list {
@@ -165,7 +165,7 @@ func DropUint32Ptr(num *uint32, list []*uint32) []*uint32 {
165165
return newList
166166
}
167167

168-
// DropInts returns a new list after dropping the given items
168+
// DropUints32Ptr returns a new list after dropping the given items
169169
func DropUints32Ptr(nums []*uint32, list []*uint32) []*uint32 {
170170
var newList []*uint32
171171
for _, v := range list {
@@ -176,7 +176,7 @@ func DropUints32Ptr(nums []*uint32, list []*uint32) []*uint32 {
176176
return newList
177177
}
178178

179-
// DropUint16 returns a new list after dropping the given item
179+
// DropUint16Ptr returns a new list after dropping the given item
180180
func DropUint16Ptr(num *uint16, list []*uint16) []*uint16 {
181181
var newList []*uint16
182182
for _, v := range list {
@@ -187,7 +187,7 @@ func DropUint16Ptr(num *uint16, list []*uint16) []*uint16 {
187187
return newList
188188
}
189189

190-
// DropInts returns a new list after dropping the given items
190+
// DropUints16Ptr returns a new list after dropping the given items
191191
func DropUints16Ptr(nums []*uint16, list []*uint16) []*uint16 {
192192
var newList []*uint16
193193
for _, v := range list {
@@ -198,7 +198,7 @@ func DropUints16Ptr(nums []*uint16, list []*uint16) []*uint16 {
198198
return newList
199199
}
200200

201-
// DropUint8 returns a new list after dropping the given item
201+
// DropUint8Ptr returns a new list after dropping the given item
202202
func DropUint8Ptr(num *uint8, list []*uint8) []*uint8 {
203203
var newList []*uint8
204204
for _, v := range list {
@@ -209,7 +209,7 @@ func DropUint8Ptr(num *uint8, list []*uint8) []*uint8 {
209209
return newList
210210
}
211211

212-
// DropInts returns a new list after dropping the given items
212+
// DropUints8Ptr returns a new list after dropping the given items
213213
func DropUints8Ptr(nums []*uint8, list []*uint8) []*uint8 {
214214
var newList []*uint8
215215
for _, v := range list {
@@ -220,7 +220,7 @@ func DropUints8Ptr(nums []*uint8, list []*uint8) []*uint8 {
220220
return newList
221221
}
222222

223-
// DropStr returns a new list after dropping the given item
223+
// DropStrPtr returns a new list after dropping the given item
224224
func DropStrPtr(num *string, list []*string) []*string {
225225
var newList []*string
226226
for _, v := range list {
@@ -231,7 +231,7 @@ func DropStrPtr(num *string, list []*string) []*string {
231231
return newList
232232
}
233233

234-
// DropInts returns a new list after dropping the given items
234+
// DropStrsPtr returns a new list after dropping the given items
235235
func DropStrsPtr(nums []*string, list []*string) []*string {
236236
var newList []*string
237237
for _, v := range list {
@@ -242,7 +242,7 @@ func DropStrsPtr(nums []*string, list []*string) []*string {
242242
return newList
243243
}
244244

245-
// DropBool returns a new list after dropping the given item
245+
// DropBoolPtr returns a new list after dropping the given item
246246
func DropBoolPtr(num *bool, list []*bool) []*bool {
247247
var newList []*bool
248248
for _, v := range list {
@@ -253,7 +253,7 @@ func DropBoolPtr(num *bool, list []*bool) []*bool {
253253
return newList
254254
}
255255

256-
// DropInts returns a new list after dropping the given items
256+
// DropBoolsPtr returns a new list after dropping the given items
257257
func DropBoolsPtr(nums []*bool, list []*bool) []*bool {
258258
var newList []*bool
259259
for _, v := range list {
@@ -264,7 +264,7 @@ func DropBoolsPtr(nums []*bool, list []*bool) []*bool {
264264
return newList
265265
}
266266

267-
// DropFloat32 returns a new list after dropping the given item
267+
// DropFloat32Ptr returns a new list after dropping the given item
268268
func DropFloat32Ptr(num *float32, list []*float32) []*float32 {
269269
var newList []*float32
270270
for _, v := range list {
@@ -275,7 +275,7 @@ func DropFloat32Ptr(num *float32, list []*float32) []*float32 {
275275
return newList
276276
}
277277

278-
// DropInts returns a new list after dropping the given items
278+
// DropFloat32sPtr returns a new list after dropping the given items
279279
func DropFloat32sPtr(nums []*float32, list []*float32) []*float32 {
280280
var newList []*float32
281281
for _, v := range list {
@@ -286,7 +286,7 @@ func DropFloat32sPtr(nums []*float32, list []*float32) []*float32 {
286286
return newList
287287
}
288288

289-
// DropFloat64 returns a new list after dropping the given item
289+
// DropFloat64Ptr returns a new list after dropping the given item
290290
func DropFloat64Ptr(num *float64, list []*float64) []*float64 {
291291
var newList []*float64
292292
for _, v := range list {
@@ -297,7 +297,7 @@ func DropFloat64Ptr(num *float64, list []*float64) []*float64 {
297297
return newList
298298
}
299299

300-
// DropInts returns a new list after dropping the given items
300+
// DropFloat64sPtr returns a new list after dropping the given items
301301
func DropFloat64sPtr(nums []*float64, list []*float64) []*float64 {
302302
var newList []*float64
303303
for _, v := range list {

fp/even.go

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,101 @@
11
package fp
22

3-
// EvenInt Returns true if n is even
4-
func EvenInt(v int) bool {
3+
// EvenIntP Returns true if n is even
4+
func EvenIntP(v int) bool {
55
return v%2 == 0
66
}
77

8-
// EvenIntPtr Returns true if n is even
9-
func EvenIntPtr(v *int) bool {
8+
// EvenIntPPtr Returns true if n is even
9+
func EvenIntPPtr(v *int) bool {
1010
return *v%2 == 0
1111
}
1212

13-
// EvenInt64 Returns true if n is even
14-
func EvenInt64(v int64) bool {
13+
// EvenInt64P Returns true if n is even
14+
func EvenInt64P(v int64) bool {
1515
return v%2 == 0
1616
}
1717

18-
// EvenInt64Ptr Returns true if n is even
19-
func EvenInt64Ptr(v *int64) bool {
18+
// EvenInt64PPtr Returns true if n is even
19+
func EvenInt64PPtr(v *int64) bool {
2020
return *v%2 == 0
2121
}
2222

23-
// EvenInt32 Returns true if n is even
24-
func EvenInt32(v int32) bool {
23+
// EvenInt32P Returns true if n is even
24+
func EvenInt32P(v int32) bool {
2525
return v%2 == 0
2626
}
2727

28-
// EvenInt32Ptr Returns true if n is even
29-
func EvenInt32Ptr(v *int32) bool {
28+
// EvenInt32PPtr Returns true if n is even
29+
func EvenInt32PPtr(v *int32) bool {
3030
return *v%2 == 0
3131
}
3232

33-
// EvenInt16 Returns true if n is even
34-
func EvenInt16(v int16) bool {
33+
// EvenInt16P Returns true if n is even
34+
func EvenInt16P(v int16) bool {
3535
return v%2 == 0
3636
}
3737

38-
// EvenInt16Ptr Returns true if n is even
39-
func EvenInt16Ptr(v *int16) bool {
38+
// EvenInt16PPtr Returns true if n is even
39+
func EvenInt16PPtr(v *int16) bool {
4040
return *v%2 == 0
4141
}
4242

43-
// EvenInt8 Returns true if n is even
44-
func EvenInt8(v int8) bool {
43+
// EvenInt8P Returns true if n is even
44+
func EvenInt8P(v int8) bool {
4545
return v%2 == 0
4646
}
4747

48-
// EvenInt8Ptr Returns true if n is even
49-
func EvenInt8Ptr(v *int8) bool {
48+
// EvenInt8PPtr Returns true if n is even
49+
func EvenInt8PPtr(v *int8) bool {
5050
return *v%2 == 0
5151
}
5252

53-
// EvenUint Returns true if n is even
54-
func EvenUint(v uint) bool {
53+
// EvenUintP Returns true if n is even
54+
func EvenUintP(v uint) bool {
5555
return v%2 == 0
5656
}
5757

58-
// EvenUintPtr Returns true if n is even
59-
func EvenUintPtr(v *uint) bool {
58+
// EvenUintPPtr Returns true if n is even
59+
func EvenUintPPtr(v *uint) bool {
6060
return *v%2 == 0
6161
}
6262

63-
// EvenUint64 Returns true if n is even
64-
func EvenUint64(v uint64) bool {
63+
// EvenUint64P Returns true if n is even
64+
func EvenUint64P(v uint64) bool {
6565
return v%2 == 0
6666
}
6767

68-
// EvenUint64Ptr Returns true if n is even
69-
func EvenUint64Ptr(v *uint64) bool {
68+
// EvenUint64PPtr Returns true if n is even
69+
func EvenUint64PPtr(v *uint64) bool {
7070
return *v%2 == 0
7171
}
7272

73-
// EvenUint32 Returns true if n is even
74-
func EvenUint32(v uint32) bool {
73+
// EvenUint32P Returns true if n is even
74+
func EvenUint32P(v uint32) bool {
7575
return v%2 == 0
7676
}
7777

78-
// EvenUint32Ptr Returns true if n is even
79-
func EvenUint32Ptr(v *uint32) bool {
78+
// EvenUint32PPtr Returns true if n is even
79+
func EvenUint32PPtr(v *uint32) bool {
8080
return *v%2 == 0
8181
}
8282

83-
// EvenUint16 Returns true if n is even
84-
func EvenUint16(v uint16) bool {
83+
// EvenUint16P Returns true if n is even
84+
func EvenUint16P(v uint16) bool {
8585
return v%2 == 0
8686
}
8787

88-
// EvenUint16Ptr Returns true if n is even
89-
func EvenUint16Ptr(v *uint16) bool {
88+
// EvenUint16PPtr Returns true if n is even
89+
func EvenUint16PPtr(v *uint16) bool {
9090
return *v%2 == 0
9191
}
9292

93-
// EvenUint8 Returns true if n is even
94-
func EvenUint8(v uint8) bool {
93+
// EvenUint8P Returns true if n is even
94+
func EvenUint8P(v uint8) bool {
9595
return v%2 == 0
9696
}
9797

98-
// EvenUint8Ptr Returns true if n is even
99-
func EvenUint8Ptr(v *uint8) bool {
98+
// EvenUint8PPtr Returns true if n is even
99+
func EvenUint8PPtr(v *uint8) bool {
100100
return *v%2 == 0
101101
}

0 commit comments

Comments
 (0)