Skip to content

Commit

Permalink
Add trivial clock
Browse files Browse the repository at this point in the history
  • Loading branch information
turion committed Apr 16, 2024
1 parent 44632eb commit 5e31ff4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions rhine/rhine.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ library
FRP.Rhine.Clock.Realtime.Never
FRP.Rhine.Clock.Realtime.Stdin
FRP.Rhine.Clock.Select
FRP.Rhine.Clock.Trivial
FRP.Rhine.Clock.Unschedule
FRP.Rhine.Clock.Util
FRP.Rhine.Reactimation
Expand Down
1 change: 1 addition & 0 deletions rhine/src/FRP/Rhine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import FRP.Rhine.Clock.Realtime.Millisecond as X
import FRP.Rhine.Clock.Realtime.Never as X
import FRP.Rhine.Clock.Realtime.Stdin as X
import FRP.Rhine.Clock.Select as X
import FRP.Rhine.Clock.Trivial as X
import FRP.Rhine.Clock.Unschedule as X

import FRP.Rhine.ResamplingBuffer.Collect as X
Expand Down
18 changes: 18 additions & 0 deletions rhine/src/FRP/Rhine/Clock/Trivial.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module FRP.Rhine.Clock.Trivial where

-- base
import Control.Arrow

-- rhine
import FRP.Rhine.Clock
import FRP.Rhine.Clock.Proxy (GetClockProxy)

-- | A clock that always returns the tick '()'.
data Trivial = Trivial

instance (Monad m) => Clock m Trivial where
type Time Trivial = ()
type Tag Trivial = ()
initClock _ = return (arr $ const ((), ()), ())

instance GetClockProxy Trivial

0 comments on commit 5e31ff4

Please sign in to comment.