Skip to content

Commit

Permalink
Replace the call to error with absurd in RATIFY
Browse files Browse the repository at this point in the history
  • Loading branch information
aniketd authored and lehins committed May 6, 2024
1 parent a51ea92 commit 4c6a173
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,16 @@ import Control.Monad.Trans.Reader (Reader, runReader)
import Control.State.Transition.Extended
import Data.Aeson (KeyValue, ToJSON (..), object, pairs, (.=))
import Data.Default.Class (Default (..))
import Data.Foldable (toList)
import Data.Functor.Identity (Identity)
import Data.Kind (Type)
import Data.List.NonEmpty (NonEmpty ((:|)))
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
import Data.Maybe (fromMaybe)
import Data.Pulse (Pulsable (..), pulse)
import Data.Sequence.Strict (StrictSeq (..))
import qualified Data.Sequence.Strict as SS
import Data.Void (Void, absurd)
import GHC.Generics (Generic)
import Lens.Micro
import NoThunks.Class (NoThunks (..), allNoThunks)
Expand Down Expand Up @@ -296,6 +297,7 @@ class
, BaseM (ConwayRATIFY era) ~ Reader Globals
, Environment (ConwayRATIFY era) ~ RatifyEnv era
, State (ConwayRATIFY era) ~ RatifyState era
, PredicateFailure (ConwayRATIFY era) ~ Void
) =>
RunConwayRatify era
where
Expand All @@ -309,11 +311,7 @@ class
)
globals
in case ratifyResult of
Left ps ->
error $
unlines $
"Impossible: RATIFY rule never fails, but it did:"
: map show (toList ps)
Left (x :| _) -> absurd x
Right ratifyState' -> ratifyState'

finishDRepPulser :: forall era. DRepPulsingState era -> (PulsingSnapshot era, RatifyState era)
Expand Down

0 comments on commit 4c6a173

Please sign in to comment.