@@ -11,7 +11,7 @@
1111-- printString <- 'mkDebounce' 'defaultDebounceSettings'
1212-- { 'debounceAction' = putStrLn "Running action"
1313-- , 'debounceFreq' = 5000000 -- 5 seconds
14−-- , 'debounceEdge' = 'trailingEdge' -- Trigger on the trailing edge
14+-- , 'debounceEdge' = 'DI.trailingEdge' -- Trigger on the trailing edge
1515-- }
1616-- @
1717--
@@ -32,8 +32,8 @@ module Control.Debounce
3232 , DI.debounceFreq
3333 , DI.debounceAction
3434 , DI.debounceEdge
35− , leadingEdge
36− , trailingEdge
35+ , DI.leadingEdge
36+ , DI.trailingEdge
3737 -- * Creation
3838 , mkDebounce
3939 ) where
@@ -48,7 +48,7 @@ defaultDebounceSettings :: DI.DebounceSettings
4848defaultDebounceSettings = DI.DebounceSettings
4949 { DI.debounceFreq = 1000000
5050 , DI.debounceAction = return ()
51− , DI.debounceEdge = leadingEdge
51+ , DI.debounceEdge = DI.leadingEdge
5252 }
5353
5454-- | Generate an action which will trigger the debounced action to be performed.
@@ -58,14 +58,3 @@ mkDebounce :: DI.DebounceSettings -> IO (IO ())
5858mkDebounce settings = do
5959 baton <- newEmptyMVar
6060 DI.mkDebounceInternal baton threadDelay settings
61−
62−-- | Perform the action immediately, and then begin a cooldown period.
63−-- If the trigger happens again during the cooldown, wait until the end of the cooldown
64−-- and then perform the action again, then enter a new cooldown period.
65−leadingEdge :: DI.DebounceEdge
66−leadingEdge = DI.Leading
67−
68−-- | Start a cooldown period and perform the action when the period ends. If another trigger
69−-- happens during the cooldown, it has no effect.
70−trailingEdge :: DI.DebounceEdge
71−trailingEdge = DI.Trailing