Closed tomjaguarpaw closed 8 years ago
I don't suggest to break this type signature but the new version could be added under a new name and the old one deprecated eventually.
regEnMaybe :: a -> Signal (Maybe a) -> Signal a
regEnMaybe = regEnMaybe' systemClock
regEnMaybe' :: SClock clk -> a -> Signal' clk (Maybe a) -> Signal' clk a
regEnMaybe' clk initial input = regEn' clk initial (fmap isJust input)
$ fmap fromJust input
I prefer the name regMaybe
, thoughts?
regMaybe
seems good.
In fact registerMaybe
is even better.
regEn
would be strictly typesafer if its signature wererather than
This is very similar to https://github.com/clash-lang/clash-prelude/issues/42