I use the enumerator package John Millikin and try to create something roughly equivalent to Data.Enumerator.Binary.enumHandle , except that it connects the socket itself, and then I try to list the resulting handle. The difficulty arises because the connection is unreliable, and I would like it to reconnect and resume enumeration if something went wrong.
I usually expect the Enumerator to be a monad instance of its own meaning, but since it is a type of alias for a function, monadic behavior on it is only a reader of its input step, which seems to be of little use here, I tried to throw something together, which is just kept the Enumerator loop using catchError , but that’s not what I expected and I couldn’t figure out what it was doing, so I was wondering if anyone could suggest a good idiomatic approach to this. I'm fine with just the skeleton of the solution, as there are a lot of details that I omitted.
Any ideas?
source share