Skip to content

Commit

Permalink
changed lens type
Browse files Browse the repository at this point in the history
We drop the `condtionally` and enforce the presence of the field at the call
side.
  • Loading branch information
drsk committed Sep 5, 2024
1 parent 31ff1f7 commit e76a385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions haskell-src/Concordium/Types/Accounts.hs
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ bieBakerPoolInfo =
-- | Lens for '_bieBakerIsSuspended'
{-# INLINE bieAccountIsSuspended #-}
bieAccountIsSuspended ::
(AVSupportsDelegation av) =>
Lens' (BakerInfoEx av) (Conditionally (SupportsValidatorSuspension av) Bool)
(AVSupportsDelegation av, AVSupportsValidatorSuspension av) =>
Lens' (BakerInfoEx av) Bool
bieAccountIsSuspended =
lens _bieAccountIsSuspended (\bie x -> bie{_bieAccountIsSuspended = x})
lens (uncond . _bieAccountIsSuspended) (\bie x -> bie{_bieAccountIsSuspended = CTrue x})

-- | Coerce a 'BakerInfoEx' between two account versions that support delegation.
coerceBakerInfoExV1 ::
Expand Down
2 changes: 1 addition & 1 deletion haskell-src/Concordium/Types/Conditionally.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ uncond (CTrue a) = a

fromCondDef :: Conditionally b a -> a -> a
fromCondDef (CTrue a) _def = a
fromCondDef CFalse def = def
fromCondDef CFalse def = def

0 comments on commit e76a385

Please sign in to comment.