Closed w0d closed 5 years ago
@w0d The simplest way to consume an EMon is with a foreach. Will give more detailed response later.
@w0d So the name needs to be short because the Emon should be used over and over again in code. However Emon is short for Errors Monad which is cryptic to most programmers let alone most people, so I suggest possibly Ehan, which would be short for errors handler.
Once a name has been agreed, I suggest closing the issue and starting a new general issue on the documentation of the trait under the new name.
not so sure about the starting premise there. im only just beginning to understand about the error monand and need to acquire a bit more knowledge to contribute more fully - though as i stand now "result" feels more encompassing without being cryptic (monand) / misdirecting (handler)
happy for this to be closed as i now have a solution to the original issue: use foreach to access element in Emon
i could hack this but in the interest of writing reasonable code how can you extract the Good from
ostrat.EMon[string]
?have tried various XXX but no joy :(
also need help converting a string to colour: this line seems to work:
val myColor = Colour.strToValue("Red")
but this one doesn't:players = "Red,Blue,Green,Yellow".split(",").map[Colour](c => Colour.strToValue(c))
any pointers appreciated