Releases: Yonaba/Moses
Releases · Yonaba/Moses
2.1.0
Breaking changes
- Renamed
toArray
topack
- Renamed
reduceby
toreduceBy
- Removed
skip
as alias tolast
- Changed prototype :
each(t, f, ...)
is noweach(t, f)
- Changed prototype :
eachi(t, f, ...)
is noweachi(t, f)
- Changed prototype :
adjust(t, key, f, ...)
is nowadjust(t, key, f)
- Changed prototype :
countf(t, f, ...)
is nowcountf(t, f)
- Changed prototype :
map(t, f, ...)
is nowmap(t, f)
- Changed prototype :
reduceBy(t, f, pred, state, ...)
is nowreduceBy(t, f, pred, state)
- Changed prototype :
select(t, f, ...)
is nowselect(t, f)
- Changed prototype :
reject(t, f, ...)
is nowreject(t, f)
- Changed prototype :
all(t, f, ...)
is nowall(t, f)
- Changed prototype :
invoke(t, method, ...)
is nowinvoke(t, method)
- Changed prototype :
min(t, transform, ...)
is nowmin(t, transform)
- Changed prototype :
max(t, transform, ...)
is nowmax(t, transform)
- Changed prototype :
countBy(t, iter, ...)
is nowcountBy(t, iter)
- Changed prototype :
groupBy(t, iter, ...)
is nowgroupBy(t, iter)
- Changed prototype :
selectWhile(array, f, ...)
is nowselectWhile(array, f)
- Changed prototype :
dropWhile(array, f, ...)
is nowdropWhile(array, f)
- Changed prototype :
findIndex(array, pred, ...)
is nowfindIndex(array, pred)
- Changed prototype :
findLastIndex(array, pred, ...)
is nowfindLastIndex(array, pred)
- Changed prototype :
chunk(array, f, ...)
is nowchunk(array, f)
- Changed prototype :
times(iter, n, ...)
is nowtimes(iter, n)
- Changed prototype :
template(id, ...)
is nowtemplate(id)
- Changed prototype :
tap(obj, f, ...)
is nowtap(obj, f)
- Changed prototype :
result(obj, method, ...)
is nowresult(obj, method)
- Changed prototype :
intersection(array, ...)
is nowintersection(array)
Other changes
- Renamed
array
totabulate
, with no alias - Moved
invert
to object functions
Additions
- Added
best
in table functions - Added
allEqual
in table functions - Added
sortedk
iterator in array functions - Added
sortedv
iterator in array functions - Added
disjoint
in array functions - Added
nsorted
in array functions - Added
duplicates
in array functions - Added
xpairs
in array functions - Added
xpairsRight
in array functions - Added
call
in utility functions - Added
type
in object functions - Added
spreadPath
in object functions - Added
flattenPath
in object functions - Added
thread
in utility functions - Added
threadRight
in utility functions - Added
iterlen
in utility functions - Added
skip
in utility functions - Added
both
in utility functions - Added
either
in utility functions - Added
neither
in utility functions - Added
dispatch
in utility functions - Added
noarg
in utility functions
2.0.0
2.0.0 (08/23/2018)
Breaking changes
- library functions now accept iterators prototyped as
f(v, k, ...)
instead off(k, v, ...)
.
It improves the benefits of chaning and helps writting a clear functional-style code.
Library functions affected with this breaking change are :
each
,eachi
,countf
,map
,reduceby
,select
,reject
,all
,groupBy
,countBy
,
selectWhile
,dropWhile
,findIndex
,findLastIndex
,chunk
. reduceby
is now prototyped asreduceby(t, f, pred, state)
instead ofreduceby(t, f, state, pred)
.times
is now prototyped astimes(iter, n, ...)
instead oftimes(iter, n, ...)
.bindAll
was renamed tobindall
functions
no longer accept optionalsort
third argumentssliding
was renamed tooverlapping
- Improved
range
to handle negative progressions and start the count from 1. memoize
no longer takes ahash
function.
Other changes
- Made
shift
a default library function, andpop
its alias. - Moved
shuffle
from table function to array functions - Made
iterator
to accept an extra optional argn
Additions
Added support for operators
- Arithmetic operators :
add
,sub
,mul
,div
,mod
,exp
,pow
(alias toexp
),unm
,neg
(alias tounm
),floordiv
,intdiv
- Relational operators :
eq
,neq
,lt
,gt
,le
,ge
- Logical operators :
land
,lor
,lnot
- Concatenation operator :
concat
- Length operator :
length
,len
(alias tolength
)
Added functions
- Added
adjust
in table functions - Added
xprod
in array functions - Added
prepend
in array functions - Added
zeros
in array functions - Added
ones
in array functions - Added
vector
in array functions - Added
aperture
in array functions - Added
sum
in array functions - Added
product
in array functions - Added
mean
in array functions - Added
median
in array functions - Added
powerset
in array functions - Added
zipWith
in array functions - Added
pairwise
in array functions - Added
applySpec
in utility functions - Added
nthArg
in utility functions - Added
cond
in utility functions - Added
castArray
in utility functions - Added
unary
in utility functions - Added
ary
in utility functions - Added
rearg
in utility functions - Added
unfold
in utility functions - Added
converge
in utility functions - Added
path
in object functions
Added function aliases
- Added
update
as alias toadjust
- Added
always
as alias toconstant
- Added
intersperse
as alias tointerpose
- Added
sliding
as alias toaperture
- Added
tabulate
as alias toarray
- Added
matches
as alias toisEqual
- Added
average
as alias tomean
- Added
nAry
as alias toary
- Added
transposeWith
as alias tozipWith
1.6.1
- Added
_.array
- Added
_.clear
- Added
_.time
- Added
_.before
1.6.0
- Added
_.toObj
- Added
_.noop
- Added
_.partialRight
- Added
_.flip
- Added
_.overArgs
- Added
_.over
- Added
_.overEvery
- Added
_.overSome
1.5.1
- Added
_.curry
- Added
_.fill
- Added
.transpose
as an alias to_.zip
1.5.0
Additions
-
Added
_.bind2
-
Added
_.reduceby
-
Added
_.iterator
(and alias_.iter
) -
Added
_.sliding
-
Added
_.sample
-
Added
_.sampleProb
-
Added
_.where
-
Added
_.sortBy
-
Added
_.findIndex
-
Added
_.findLastIndex
-
Added
_.bindAll
-
Added
_.partial
-
Added
_.kvpairs
-
Added
_.property
-
Added
_.propertyOf
-
Added
_.constant
-
Added parameter
pad
to_.partition
Changes, bugfixes
- Improved
_.select
- Fixed
_.compose
- Made
_.contains
as an alias to_.include
- Improved
_.all
- Fixed
_.size
- Improved
_.map
to map key-value pairs to key-value pairs - Fixed
_.partition
to generate an error for partition size < 1.
1.4.0
Changes
- Aliases are available by default
_.find
is no longer an alias to_.detect
- Provided a new implementation of
_.unique
, removed argument_.isSorted
_.isNil
now returns true if arg is nil, an empty string or empty table and false otherwise._.size
now returns 0 for empty args instead ofnil
_.unique
no longer acceptsiter
argument to transform original array values._.cycle
argumentn
now defaults to 1._.groupBy
no longer handlesiter
as a string
Renamed
- Renamed alias
_.uId
to_.uid
- Renamed
_.add
to_.addTop
- Renamed
_.uniq
as alias to_.unique
- Renamed
_.symmetric_difference
to_.symmetricDifference
Removed
- Removed
_.paired
Improvements & bugfixes
_.reduce
now supports an array of booleans_.pick
now picks false values_.concat
argsi
andj
defaults explicitely to 1 and array length (for compatibility with LuaJIT)_.pop
now takes an optional extra-arg n, to be the number of values to be popped_.unshift
now takes an optional extra-arg n, to be the number of values to be retrieved- Moved explicitely
_.toArray
to array functions _.functions
accepts an extra-arg to prevent from looking-up for methods in metatables.
New functions (and aliases)
- Added
_.find
- Added
_.pipe
- Added
_.complement
- Added
_.juxtapose
and alias_.juxt
- Added
_.isunique
and alias_.isuniq
- Added
_.rep
- Added
_.interleave
- Added
_.interpose
- Added
_.partition
and alias_.part
- Added
_.permutation
and alias_.perm
- Added
_.compare
as alias to_.isEqual
- Added
_.isIterable
- Added
_.toBoolean
- Added
_.pull
and alias_.remove
- Added
_.at
New aliases
- Added
_.xor
as alias to_.symmetricDifference