Skip to content

Commit

Permalink
Removed superfluous constraints on 'maybeX' and 'maybeIsX'. Fix #1075
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnbastiaan committed Feb 12, 2020
1 parent 960efa0 commit 6335545
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
* [#1041](https://github.com/clash-lang/clash-compiler/issues/1041): Nested product types incorrectly decomposed into ports
* [#1058](https://github.com/clash-lang/clash-compiler/issues/1058): Prevent substitution warning when using type equalities in top entities
* [#1033](https://github.com/clash-lang/clash-compiler/issues/1033): Fix issue where Clash breaks when using Clock/Reset/Enable in product types in combination with Synthesize annotations
* [#1075](https://github.com/clash-lang/clash-compiler/issues/1075): Removed superfluous constraints on 'maybeX' and 'maybeIsX'

* Fixes without issue reports:
* Fix bug in `rnfX` defined for `Down` ([baef30e](https://github.com/clash-lang/clash-compiler/commit/baef30eae03dc02ba847ffbb8fae7f365c5287c2))
Expand Down
4 changes: 2 additions & 2 deletions clash-prelude/src/Clash/XException.hs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ infixr 0 `hwSeqX`
-- > maybeX isX (3, _|_) = Just (3, _|_)
-- > maybeX isX _|_ = _|_
--
maybeX :: NFData a => (a -> Either String a) -> a -> Maybe a
maybeX :: (a -> Either String a) -> a -> Maybe a
maybeX f a = either (const Nothing) Just (f a)

-- | Fully evaluate a value, returning 'Nothing' if it throws 'XException'.
Expand All @@ -167,7 +167,7 @@ maybeHasX = maybeX hasX
-- > maybeIsX (3, XException msg) = Just (3, XException msg)
-- > maybeIsX (3, _|_) = Just (3, _|_)
-- > maybeIsX _|_ = _|_
maybeIsX :: NFData a => a -> Maybe a
maybeIsX :: a -> Maybe a
maybeIsX = maybeX isX

-- | Fully evaluate a value, returning @'Left' msg@ if it throws 'XException'.
Expand Down

0 comments on commit 6335545

Please sign in to comment.