1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
|
%global _empty_manifest_terminate_build 0
Name: python-PyMonad
Version: 2.4.0
Release: 1
Summary: Data structures and utilities for monadic style functional programming.
License: BSD-3-Clause
URL: https://github.com/jasondelaat/pymonad
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3b/4e/68803065743007b7dc000c543f45f6e407f8a1cbc673fdab016df3ca4b44/PyMonad-2.4.0.tar.gz
BuildArch: noarch
%description
These instructions will get you a copy of the project up and running
on your local machine for development and testing purposes.
1.1 Prerequisites
~~~~~~~~~~~~~~~~~
PyMonad requires Python 3.7+. If installing via ``pip`` then you
will also need `Pip <https://pypi.org/project/pip/>`_ and `Wheel <https://pypi.org/project/wheel/>`_ installed. See those projects for
more information on installing them if necessary.
Potential contributors should additionally install `pylint <https://pypi.org/project/pylint/>`_ and
`pytype <https://pypi.org/project/pytype/>`_ to ensure their code adheres to common style conventions.
1.2 Installing
~~~~~~~~~~~~~~
1.2.1 From the Python Package Index (PyPI) with pip
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
From a command line run:
pip install PyMonad
1.2.2 Manual Build from PyPI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Download the project files from
`https://pypi.org/project/PyMonad/#files <https://pypi.org/project/PyMonad/#files>`_ and from the project
directory run:
python setup.py install
If that doesn't work you may need to run the following instead.
python3 setup.py install
1.2.3 From github
^^^^^^^^^^^^^^^^^
Clone the project repository:
git clone https://github.com/jasondelaat/pymonad.git
Then from the project directory run ``setup.py`` as for the manual
build instructions above.
1.2.4 Example Usage
^^^^^^^^^^^^^^^^^^^
The following example imports the ``tools`` module and uses the
``curry`` function to define a curried addition function.
import pymonad.tools
@pymonad.tools.curry(2) # Pass the expected number of arguments to the curry function.
def add(x, y):
return x + y
# We can call add with all of it's arguments...
print(add(2, 3)) # Prints '5'
# ...or only some of them.
add2 = add(2) # Creates a new function expecting a single arguments
print(add2(3)) # Also prints '5'
1.2.5 Next Steps
^^^^^^^^^^^^^^^^
The PyMonad documentation is a work in progress. For tutorials,
how-to, and more head over to the `PyMonad Documentation Project <https://jasondelaat.github.io/pymonad_docs/>`_.
If you'd like to contribute visit the documentation repository
`here <https://github.com/jasondelaat/pymonad_docs>`_.
1.3 Upgrading from PyMonad 1.3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you've used the 1.x versions of PyMonad you'll notice that
there are a few differences:
1.3.1 Curried functions
^^^^^^^^^^^^^^^^^^^^^^^
Currying functions in PyMonad version 1.x wrapped a function in
an instance of the Reader monad. This is no longer the case and
currying simply produces a new function as one might expect.
The signature of ``curry`` has changed slightly. The new ``curry``
takes two arguments: the number of arguments which need to be
curried and the function.
from pymonad.tools import curry
def add(x, y):
return x + y
curried_add = curry(2, add)
# add = curry(2, add) # If you don't need access to the uncurried version.
``curry`` is itself a curried function so it can be used more
concisely as a decorator.
from pymonad.tools import curry
@curry(2)
def add(x, y):
return x + y
1.3.2 Operators
^^^^^^^^^^^^^^^
Version 2 of PyMonad discourages the use of operators (>>, \\\*, and
&) used in version 1 so old code which uses them will
break. Operators have been removed from the default monad
implementation but are still available for users that still wish
to use them in the ``operators`` package. To use operators:
# Instead of this:
# import pymonad.maybe
# Do this:
import pymonad.operators.maybe
While it's unlikely operators will be removed entirely, it is
strongly suggested that users write code that doesn't require
them.
1.3.3 Renamed Methods
^^^^^^^^^^^^^^^^^^^^^
The ``fmap`` method has been renamed to simply ``map`` and ``unit`` is now called ``insert``.
from pymonad.maybe import Maybe
def add2(x):
return x + 2
m = (Maybe.insert(1)
.map(add2)
)
print(m) # Just 3
1.3.4 Applicative Syntax
^^^^^^^^^^^^^^^^^^^^^^^^
Previously applicative syntax used the ``&`` operator or the ``amap``
method. ``amap`` still exists but there's now another way to use
applicatives: ``apply().to_arguments()``
from pymonad.tools import curry
from pymonad.maybe import Maybe, Just
@curry(2)
def add(x, y):
return x + y
a = Just(1)
b = Just(2)
c = Maybe.apply(add).to_arguments(a, b)
print(c) # Just 3
If the function passed to ``apply`` accepts multiple arguments then
it *must* be a curried function.
1.3.5 New ``then`` method
^^^^^^^^^^^^^^^^^^^^^^^^^
The ``then`` method combines the functionality of both ``map`` and
``bind``. It first tries to ``bind`` the function passed to it and,
if that doesn't work, tries ``map`` instead. It will be slightly
less efficient than using ``map`` and ``bind`` directly but frees
users from having to worry about specifically which functions are
being used where.
from pymonad.tools import curry
from pymonad.maybe import Maybe, Just, Nothing
@curry(2)
def add(x, y):
return x + y
@curry(2)
def div(y, x):
if y == 0:
return Nothing
else:
return Just(x / y)
m = (Maybe.insert(2)
.then(add(2)) # Uses map
.then(div(4)) # Uses bind
)
print(m) # Just 1.0
1.3.6 Getting values out of ``Maybe`` and ``Either``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Previously, if you need to get a value out of a ``Maybe`` or an
``Either`` after a series of calculations you would have to access
the ``.value`` property directly. By the very nature of these two
monads, ``.value`` may not contain valid data and checking whether
the data is valid or not is the problem these monads are supposed
to solve. As of PyMonad 2.3.0 there are methods -- ``maybe`` and
``either`` -- for properly extracting values from these
monads.
Given a ``Maybe`` value ``m``, the ``maybe`` method takes a default
value, which will be returned if ``m`` is ``Nothing``, and a function
which will be applied to the value inside of a ``Just``.
from pymonad.maybe import Just, Nothing
a = Just(2)
b = Nothing
print(a.maybe(0, lambda x: x)) # 2
print(b.maybe(0, lambda x: x)) # 0
The ``either`` method works essentially the same way but takes two
functions as arguments. The first is applied if the value is a
``Left`` value and the second if it's a ``Right``.
from pymonad.either import Left, Right
a = Right(2)
b = Left('Invalid')
print(a.either(lambda x: f'Sorry, {x}', lambda x: x)) # 2
print(b.either(lambda x: f'Sorry, {x}', lambda x: x)) # Sorry, Invalid
1.4 Note on efficiency in versions <2.3.5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In pymonad versions 2.3.4 and earlier, an error in the
implementation of ``then`` meant that some monad
types executed ``then`` with exponential complexity. As of version
2.3.5 this has been corrected. All monad types now execute ``then``
in linear time. A similar problem occured with the ``map`` and
``bind`` methods for the State monad which have also been fixed in
2.3.5
If you're using an earlier version of pymonad upgrading to 2.3.5
is highly recommended.
%package -n python3-PyMonad
Summary: Data structures and utilities for monadic style functional programming.
Provides: python-PyMonad
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-PyMonad
These instructions will get you a copy of the project up and running
on your local machine for development and testing purposes.
1.1 Prerequisites
~~~~~~~~~~~~~~~~~
PyMonad requires Python 3.7+. If installing via ``pip`` then you
will also need `Pip <https://pypi.org/project/pip/>`_ and `Wheel <https://pypi.org/project/wheel/>`_ installed. See those projects for
more information on installing them if necessary.
Potential contributors should additionally install `pylint <https://pypi.org/project/pylint/>`_ and
`pytype <https://pypi.org/project/pytype/>`_ to ensure their code adheres to common style conventions.
1.2 Installing
~~~~~~~~~~~~~~
1.2.1 From the Python Package Index (PyPI) with pip
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
From a command line run:
pip install PyMonad
1.2.2 Manual Build from PyPI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Download the project files from
`https://pypi.org/project/PyMonad/#files <https://pypi.org/project/PyMonad/#files>`_ and from the project
directory run:
python setup.py install
If that doesn't work you may need to run the following instead.
python3 setup.py install
1.2.3 From github
^^^^^^^^^^^^^^^^^
Clone the project repository:
git clone https://github.com/jasondelaat/pymonad.git
Then from the project directory run ``setup.py`` as for the manual
build instructions above.
1.2.4 Example Usage
^^^^^^^^^^^^^^^^^^^
The following example imports the ``tools`` module and uses the
``curry`` function to define a curried addition function.
import pymonad.tools
@pymonad.tools.curry(2) # Pass the expected number of arguments to the curry function.
def add(x, y):
return x + y
# We can call add with all of it's arguments...
print(add(2, 3)) # Prints '5'
# ...or only some of them.
add2 = add(2) # Creates a new function expecting a single arguments
print(add2(3)) # Also prints '5'
1.2.5 Next Steps
^^^^^^^^^^^^^^^^
The PyMonad documentation is a work in progress. For tutorials,
how-to, and more head over to the `PyMonad Documentation Project <https://jasondelaat.github.io/pymonad_docs/>`_.
If you'd like to contribute visit the documentation repository
`here <https://github.com/jasondelaat/pymonad_docs>`_.
1.3 Upgrading from PyMonad 1.3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you've used the 1.x versions of PyMonad you'll notice that
there are a few differences:
1.3.1 Curried functions
^^^^^^^^^^^^^^^^^^^^^^^
Currying functions in PyMonad version 1.x wrapped a function in
an instance of the Reader monad. This is no longer the case and
currying simply produces a new function as one might expect.
The signature of ``curry`` has changed slightly. The new ``curry``
takes two arguments: the number of arguments which need to be
curried and the function.
from pymonad.tools import curry
def add(x, y):
return x + y
curried_add = curry(2, add)
# add = curry(2, add) # If you don't need access to the uncurried version.
``curry`` is itself a curried function so it can be used more
concisely as a decorator.
from pymonad.tools import curry
@curry(2)
def add(x, y):
return x + y
1.3.2 Operators
^^^^^^^^^^^^^^^
Version 2 of PyMonad discourages the use of operators (>>, \\\*, and
&) used in version 1 so old code which uses them will
break. Operators have been removed from the default monad
implementation but are still available for users that still wish
to use them in the ``operators`` package. To use operators:
# Instead of this:
# import pymonad.maybe
# Do this:
import pymonad.operators.maybe
While it's unlikely operators will be removed entirely, it is
strongly suggested that users write code that doesn't require
them.
1.3.3 Renamed Methods
^^^^^^^^^^^^^^^^^^^^^
The ``fmap`` method has been renamed to simply ``map`` and ``unit`` is now called ``insert``.
from pymonad.maybe import Maybe
def add2(x):
return x + 2
m = (Maybe.insert(1)
.map(add2)
)
print(m) # Just 3
1.3.4 Applicative Syntax
^^^^^^^^^^^^^^^^^^^^^^^^
Previously applicative syntax used the ``&`` operator or the ``amap``
method. ``amap`` still exists but there's now another way to use
applicatives: ``apply().to_arguments()``
from pymonad.tools import curry
from pymonad.maybe import Maybe, Just
@curry(2)
def add(x, y):
return x + y
a = Just(1)
b = Just(2)
c = Maybe.apply(add).to_arguments(a, b)
print(c) # Just 3
If the function passed to ``apply`` accepts multiple arguments then
it *must* be a curried function.
1.3.5 New ``then`` method
^^^^^^^^^^^^^^^^^^^^^^^^^
The ``then`` method combines the functionality of both ``map`` and
``bind``. It first tries to ``bind`` the function passed to it and,
if that doesn't work, tries ``map`` instead. It will be slightly
less efficient than using ``map`` and ``bind`` directly but frees
users from having to worry about specifically which functions are
being used where.
from pymonad.tools import curry
from pymonad.maybe import Maybe, Just, Nothing
@curry(2)
def add(x, y):
return x + y
@curry(2)
def div(y, x):
if y == 0:
return Nothing
else:
return Just(x / y)
m = (Maybe.insert(2)
.then(add(2)) # Uses map
.then(div(4)) # Uses bind
)
print(m) # Just 1.0
1.3.6 Getting values out of ``Maybe`` and ``Either``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Previously, if you need to get a value out of a ``Maybe`` or an
``Either`` after a series of calculations you would have to access
the ``.value`` property directly. By the very nature of these two
monads, ``.value`` may not contain valid data and checking whether
the data is valid or not is the problem these monads are supposed
to solve. As of PyMonad 2.3.0 there are methods -- ``maybe`` and
``either`` -- for properly extracting values from these
monads.
Given a ``Maybe`` value ``m``, the ``maybe`` method takes a default
value, which will be returned if ``m`` is ``Nothing``, and a function
which will be applied to the value inside of a ``Just``.
from pymonad.maybe import Just, Nothing
a = Just(2)
b = Nothing
print(a.maybe(0, lambda x: x)) # 2
print(b.maybe(0, lambda x: x)) # 0
The ``either`` method works essentially the same way but takes two
functions as arguments. The first is applied if the value is a
``Left`` value and the second if it's a ``Right``.
from pymonad.either import Left, Right
a = Right(2)
b = Left('Invalid')
print(a.either(lambda x: f'Sorry, {x}', lambda x: x)) # 2
print(b.either(lambda x: f'Sorry, {x}', lambda x: x)) # Sorry, Invalid
1.4 Note on efficiency in versions <2.3.5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In pymonad versions 2.3.4 and earlier, an error in the
implementation of ``then`` meant that some monad
types executed ``then`` with exponential complexity. As of version
2.3.5 this has been corrected. All monad types now execute ``then``
in linear time. A similar problem occured with the ``map`` and
``bind`` methods for the State monad which have also been fixed in
2.3.5
If you're using an earlier version of pymonad upgrading to 2.3.5
is highly recommended.
%package help
Summary: Development documents and examples for PyMonad
Provides: python3-PyMonad-doc
%description help
These instructions will get you a copy of the project up and running
on your local machine for development and testing purposes.
1.1 Prerequisites
~~~~~~~~~~~~~~~~~
PyMonad requires Python 3.7+. If installing via ``pip`` then you
will also need `Pip <https://pypi.org/project/pip/>`_ and `Wheel <https://pypi.org/project/wheel/>`_ installed. See those projects for
more information on installing them if necessary.
Potential contributors should additionally install `pylint <https://pypi.org/project/pylint/>`_ and
`pytype <https://pypi.org/project/pytype/>`_ to ensure their code adheres to common style conventions.
1.2 Installing
~~~~~~~~~~~~~~
1.2.1 From the Python Package Index (PyPI) with pip
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
From a command line run:
pip install PyMonad
1.2.2 Manual Build from PyPI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Download the project files from
`https://pypi.org/project/PyMonad/#files <https://pypi.org/project/PyMonad/#files>`_ and from the project
directory run:
python setup.py install
If that doesn't work you may need to run the following instead.
python3 setup.py install
1.2.3 From github
^^^^^^^^^^^^^^^^^
Clone the project repository:
git clone https://github.com/jasondelaat/pymonad.git
Then from the project directory run ``setup.py`` as for the manual
build instructions above.
1.2.4 Example Usage
^^^^^^^^^^^^^^^^^^^
The following example imports the ``tools`` module and uses the
``curry`` function to define a curried addition function.
import pymonad.tools
@pymonad.tools.curry(2) # Pass the expected number of arguments to the curry function.
def add(x, y):
return x + y
# We can call add with all of it's arguments...
print(add(2, 3)) # Prints '5'
# ...or only some of them.
add2 = add(2) # Creates a new function expecting a single arguments
print(add2(3)) # Also prints '5'
1.2.5 Next Steps
^^^^^^^^^^^^^^^^
The PyMonad documentation is a work in progress. For tutorials,
how-to, and more head over to the `PyMonad Documentation Project <https://jasondelaat.github.io/pymonad_docs/>`_.
If you'd like to contribute visit the documentation repository
`here <https://github.com/jasondelaat/pymonad_docs>`_.
1.3 Upgrading from PyMonad 1.3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you've used the 1.x versions of PyMonad you'll notice that
there are a few differences:
1.3.1 Curried functions
^^^^^^^^^^^^^^^^^^^^^^^
Currying functions in PyMonad version 1.x wrapped a function in
an instance of the Reader monad. This is no longer the case and
currying simply produces a new function as one might expect.
The signature of ``curry`` has changed slightly. The new ``curry``
takes two arguments: the number of arguments which need to be
curried and the function.
from pymonad.tools import curry
def add(x, y):
return x + y
curried_add = curry(2, add)
# add = curry(2, add) # If you don't need access to the uncurried version.
``curry`` is itself a curried function so it can be used more
concisely as a decorator.
from pymonad.tools import curry
@curry(2)
def add(x, y):
return x + y
1.3.2 Operators
^^^^^^^^^^^^^^^
Version 2 of PyMonad discourages the use of operators (>>, \\\*, and
&) used in version 1 so old code which uses them will
break. Operators have been removed from the default monad
implementation but are still available for users that still wish
to use them in the ``operators`` package. To use operators:
# Instead of this:
# import pymonad.maybe
# Do this:
import pymonad.operators.maybe
While it's unlikely operators will be removed entirely, it is
strongly suggested that users write code that doesn't require
them.
1.3.3 Renamed Methods
^^^^^^^^^^^^^^^^^^^^^
The ``fmap`` method has been renamed to simply ``map`` and ``unit`` is now called ``insert``.
from pymonad.maybe import Maybe
def add2(x):
return x + 2
m = (Maybe.insert(1)
.map(add2)
)
print(m) # Just 3
1.3.4 Applicative Syntax
^^^^^^^^^^^^^^^^^^^^^^^^
Previously applicative syntax used the ``&`` operator or the ``amap``
method. ``amap`` still exists but there's now another way to use
applicatives: ``apply().to_arguments()``
from pymonad.tools import curry
from pymonad.maybe import Maybe, Just
@curry(2)
def add(x, y):
return x + y
a = Just(1)
b = Just(2)
c = Maybe.apply(add).to_arguments(a, b)
print(c) # Just 3
If the function passed to ``apply`` accepts multiple arguments then
it *must* be a curried function.
1.3.5 New ``then`` method
^^^^^^^^^^^^^^^^^^^^^^^^^
The ``then`` method combines the functionality of both ``map`` and
``bind``. It first tries to ``bind`` the function passed to it and,
if that doesn't work, tries ``map`` instead. It will be slightly
less efficient than using ``map`` and ``bind`` directly but frees
users from having to worry about specifically which functions are
being used where.
from pymonad.tools import curry
from pymonad.maybe import Maybe, Just, Nothing
@curry(2)
def add(x, y):
return x + y
@curry(2)
def div(y, x):
if y == 0:
return Nothing
else:
return Just(x / y)
m = (Maybe.insert(2)
.then(add(2)) # Uses map
.then(div(4)) # Uses bind
)
print(m) # Just 1.0
1.3.6 Getting values out of ``Maybe`` and ``Either``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Previously, if you need to get a value out of a ``Maybe`` or an
``Either`` after a series of calculations you would have to access
the ``.value`` property directly. By the very nature of these two
monads, ``.value`` may not contain valid data and checking whether
the data is valid or not is the problem these monads are supposed
to solve. As of PyMonad 2.3.0 there are methods -- ``maybe`` and
``either`` -- for properly extracting values from these
monads.
Given a ``Maybe`` value ``m``, the ``maybe`` method takes a default
value, which will be returned if ``m`` is ``Nothing``, and a function
which will be applied to the value inside of a ``Just``.
from pymonad.maybe import Just, Nothing
a = Just(2)
b = Nothing
print(a.maybe(0, lambda x: x)) # 2
print(b.maybe(0, lambda x: x)) # 0
The ``either`` method works essentially the same way but takes two
functions as arguments. The first is applied if the value is a
``Left`` value and the second if it's a ``Right``.
from pymonad.either import Left, Right
a = Right(2)
b = Left('Invalid')
print(a.either(lambda x: f'Sorry, {x}', lambda x: x)) # 2
print(b.either(lambda x: f'Sorry, {x}', lambda x: x)) # Sorry, Invalid
1.4 Note on efficiency in versions <2.3.5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In pymonad versions 2.3.4 and earlier, an error in the
implementation of ``then`` meant that some monad
types executed ``then`` with exponential complexity. As of version
2.3.5 this has been corrected. All monad types now execute ``then``
in linear time. A similar problem occured with the ``map`` and
``bind`` methods for the State monad which have also been fixed in
2.3.5
If you're using an earlier version of pymonad upgrading to 2.3.5
is highly recommended.
%prep
%autosetup -n PyMonad-2.4.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-PyMonad -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 2.4.0-1
- Package Spec generated
|