Skip to content

Releases: Technologicat/unpythonic

Version 0.8.8

25 Sep 08:54
Compare
Choose a tag to compare

"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
  • 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 for if '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 bug
  • dyn: skip pushing/popping a scope if no bindings given

Version 0.8.7

24 Sep 17:41
Compare
Choose a tag to compare

"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, are rmap, 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: try reversed(...), if TypeError then reversed(tuple(...))
  • add butlast, butlastn, partition

Version 0.8.6

20 Sep 15:03
Compare
Choose a tag to compare

"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

19 Sep 14:44
Compare
Choose a tag to compare

"Liberté, égalité, fraternité" edition:

  • add gtrampolined: TCO (tail chaining) for generators
  • add gmemoize: memoization for generators
  • bring convenience features of dyn to parity with env

Version 0.8.4

18 Sep 13:37
Compare
Choose a tag to compare

"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 use itertools where possible
  • remove unnecessary conversions from iterator to generator

Version 0.8.3

18 Sep 09:31
Compare
Choose a tag to compare

"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.
  • Add iterate: return an infinite generator yielding x, 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.

For usage examples see test() in it.py.

Version 0.8.2

17 Sep 06:38
Compare
Choose a tag to compare

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 is reversed(some_ll)
  • 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, or c for the new currying variants.
    • The i suffix for iterable input always goes last.

Version 0.8.1

14 Sep 09:52
Compare
Choose a tag to compare

New feature:

  • Add a toy nondeterministic evaluator forall; see unpythonic.amb module

Enhancements:

  • Improve curry; see updated examples in README
  • cons structures are now pickleable
  • unpythonic.llist no longer depends on unpythonic.tco

Version 0.8.0

12 Sep 13:31
Compare
Choose a tag to compare

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

04 Sep 12:44
Compare
Choose a tag to compare
  • Add batteries for functools: unpythonic.fun
  • Add cons and friends: unpythonic.llist (not loaded by default; depends on unpythonic.tco)
  • Bugfix: rc.py was missing from the distribution, breaking TCO