Skip to content

BREAKING: New LanguageExt.Transformers package

Compare
Choose a tag to compare
@louthy louthy released this 04 Jun 02:15
· 476 commits to main since this release

The transformers extensions, which are a big set of T4 templates for generating extension methods for nested monadic types have now been broken out into their own package: LanguageExt.Transformers

If you use the following functions: BindT, MapT, FoldT, FoldBackT, ExistsT, ForAllT, IterT, FilterT, PlusT, SubtractT, ProductT, DivideT, SumT, CountT, AppendT, CompareT, EqualsT, or ApplyT - then you will get compile errors, and will need to add a reference to the LanguageExt.Transformers package.

I've done this for a couple of reasons:

  • There's been an ongoing concern from a number of users of this library about the size of the LanguageExt.Core library. This change takes the Core package from 3,276 kb to 2,051 kb.
    • The Core library will always be quite chunky because of the sheer amount of features, but the transformer extension methods definitely aren't always needed, so breaking them out made sense
  • I suspect issues around the .NET ReadyToRun usage will be alleviated somewhat by this change.
    • I can't prove this, but the C# tooling has had a hard time with those 10,000s of generated extension methods before - so rather than wait for Microsoft to fix their tooling, I'm trying to be proactive and see if this will help.

The main transformer extensions that remain in the Core library are:

  • Traverse
  • Sequence

These are so heavily used that I believe moving them out into the Transformers library would mean everyone would be obliged to use it, and therefore it wouldn't achieve anything. There may be an argument for bringing BindT and MapT back into the core at some point. I will see how this plays out (it wouldn't be a future breaking change if that were the case).

Any problems, please report via the Issues in the usual way.