I have recently started learning Haskell and I hope you can help with a list transformation question.
I have a Maybe list of a custom data type, simplified to Strings for this forum, and I want transform it to replace Nothing values with the most recently seen value. See below:
Input: [Nothing, Just "Hello", Nothing, Nothing, Just "World", Nothing]
Output: [Nothing, Just "Hello", Just "Hello", Just "Hello", Just "World", Just "World"]
Is this possible in Haskell? Any pointers will be much appreciated.