I would say hat has more to do with Strongly Stati...
# arrow
t
I would say hat has more to do with Strongly Static Typed FP and it's advanced. The most important parts are composition, immutability. and avoiding side-effects.
💯 1
j
@tmg Yes. I was actually just thinking I should revise what I said about learning FP to be more specific about learning an FP library like Arrow or Cats, which are both strongly typed FP.
p
Compositionality is what keeps me being productive, even in imperative environments.
j
@pakoito Can you unpack that statement a bit for me? Is compositionality so fundamental because it brings with it referential transparency and local reasoning?
p
yes, it all goes hand in hand
composing referentially transparent functions makes refactoring and modifying code easy, so I can move things around according to business needs really quickly
local reasoning may not always be there, it's desirable and sometimes not up to you at all 🙂
j
It's possible to have referential transparency without local reasoning? I never considered that before. Can you give an example?
p
"what thread am I on right now"
that's a frequent one
or "what thread does this function happen on" downstream, if you prefer
I can move the function from a map to a flatMap to a different place, to a result
and I may not be able to reason whether it'd happened in this or that thread due to suspension or pieces like continueOn
👍🏾 1