New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@matechs/effect

Package Overview
Dependencies
Maintainers
2
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@matechs/effect

Matechs Effect is a typescript library inspired by scala's ZIO and Haskell's RIO architecture.

  • 0.0.22
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
180
decreased by-59.37%
Maintainers
2
Weekly downloads
 
Created
Source

Introduction

Matechs Effect is a typescript library inspired by scala's ZIO and Haskell's RIO architecture.

Docs at https://mikearnaldi.github.io/matechs-effect/modules/_matechs_effect.html

It aims to provide a strong foundational block to build typescript code in a more testable and standardized way.

This library is composed at its core by the @matechs/effect package that exposes 2 effects

  • type Effect<R, E, A> = (r: R) => Wave<E, A>

The underlying Wave is provided by Waveguide.

You can think of this type as a computation that requires an environment R to run.

The module exposes 2 instances of the typeclass type EffectMonad<T extends URIS3> = Monad3E<T> & MonadThrow3<T> & Bifunctor3<T>:

  • effectMonad for Effect<R, E, A>
  • concurrentEffectMonad for Effect<R, E, A> provides concurrent ap

Pipeable functions are also exported for both instances (default Effect, parAp, parApFirst, parApSecond for parallel)

Interesting integrations and usage examples can be found in packages/orm, packages/http, packages/rpc, packages/tracing

Details

For details about the additional types and overloads please refer to documentation in packages/effect

Notes

This package is a work in progress syntax and functions might change, feedback are welcome and contributions even more!

The primary difference with waveguide itself is in how we manage the R parameter and in the utilities that we provide around environment management. The focus on this library is making environmental effects easy while providing valuable integrations out of the box where Waveguide itself poses primary focus around the underlying Wave<E, A>

Ecosystem

  • @matechs/tracing : provides integration with opentracing-js
  • @matechs/http : provides integration with axios
  • @matechs/orm : provides integration with typeorm
  • @matechs/rpc : no boilerplate rpc for your effects
  • @matechs/express : provides integration with express
  • @matechs/graceful : utility to handle graceful exit

Thanks

This library would have not been feasibly possible without the strong foundations of fp-ts and Waveguide & huge thanks to the Authors.

Another huge thanks goes to both the scala community (ZIO in specific) and the haskell community (RIO & Polysemy) from which inspiration is taken.

All of the above projects are advised!

FAQs

Package last updated on 23 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc