gcanti / flow-static-land

[DEPRECATED, please check out fp-ts] Implementation of common algebraic types in JavaScript + Flow
MIT License
408 stars 22 forks source link

Add Pointed and Copointed functor? #15

Closed gcanti closed 7 years ago

gcanti commented 8 years ago
export interface Pointed<F> extends Functor<F> {
  of<A>(a: A): HKT<F, A>
}
export interface Copointed<F> extends Functor<F> {
  extract<A>(ca: HKT<F, A>): A
}

And then

export interface Applicative<F> extends Apply<F>, Pointed<F> {}
export interface Comonad<F> extends Functor<F>, Extend<F>, Copointed<F> {}
rjmk commented 7 years ago

I think you can just have

export interface Comonad<F> extends Extend<F>, Copointed<F> {}

without the Functor<F>

gcanti commented 7 years ago

Ah sure, good catch, thanks