kongware / scriptum

Functional Programming Unorthodoxly Adjusted to Client-/Server-side Javascript
MIT License
383 stars 21 forks source link

Codomain preservation fails with partially applied types #367

Closed ivenmarquardt closed 2 years ago

ivenmarquardt commented 2 years ago
const F = {};

const comp = fun(
  f => g => x => f(g(x)),
  "(b => c) => (a => b) => a => c");

F.map = comp;

F.Functor = Functor({map: F.map});

While F.Functor[ADT] yields the correct type Functor<(c =>)>, Functor.map[ANNO] yields (^a, b. (a => b) => (c => a) => (c => b)) although it should be (^a, b. (a => b) => (c => a) => c => b).