Home | Notifications | New Note | Local | Federated | Search | Logout
Note Detail
tembok@tembok@misskey.id (2026-09-17 13:36:18)
Honestly I still don't know how to apply FP paradigm pragmatically. Like if you want to eliminate side effects as much as possible, your function will have so many parameters right? At that point, I think it will just become so annoying
---Reply---
Layar Laut@layarlaut@misskey.id (2026-09-17 16:01:15)
@tembok when I write in Haskell I rarely run into that problem. You just coupled them as a single data representation with ADT. Seperate stuff between IO and pure function. Try looking up "functional core, imperative shell"
Though there's some places where FP is impossible because of how the architecture is written. For example, in most game engine require you to directly modify other objects. ECS architecture like bevy on the other hand require you to say upfront what data it needs and what data it modifies
Reply
---Replies---
tembok@tembok@misskey.id (2026-09-19 07:38:46)
@layarlaut ohh til
Tbh I'm still confused on what's considered a pure function. Like in the resource that I use to learn about pure function, it says that suppose you have these functions:
func A() {
....
}
func B() {
....
A(....)
....
}
They said that func B is impure, and you should write it like this
func A() {
....
}
func B(A) {
....
A(....)
....
}
Isn't that just gonna make writing a function a hassle? Since you need to type every "dependency" into the parameter