---
title: "Discussion on \"Functional TypeScript in Production Systems\" | Hashnode"
description: "Discussion on \"Functional TypeScript in Production Systems\". Functional programming has enjoyed a massive surge in popularity amongst JavaScript developers in recent years. This is likely partly due to the popularity of libraries like Redux and React which promote functional programming styles, and have proven..."
url: "https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Functional TypeScript in Production Systems](https://antman-does-software.com/functional-typescript-in-production-systems?utm_source=hashnode&utm_medium=feed)

Functional programming has enjoyed a massive surge in popularity amongst JavaScript developers in recent years. This is likely partly due to the popularity of libraries like Redux and React which promote functional programming styles, and have proven...

May 9, 2021 · 8 min read · antman-does-software.com  
Updated May 22, 2021  
Read the article

-   [#functional-programming](https://hashnode.com/tag/functional-programming)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#typescript](https://hashnode.com/tag/typescript)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Anthony Manning-Franklin](https://hashnode.com/@Antman261)

@Antman261 · Perth, Australia

  
[View profile](https://hashnode.com/@Antman261)

Drunk on types and functional programming

Former CTO of SKUTOPIA I write about Functional Programming, TypeScript, Node, Event Sourcing, and engineering leadership

## Responses 4

Markdown supported · ⌘↵ to post

[VH](https://hashnode.com/@Silverbullet069)

[Apr 25, 2024](https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3/comment/662a73399fb921ad29a22ad1)

Omg, this is the blog I was searching for a long time. I was trying to do OOP in TypeScript and sometimes I felt like I didn't harness the power of FP. And great job in that Partially Applied Controller that encapsulate impure + pure function and separate function logic into 3 parts:

-   Data Retrieval (In-memory, File, DB, Remote API, ...)
-   Business Logic
-   Error/Exception Handler for both Data Retrieval and Business Logic (using Discriminated Union Type or Either Design Pattern). I'm currently learning Either Design Pattern.

These knowledge will definitely be put in use in my VSCode Extension that used TypeScript. This is also the project for my graduation thesis.

[Aditya Mitra](https://hashnode.com/@aditya-mitra)

[May 14, 2021](https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3/comment/609eac5247373d4cb0564060)

Great Article!

_By the way, I had this question in my mind:_

Is using `enum` in **switch ... case** a good idea?

[VH](https://hashnode.com/@Silverbullet069)

[Apr 25, 2024](https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3/comment/609eac5247373d4cb0564060#reply-662a7529a1efa063a72e4501)

This is also bugging my mind since using `enum` means you don't need to remember the exact literal string like "PENDING\_VERIFICATION". You just define

```
enum AccountStatus {
  PendingVerification = 'PENDING_VERIFICATION';
  Active = 'ACTIVE',
  Locked = 'LOCKED'
}
```

and use VSCode autocomplete feature. E.g. `AccountStatus.Pend-` => `AccountStatus.PendingVerification`

[Anthony Manning-Franklin](https://hashnode.com/@Antman261)

[Apr 27, 2024](https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3/comment/609eac5247373d4cb0564060#reply-662c6dcdca22fbbd84c9f0d4)

[VH](https://hashnode.com/@Silverbullet069) VSCode will still autocomplete a union of string literals for you, e.g.

```
type Foobar = 'FOO' | 'BAR';

const doFoobar = (prop: Foobar) => prop;
```

When you use `doFoobar` VSCode will suggest/autocomplete once you have typed `doFoobar(`

[VH](https://hashnode.com/@Silverbullet069)

[Apr 27, 2024](https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3/comment/609eac5247373d4cb0564060#reply-662d111b7133b51519cfc34f)

[Anthony Manning-Franklin](https://hashnode.com/@Antman261) Yep it sure supported autocomplete, my bad @@ and I also found out about how `enum` wasn't that good in TypeScript so I have fully switched to Union Type now.

Ah yes thank you for these awesome blog plots. I have implemented some in my project. I also ask questions in some of your article's comment section. Can you please check them :")

[Kieran Roberts](https://hashnode.com/@kieran6roberts)

[May 10, 2021](https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3/comment/609955e71ea29f2c341e338b)

Great article! Love the examples you use [Anthony Manning-Franklin](https://hashnode.com/@Antman261)

[Saquib Hussain](https://hashnode.com/@saquibxhussain)

[May 10, 2021](https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3/comment/6098f10e21068818a5c63b60)

Geeking out with this piece. How long did it take to implement these functions?

[Anthony Manning-Franklin](https://hashnode.com/@Antman261)

[May 11, 2021](https://hashnode.com/posts/functional-typescript-in-production-systems/6097aa0521068818a5c621c3/comment/6098f10e21068818a5c63b60#reply-609a325c1ea29f2c341e432e)

Thanks for the question!

I think I wrote this entire article in a couple of hours, plus some proof reading from my partner, writing the code maybe took up 25% of that time?

These functions are basically muscle memory for me now. By repeating the pattern over and over, I don't need to burn brain cycles remembering the pattern, I only need to think about the particular requirements of the business case being implemented.

This is the value of the practice of Kaizen. Have some exercises you repeat regularly, so you can internalise common patterns. Each time you do it, you will also make little improvements.

Then when it comes time to do it for real, you're not practicing in production on company time.
