DEV Community

Discussion on: Practical Functional Programming in JavaScript - Side Effects and Purity

Collapse
 
richytong profile image
Richard Tong

Glad to hear from you functional, interesting idea for a strongly typed log util. What are you using for that right now?

Collapse
 
functional_js profile image
Functional Javascript

I'll do an article on logging and troubleshooting pipes later this week.
But here's an example of one of the log utils throwing on an unexpected type...

logging functional pipelines

Thread Thread
 
tech6hutch profile image
Hutch

This seems like a poor man's TypeScript.

Thread Thread
 
functional_js profile image
Functional Javascript

Typescript does not do runtime type checking.

Thread Thread
 
tech6hutch profile image
Hutch

Because I'm saying you should check it at compile time

Thread Thread
 
functional_js profile image
Functional Javascript

That won't help you with dynamic data at runtime.
That's where the runtime bugs are.
Thus this is outside the scope of Typescript.

Thread Thread
 
tech6hutch profile image
Hutch

Ok then I guess I misunderstood, sorry