RepoPilot

How do their APIs compare?

About louthy/language-ext · 2 messages · last activity 9/8/2026

Question

How do their APIs compare?

RepoPilot

I should be upfront about a scoping issue here: language-ext and wavefunctioncollapse are fundamentally different kinds of projects, so "API comparison" means something quite different for each. Let me lay out what I can actually support from the retrieved data, and flag where I'd want to search for more before saying anything definitive about surface area.

louthy/language-ext — a library API (broad, class-instance driven)

Language-ext exposes its API primarily through:

  • Class instances / typeclass-style structs implementing shared interfaces like Eq<A> and Hashable<A>. For example EqString, EqGuid, EqDateTime, EqArray, EqIdentity all implement a common Equals/GetHashCode contract [LanguageExt.Core/Class Instances/Eq/EqGuid.cs:L19-L27], [LanguageExt.Core/Class Instances/Eq/EqDateTime.cs:L19-L27], [LanguageExt.Core/Class Instances/Eq/EqArray.cs:L51-L59], [LanguageExt.Core/Class Instances/Eq/EqIdentity.cs:L18-L26]. This is a trait/typeclass pattern — many small structs conforming to a shared interface, rather than one big class hierarchy.
  • A fallback/default resolution mechanism: HashableDefault<A> tries to find an appropriate Hashable instance from loaded assemblies and falls back to Object.GetHashCode() [LanguageExt.Core/Class Instances/Hashable/HashableDefault.cs:L1-L17]. This reflects the library's broader "traits" design (mentioned in the README's Features list under "Traits" and "Value traits").
  • Per the README's contents outline, the actual consumable API spans functional effects/IO, atomic concurrency, immutable collections, functional streams, optional/alternative monads, state-managing monads, parser combinators, pretty-printing, and differencing — i.e., it's a large multi-module functional programming toolkit, not a single-purpose API. The full method-level reference lives outside what's retrieved here (the README points to a hosted API Reference site rather than embedding one).

mxgmn/wavefunctioncollapse — not a library API, an application entry point

This project is structured as a single console application, not a reusable API surface:

  • Program.Main in [Program.cs:L7-L73] loads samples.xml, builds either an OverlappingModel or SimpleTiledModel depending on the <overlapping>/<simpletiled> XML element, and calls model.Run(seed, limit) then model.Save(...).
  • The shared abstraction is the Model base class, with a Heuristic enum (Scanline, MRV, Entropy) and a Run/Save method pair used polymorphically over OverlappingModel and SimpleTiledModel [Program.cs:L20-L23, L44-L58].
  • Internally, Model.cs exposes propagation mechanics like Ban(int i, int t) and the constraint-propagation loop that decrements compatibility counts and updates entropy bookkeeping [Model.cs:L165-L204] — this is implementation detail, not a public API meant for external consumers in the way language-ext's typeclasses are.
  • OverlappingModel's constructor-time logic builds patterns from an input bitmap using symmetry transforms (reflect/rotate) [OverlappingModel.cs:L46-L85] — again, this is model-construction logic driven by XML config, not a general-purpose API for other programs to call into.

Bottom line comparison

  • Language-ext is designed as an API/framework: it deliberately layers interfaces, traits, and class instances so consuming code can be written declaratively against abstractions (Eq<A>, Hashable<A>, etc.).
  • wavefunctioncollapse is not designed to be consumed as a library API at all — it's a single-executable research/demo tool driven by an XML config file (samples.xml) and a Program.Main entry point [Program.cs:L7-L18]. Its "API" (the Model, OverlappingModel, SimpleTiledModel classes) is internal architecture, not a published/versioned interface for external integration — there's no NuGet-style packaging or reference docs analogous to language-ext's.

If you want, I can search the code for

Want to ask your own question?

Open chat for louthy/language-ext

Public Q&A. Generated by RepoPilot from the actual source of louthy/language-ext. AI answers can be incomplete or stale — verify before relying on them.