This project specifies interoperability of common algebraic structures like Setoid, Ord, Semigroupoid, Category, Semigroup, Monoid, Group, Filterable, Functor, Contravariant, Apply, Applicative, etc. An algebra is a set of values, a set of operators that it is closed under and some laws it must obey. Each Fantasy Land algebra is a separate specification. An algebra may have dependencies on other algebras which must be implemented. "Value" is any JavaScript value, including any which have the structures defined below. "Equivalent" is an appropriate definition of equivalence for the given value. The definition should ensure that the two values can be safely swapped out in a program that respects abstractions. For example, two lists are equivalent if they are equivalent at all indices, two plain old JavaScript objects, interpreted as dictionaries, are equivalent when they are equivalent for all keys, two promises are equivalent when they yield equivalent values, etc.

Features

  • Each Fantasy Land algebra is a separate specification
  • Certain behaviours are defined from the perspective of a member of a type
  • Other behaviours do not require a member
  • Certain algebras require a type to provide a value-level representative
  • If a data type provides a method which could be derived, its behaviour must be equivalent to that of the derivation
  • It is recommended to throw an exception on unspecified behaviour

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Fantasy Land Specification

Fantasy Land Specification Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Fantasy Land Specification!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Mathematics Software, JavaScript Libraries

Registered

2021-06-29