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.
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 waysdecoders
- Provides useful utility decoder implementations (seejsonous
)dom
- Manipulate the HTML dom using Tasks (seetaskarian
)environment
- Provides functions to read from the execution environmentlogging
- Provides a few logging functionsmaybe-adapter
- Provides functions to convert to/fromMaybe
types (seemaybeasy
)numbers
- Parse strings into numbersurl
- 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 endpointsresource
- Provides types and functions for dealing with HATEOAS REST resourcestranslations
- Provides support for typed translation keys and typed React-based translation interpolation using the i18next library with a custom adaptertime
- Provides interfaces and functions for dealing with time durationstime-distance
- Provides interfaces and functions for dealing with distances between dates
See also the lower-level packages at festive-possum
, especially:
ajaxian
- A wrapper aroundXMLHttpRequest
that borrows heavily from Elmjsonous
- Use Elm-inspiredDecoder
functions to verify JSON objects match expected typesmaybeasy
- Use aMaybe
to represent possibly-nullish valuesnonempty-list
- A list-like type that is guaranteed to never be emptypiper
- Functional composition in Typescriptresulty
- DefinesResult
, a disjunction implementation in Typescripttaskarian
- DefinesTask
, a Future implementation in Typescript; like Promises, but lazy
# Clone the repo
git clone https://github.com/execonline-inc/CooperTS.git
cd CooperTS
# Install dependencies
yarn install
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.