Commit

642c632

nice blog! i found that post on curried functions quite interesting. i wonder if you'd be able to get nicer partial application if you use function overloading…
thanks so much for your kind words! I actually have 2 follow up posts on function composition that i'm actively editing right now and 1 of them goes into details of using overloads. here is a sneak peek of a snippet from my "Strongly Typed Variadic Functions in TypeScript" post:
ts
type Compose = {
  <A, B(ab: (a: A) = B): (a: A) = B;
  <A, B, C(bc: (b: B) = C, ab: (a: A) = B): (a: A) = C;
  <A, B, C, D(cd: (c: C) = D, bc: (b: B) = C, ab: (a: A) = B): (a: A) = D;
  <A, B, C, D, E(
    de: (d: D) = E,
    cd: (c: C) = D,
    bc: (b: B) = C,
    ab: (a: A) = B,
  ): (a: A) = E;
};

const compose: Compose =
  (...fns: Array<(value: any) = any) =
  (value: any) =
    fns.reduceRight((acc, fn) = fn(acc), value);

const fitsSummary = compose(atMost(160), length, trim);
// (a: string) = boolean
that said, I will add that post to the thread once it's out!

commit 642c632

oh wow that type sure is something, i think i get how it works though. there seem to be a few >s missing from the code, not sure how that happened i've already added your blog's rss feed to my reader, cant wait for these posts!