module Proton.Diffraction where

import Data.Distributive
import Proton.Types
import Data.Profunctor

diffract :: Distributive f => Optic (Star f) s t a b -> (a -> f b) -> s -> f t
diffract :: Optic (Star f) s t a b -> (a -> f b) -> s -> f t
diffract opt :: Optic (Star f) s t a b
opt f :: a -> f b
f = Star f s t -> s -> f t
forall (f :: * -> *) d c. Star f d c -> d -> f c
runStar (Star f s t -> s -> f t) -> Star f s t -> s -> f t
forall a b. (a -> b) -> a -> b
$ Optic (Star f) s t a b
opt ((a -> f b) -> Star f a b
forall (f :: * -> *) d c. (d -> f c) -> Star f d c
Star a -> f b
f)