Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sweet-monads/interfaces

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sweet-monads/interfaces - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

container.d.ts

12

async-applicative.ts

@@ -5,4 +5,10 @@ import type { Applicative } from "./applicative";

export interface AsyncApplicative<I> extends AsyncFunctor<I>, Applicative<I> {
asyncApply<A, B>(this: AsyncApplicative<(a: A) => Promise<B>>, arg: AsyncApplicative<Promise<A> | A>): Promise<AsyncApplicative<B>>;
asyncApply<A, B>(this: AsyncApplicative<Promise<A> | A>, fn: AsyncApplicative<(a: A) => Promise<B>>): Promise<AsyncApplicative<B>>;
}
asyncApply<A, B>(
this: AsyncApplicative<(a: A) => Promise<B>>,
arg: AsyncApplicative<Promise<A> | A>
): Promise<AsyncApplicative<B>>;
asyncApply<A, B>(
this: AsyncApplicative<Promise<A> | A>,
fn: AsyncApplicative<(a: A) => Promise<B>>
): Promise<AsyncApplicative<B>>;
}

@@ -6,2 +6,2 @@ import type { Monad } from "./monad";

asyncChain<B>(f: (a: T) => Promise<AsyncMonad<B>>): Promise<AsyncMonad<B>>;
}
}

@@ -10,1 +10,2 @@ export type { Functor } from "./functor";

export type { Applicative, ApplicativeConstructor } from "./applicative";
export type { Container } from "./container";
{
"name": "@sweet-monads/interfaces",
"version": "3.0.0",
"version": "3.1.0",
"description": "Monad interfaces",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -24,5 +24,5 @@ # @sweet-monads/interfaces

class Container<T> implements Functor<T> {
map<A>(fn: (i: T) => A): Container<A> {
return new Container<A>();
class MyClass<T> implements Functor<T> {
map<A>(fn: (i: T) => A): MyClass<A> {
return new MyClass<A>();
}

@@ -387,4 +387,19 @@ }

### Container
Is a value wrapper, that allows to get value (if state of the container is valid), or throws error if not.
Methods:
##### `Container#unwrap`
```typescript
const lucky = Math.random() > 0.5 ? just(":)") : none();
// Will either return ":)" or throw an error
lucky.unwrap();
```
## License
MIT (c) Artem Kobzar see LICENSE file.
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