module Workflow.Lens where
import Workflow.Extra
import Workflow.Types
import Control.Monad.Free.TH (makeFree)
import Control.Monad.Free (MonadFree, liftF)
makeFree ''WorkflowF
sendKeySequence :: (MonadWorkflow m) => KeySequence -> m ()
sendKeySequence = traverse_ sendKeyChord'
sendKeyChord' :: (MonadWorkflow m) => KeyChord -> m ()
sendKeyChord' (ms,k) = sendKeyChord ms k
fromWorkflows_ :: (MonadWorkflow m) => [Workflow_] -> m ()
fromWorkflows_ = traverse_ (liftF . fromWorkflow_)
fromWorkflow_ :: Workflow_ -> WorkflowF ()
fromWorkflow_ = \case
SendKeyChord_ flags key -> SendKeyChord flags key ()
SendText_ s -> SendText s ()
SendMouseClick_ flags n button -> SendMouseClick flags n button ()
SendMouseScroll_ flags scroll n -> SendMouseScroll flags scroll n ()
SetClipboard_ s -> SetClipboard s ()
OpenApplication_ app -> OpenApplication app ()
OpenURL_ url -> OpenURL url ()
Delay_ t -> Delay t ()