Releases: Technologicat/unpythonic
Releases · Technologicat/unpythonic
Version 0.8.8
"More spicy" edition:
Changes:
curry
: by default,TypeError
if args remaining when exiting top-level curry context- add dynvar
curry_toplevel_passthrough
to switch the error off
- add dynvar
rotate
now conceptually shifts the arg slots, not the values; this variant seems easier to reason about.- accept just tuple (not list) as the pythonic multiple-return-values thing in
curry
,compose
,pipe
New:
- add
make_dynvar
, to set a default value for a dynamic variable. Eliminates the need forif 'x' in dyn
checks. - as an optional extra, add a MacroPy3 based autocurry macro, which automatically curries all function calls that lexically reside in a
with curry
block. (Make your Python look somewhat like Haskell.)
Bugfixes/optimizations:
nth
: fix off-by-one bugdyn
: skip pushing/popping a scope if no bindings given
Version 0.8.7
"More iterable" edition:
Changes:
scanr
now syncs the left ends of multiple inputs, as it should.- robustness: add a typecheck to
ShadowedSequence.__init__
- rename: for consistency with
rscanl
,rfoldl
, the new names of sync right ends of multiple inputs, then map/zip from the right, arermap
,rzip
. llist
,lreverse
are now more ducky/pythonic.
New:
- add
rscanl
,rscanl1
,rfoldl
,rreducel
: reverse each input, then left-scan/left-fold. This approach syncs the right ends if multiple inputs. - add
mapr
,zipr
(map-then-reverse): sync left ends of multiple inputs, then map/zip from the right. - add convenience function
rev
: tryreversed(...)
, ifTypeError
thenreversed(tuple(...))
- add
butlast
,butlastn
,partition
Version 0.8.6
"Adding in the missing parts" edition:
New features:
- add
unfold
,unfold1
: generate a sequence corecursively - add memoization for iterables (
imemoize
,fimemoize
)
Enhancements:
call
now accepts also args (see docstring)- gtco: allow tail-chaining into any iterable
- document new features in README (also those from 0.8.5)
Bugfixes:
- fix bugs in gtco
- strip trampolines correctly in nested generator-TCO chains
- fix handling of generator return values
Version 0.8.5
"Liberté, égalité, fraternité" edition:
- add
gtrampolined
: TCO (tail chaining) for generators - add
gmemoize
: memoization for generators - bring convenience features of
dyn
to parity withenv
Version 0.8.4
"Hunt for the missing operators" edition:
- Parameterize scan and fold; can now terminate on longest input
- Add
map_longest
,mapr_longest
,zipr_longest
unpack
is now curry-friendly
Technical enhancements:
- refactor
unpythonic.it
to useitertools
where possible - remove unnecessary conversions from iterator to generator
Version 0.8.3
"I have always wanted to code in Listhonkell" edition:
- Add
scanl
,scanr
: lazy partial fold (a.k.a. accumulate) that returns a generator yielding intermediate results.- Also provided are
scanl1
,scanr1
variants with one input sequence and optional init.
- Also provided are
- Add
iterate
: return an infinite generator yieldingx
,f(x)
,f(f(x))
, ...- 1-in-1-out (
iterate1
) and n-in-n-out (iterate
) variants are provided. The n-in-n-out variant unpacks each result to the argument list of the next call.
- 1-in-1-out (
For usage examples see test()
in it.py.
Version 0.8.2
New features:
- Add currying compose functions and currying pipe (names suffixed with
c
)
Enhancements:
- Improve reversing support in linked lists:
- Linked lists now support the builtin
reversed
(by internally building a reversed copy) llist
just extracts the internal reversed copy when the input isreversed(some_ll)
- Linked lists now support the builtin
- Prevent stacking curried wrappers in
curry
- More logical naming for the
compose
variants.- The first suffix, if present, is either
1
for one-arg variants, orc
for the new currying variants. - The
i
suffix for iterable input always goes last.
- The first suffix, if present, is either
Version 0.8.1
New feature:
- Add a toy nondeterministic evaluator
forall
; seeunpythonic.amb
module
Enhancements:
- Improve curry; see updated examples in README
- cons structures are now pickleable
unpythonic.llist
no longer depends onunpythonic.tco
Version 0.8.0
Features:
unpythonic.it
: batteries for itertools (new)unpythonic.fun
: batteries for functools (significant changes)- m-in-n-out for pipes and function composition (new)
unpythonic.fup
: functionally update sequences and mappings (new)- Load
unpythonic.llist
by default (easier, no special cases for the user)
Bugfix:
curry
with passthrough: use up all kwargs at the first step which got too many positional arguments (since no simple reasonable way to decide to which later application they would belong)
Version 0.7.0
- Add batteries for functools:
unpythonic.fun
- Add
cons
and friends:unpythonic.llist
(not loaded by default; depends onunpythonic.tco
) - Bugfix:
rc.py
was missing from the distribution, breaking TCO