Follow

@suppi@fosstodon.org in this context it refers to change grabbing the current state of the program and then changing the code (say, a function in that program) to accommodate for the specific case (state) at runtime.

For example, say the original program starts out with just three functions + some state that is coming from outside world.

--Function 1--
grab_ object: grabs objects from outside when they become available
--Function 2--
update_state: updates state (assume state is complex nested enum-like structure)
--Function 3--
print_state: prints the state

Now, let's say that the objects being fed are themselves dynamic in nature so may look very different at each time step and can itself be interpreted as code (either partially or fully). Can we write a program in Haskell that depending on the structure of the object (which is not enumerable nor known in advanced) apply a "patch" function/operator being sent with the object which changes the way the update_state function and print_state function work?

I suspect there are cleaner/better/intuitive ways of solving this but I'm interested in this specific behavior of being able to effectively re-write the Haskell code itself at runtime kinda like you can dynamic languages.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.