Track and control side effects at the static type level in Functional Programming
Regular TypeScript Function
function fetchUser(): Promise<User> { return fetch('/user').then(res => res.json()) }
- It's unclear what dependencies are needed and what failures are possible
Effect-TS Approach
Effect<Has<FetchEnv>, NetworkError, User>
- Clearly shows what dependencies (environment) are needed
- Clearly shows what errors can occur
- Clearly shows what the return value will be on success
Effect Systems

Seonglae Cho