Skip to content

Commit

Permalink
Merge pull request #108 from bgamari/wip/df-empty
Browse files Browse the repository at this point in the history
Introduce Protocols.Df.empty
bgamari authored Sep 9, 2024
2 parents 03911e1 + 3bb696e commit 5645f14
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion clash-protocols/src/Protocols/Df.hs
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ module Protocols.Df (
Data (..),

-- * Operations on Df protocol
empty,
const,
void,
pure,
@@ -361,11 +362,15 @@ const b =
)
)

-- | Never produce a value.
empty :: Circuit () (Df dom a)
empty = Circuit (P.const ((), P.pure NoData))

-- | Drive a constant value composed of /a/.
pure :: a -> Circuit () (Df dom a)
pure a = Circuit (P.const ((), P.pure (Data a)))

-- | Drive a constant value composed of /a/.
-- | Never acknowledge values.
void :: (C.HiddenReset dom) => Circuit (Df dom a) ()
void =
Circuit

0 comments on commit 5645f14

Please sign in to comment.