File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import Data.Tuple (Tuple (..))
16
16
import Control.Monad.State.Class (MonadState , gets )
17
17
18
18
import Data.Lens.Internal.Forget (Forget (..), runForget )
19
- import Data.Lens.Types (Getter (), Optic ())
19
+ import Data.Lens.Types (Getter (), Fold (), Optic ())
20
20
import Data.Lens.Types (IndexedGetter (), Indexed (..))
21
21
import Data.Lens.Types (IndexedFold ())
22
22
@@ -35,8 +35,8 @@ iview l = runForget (l (Indexed $ Forget id))
35
35
(^.) s l = view l s
36
36
37
37
-- | Convert a function into a getter.
38
- to :: forall s t a p . (Profunctor p ) => ( s -> a ) -> Optic p s t a t
39
- to = lmap
38
+ to :: forall r s t a b . (s -> a ) -> Fold r s t a b
39
+ to f p = Forget (runForget p <<< f)
40
40
41
41
-- | View the focus of a `Getter` in the state of a monad.
42
42
use :: forall s t a b m . (MonadState s m ) => Getter s t a b -> m a
You can’t perform that action at this time.
0 commit comments