Skip to content

Functional Programming in js

Functional Programming in js

Details

Hey JSler!

I'm currently felt in love with functional programming. I'm working a bit with logprog and haskell and thinking on how to add their strength to js. So I'm wondering how much of your function do have no side effects?

I'm currently seeing some strength in pattern matching, lazy evaluation and generic type safety. Implementing lazy evaluation is simple, pattern matching is mostly a question of how to make the code still remain beautiful.

So what's really left is type safety. Strict type safety like in java is diving me crazy. But what's about optional generic type-safety. So you can define like "type myFn :: a -> Number -> a" which forces the myFn to get two inputs, the second has to be an number and the return value has to have the type of the first param. I'd like that.

Would you like to have a library which would provide optional generic type safety to your code? Would you use it often?

Looking forward to your ideas, comments and everything else ;)

regards
Roland

Photo of vienna.js group
vienna.js
See more events
Metalab
Rathausstraße 6 · Vienna