Is there a shortcut for this in the lens library?
\x -> liftM (^. x) get
Maybe it's a silly question, but it feels like a basic enough construction that there should be a shortcut for it.
Try use
use :: MonadState s m => Getting a s a -> m a
use = gets . view
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With