Oop's defining feature is having hidden state behind those interfaces.
Pure functions do not have that
Pure functions do not have that
According to wikipedia, "a monad is defined as a functor with additional structure". Not unlike an object.
Arrays are a type that admits a monad instance, what do they send and receive?
def x(input):
tmp=input * 5
return str(tmp)
hey, hidden state! x input = show tmp
where tmp = input * 5
It would be a different story if you had something like class IntState:
def __init__(self, val):
self.val = val
def x(input):
self.val += input
return str(val)