Releases: kamstrup/fn
1.0.0
1.0 RC2, formally 0.9.9
One API change did sneak in after all, but it should not affect anyone drastically.
API changes
- seq.ForEach and seq.ForEachIndex now returns an Opt, and not another Seq. The opt can naturally encapsulate errors produced by the seq, which was more clumsy and unintuitive before
- Removed seq.Error() which was a bit confusing, and only really there to support the previous error handling semantics in the for-each functions. Also removed the corresponding seq.Fallible interface.
- Removed unused function type declarations Func0, Func0Err, Func1Err, Func2Err, FuncMapErr, PredicateErr. They were just polluting the namespace
New API
- Tuple.Equals
- Map.Copy and Set.Copy
Bug Fixes
- Fixed a bug in seq.SplitOf.First if the splits contained empty elements
And more polish to the docs in many places
RC1 towards 1.0
Hopefully last round of API changes before 1.0 <3
Changed API
- seq.Chan is now a
chan T
not just a<- chan T
- seq.Append renamed to seq.MakeSlice for better consistency with the rest of the MakeXXX functions
- MakeSet, MakeSlice, MakeMap, and GroupBy now work with the native seq.XXX types (Set, Slice, Map, and Map)
- opt.CallRecover -> opt.Recovering
- opt.Apply and opt.Call - removed. These constructors duplicated the functionality in opt.Returning and opt.Map
New API
- Map.Get() and Map.Contains() for nice function composition
- Set.Contains, Set.Union, Set.Intersect
Big documentation rework, with a lot of focus on how the native types seq.Slice,Set,Map,Chan can be used with normal Go idioms and builtins.
Inching closer to 1.0
New API
- The Map type has grown methods Keys() and Values(). So you can easily get a seq over the keys or values in a map via
seq.MapAs(m).Keys()
orseq.MapAs(m).Values()
respectively
API tweaks:
- Seq.ToSlice() now explicitly require implementations to return a new slice.
v0.9.0 almost 1.0!
All blockers for 1.0 is out of the way -- which was primarily proper error handling in seq.Go().
NOTE: The API is still not set in stone, but we are very close! <3 Only minor tweaks expected
This release brings new toys:
opt.Promise
for async/future based programmingseq.ValuesOf()
is a new seq type that lazily unwraps opts until it sees an error- New collector func for reduce,
seq.MakeChan
- New functions in the
slice
package:slice.Trim
andslice.Delete
- Rename
slice.Gen
toGenIndex
and introduce a newGen()
where the generator func does not take an arg.
Fixes:
- Proper error handling in
seq.Go()
- Fix error handling in
ConcatOf()
- Typos in docs
0.4.0: Inching closer to the Fabled v1.0
Headlines for v0.4.0
Removals and breaks:
- Removed Slice.AsSlice as it inspires misunderstandings. A Slice[T] is a []T in almost all practical aspects
- seqio unchanged, but marked as experimental
- The
try
package has been merged into theopt
package
New API:
- The
Seq
interface has grown a Limit(n) function, which is a lazy counterpart to Take(n). There is a static helper LimitOf() for anyone implementing their own seqs. - New helpers
opt.Caller
andopt.Mapper
for mapping a Seq[T] into a Seq[Opt[T]] which is useful for error handling - New functions in the slice package: Reverse, Shuffle, First, Last, HasPrefix, HasSuffix, Equal
Other points of interest:
- Lots of doc updates about how some types interoperate with standard Go types. In particular Slice[T] is is a []T, Map[K,V] is a map[K]V, similar for Set[T], String, and Chan[T]
- Various Seq impls had a common issue in TakeWhile which has been fixed
- Lots of cleanup in the repository layout and file naming
- Lots and lots of doc updates and clarifications
Doc fixes and minor API cleanup
Mostly a lot of tweaking to the docs.
Added experimental seqjson
package.
Removed slice.Dict()
which was a niche API that no one would probably ever use.
API Overhaul
We got some great feedback recently and as a result the API has been restructured a bit. All the core features remain the same.
The primary theme is to move everything towards more standard Go idioms, and be "less functional" in the naming scheme. Another focus has been to split up into sub packages to allow consumers to only use subsets of the API if they prefer that. It also makes auto-completion nicer and the code reads a bit better.
- All seq related functionality moved into
seq
package - Opts moved into
opt
package - The
fnio
package renamed toseqio
- Assoc renamed to Map
- Array renamed to Slice
- MapOf() renamed to MappingOf()
- Add PrependOf() seq type
- Added special seq type for SingletOf()
- The
fx
package has been renamed toslice
- seq.Into() renamed to seq.Reduce() and reordered the args to fit the rest of the code style
- Add seq.Last(), seq.One(), and seq.IsEmpty()
- Lots and lots of doc updates
- Fixed some bugs where mySeq.TakeWhile() would sometimes drop an element (the head wasn't pushed back on the tail seq when the predicate became false)
0.2 series, first release
Note: fn is still undergoing API restructuring, so no API stability guarantees just yet.
This release adds:
- A math package
- Much much improved documentation
- Error handling now in place for the APIs that need it. To this end fn.Into() now returns Opt[T] and not T directly.
- A "slimmed down" functional package, "fx", for quick 1-liners
- fio mostly stable
- a "fntry" package
- RangeOf, RangeFrom and other range seqs much improved
- Advanced collector functions for use with fn.Into.
- Top level types for Chan, Assoc, and Set similar to Array
- fn.Do() for executing a seq for side effects
- fn.Last() to get the last element in a seq
First preview release
This marks the "most things are working" milestone.
There might be smaller changes to the API before we set it in stone for v1.0. Notably around how Seqs can propagate errors, and maybe adding a few more methods to the Seq
interface (like seq.Split()
). The fnio
and fntesting
packages are also highly experimental currently.