Language-Ext Version 1.5 release
This is a major new release of Language-Ext with myriad new features and improvements. Much of this release is about refining and standardising the API. This is the first stable release of the LanguageExt.Process
system (Actor system), LanguageExt.Process.FSharp
(F# API for LanguageExt.Process
), LanguageExt.ProcessJS
(Javascript Actor system that allows seamless actor messaging from server to client), and LanguageExt.Process.Redis
(for intra-system messaging and message/state persistence).
Standardisation comes in the form:
- Making all constructor functions start with a capital letter
- Making all fold and scan functions use the same fold function signature
- Creating a common set of functions that all of the monad types implement
So:
tuple
becomesTuple
list
becomesList
map
becomesMap
cons
becomesCons
- etc.
This makes the constructor functions consistent with Some
, None
, Left
, Right
, ... The only exception to this is the unit
constructor, which stays as-is.
We also bring in a concept of a type of a 'higher kinded type' for all of the monadic types. It's not quite as effective or refined as a Haskell HKT, but it does create a standard interface (through extension methods) for all of the monadic types. The standard interface includes the following functions:
Sum
Count
Bind
Exists
Filter
Fold
ForAll
Iter
Map
Lift
/LiftUnsafe
SelectMany
Select
Where
Because of this standardised interface, it's also possible to use monad transformer functions (for up to a two-level deep generic monad-type):
SumT
BindT
CountT
ExistsT
FilterT
FoldT
ForAllT
IterT
MapT
i.e.
var list = List(Some(1), None, Some(2), None, Some(3)); // Lst<Option<int>>
var presum = list.SumT(); // 6
list = list.MapT( x => x * 2 );
var postsum = list.SumT(); // 12
New types
Map<K,V>
- Replacement forImmutableDictionary<K,V>
that uses an AVL tree implementationLst<T>
- Wrapper forImmutableList<T>
Set<T>
- Wrapper forImmutableSet<T>
Try<T>
- LikeTryOption<T>
but without the optional return valueRWS<E,W,S>
- Reader/Writer/State monadExceptionMatch
- Used for newException
extension methodMatch
for pattern matching on exception types.ActionObservable<T>
- Used byIObservable<T>
extension methodPostSubscribe
. Allows an action to be executed post-subscription.
New functions
- static Process functions in
LanguageExt.Process
par
- Partial applicationcurry
- Curryingrandom
- Thread safe random number generatorifSome
added forTryOption
- dispatches an action if theTryOption
is in aSome
state
Improvements
- Improved
Unit
type - ImplementedIEquatable<Unit>
and equality operator overloads - Improved
IComparable
andIEquatable
support forOption
andEither
types
Breaking changes
- Standardised the
fold
andscan
delegates toFunc<S,T,S>
Deprecated (made obsolete)
tuple
- becomesTuple
query
- becomesQuery
map
- becomesMap
list
- becomesList
array
- becomesArray
stack
- becomesStack
failure
- becomesifNone
/ifLeft
Prelude.empty
- becomesList.empty
/Set.empty
/Map.empty
cons
- becomesCons
range
- becomesRange
with
- becomesmap
Nuget: