Hi,I use the State monad in a lot of places, but when I use it with the lens library, I find myself writing code like:myFunc :: StateT MyState ([ResultType])myFunc = dost <- getcase st ^. some_property ofTrue -> domy_value .= "Hello"True -> domy_value .= "Goodbye"I want to do something based on a 'state-variable', but I have to write 'get' -- is there a pattern that allows me to avoid the intermediate 'st' variable?I want to write something like:myFunc = docase (get ^. some_property) ofTrue -> domy_value .= "Hello"True -> domy_value .= "Goodbye"but that won't compile.Best wishes,Mike_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to: http:// mail. haskell. org/ cgi-bin/ mailman/ listinfo/ haskell-cafe Only members subscribed via the mailman list are allowed to post.