Skip to content

A collection of Elm-inspired functional-programming tools in Typescript, focused on eliminating runtime exceptions and reducing testing burden.

License

Notifications You must be signed in to change notification settings

execonline-inc/CooperTS

Repository files navigation

lerna

CooperTS

Elm-inspired functional-programming tools in Typescript.

Compilers are great. Let the compiler do the work.

For additional information and examples, please visit cooperts.io.

Packages

Most CooperTS packages are utility packages that build on primitive functional types from festive-possum, such as Maybe, Task, Result, and Decoder types.

  • collections - Provides functions to work with lists in various ways
  • decoders - Provides useful utility decoder implementations (see jsonous)
  • dom - Manipulate the HTML dom using Tasks (see taskarian)
  • environment - Provides functions to read from the execution environment
  • logging - Provides a few logging functions
  • maybe-adapter - Provides functions to convert to/from Maybe types (see maybeasy)
  • numbers - Parse strings into numbers
  • url - Provides functions to validate URLs

Other CooperTS packages provide types & patterns for developers to conform to known good standards.

  • appy - Provides functions to interface with HATEOAS API endpoints
  • resource - Provides types and functions for dealing with HATEOAS REST resources
  • translations - Provides support for typed translation keys and typed React-based translation interpolation using the i18next library with a custom adapter
  • time - Provides interfaces and functions for dealing with time durations
  • time-distance - Provides interfaces and functions for dealing with distances between dates

See also the lower-level packages at festive-possum, especially:

  • ajaxian - A wrapper around XMLHttpRequest that borrows heavily from Elm
  • jsonous - Use Elm-inspired Decoder functions to verify JSON objects match expected types
  • maybeasy - Use a Maybe to represent possibly-nullish values
  • nonempty-list - A list-like type that is guaranteed to never be empty
  • piper - Functional composition in Typescript
  • resulty - Defines Result, a disjunction implementation in Typescript
  • taskarian - Defines Task, a Future implementation in Typescript; like Promises, but lazy

Local Development

# Clone the repo
git clone https://github.com/execonline-inc/CooperTS.git
cd CooperTS

# Install dependencies
yarn install

To run the docs app

yarn install

Then, run the development server in the same root directory:

yarn docs dev

Open http://localhost:3000 with your browser to see the result.

About

A collection of Elm-inspired functional-programming tools in Typescript, focused on eliminating runtime exceptions and reducing testing burden.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published