Skip to content

Instantly share code, notes, and snippets.

@ENvironmentSet
Last active December 18, 2019 08:25
Show Gist options
  • Save ENvironmentSet/9485dd688971706c4f0fe89cefb8d21d to your computer and use it in GitHub Desktop.
Save ENvironmentSet/9485dd688971706c4f0fe89cefb8d21d to your computer and use it in GitHub Desktop.
Type safe any in Typescript
type Any = <B>(f: <A>(a: A) => B) => B; // Instead of forall a. a, use it's continuation. (they're isomorphic)
function any<A>(a: A): Any {
return f => f(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment