Skip to content

Commit e2c8ac1

Browse files
Use any instead of isJust . find
1 parent 2590c3d commit e2c8ac1

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/BotPlutusInterface/Balance.hs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ import Control.Monad.Trans.Either (EitherT, hoistEither, newEitherT, runEitherT)
2121
import Data.Coerce (coerce)
2222
import Data.Either.Combinators (rightToMaybe)
2323
import Data.Kind (Type)
24-
import Data.List (find, partition, (\\))
24+
import Data.List (partition, (\\))
2525
import Data.Map (Map)
2626
import Data.Map qualified as Map
27-
import Data.Maybe (fromMaybe, isJust, mapMaybe)
27+
import Data.Maybe (fromMaybe, mapMaybe)
2828
import Data.Set (Set)
2929
import Data.Set qualified as Set
3030
import Data.Text (Text)
@@ -297,10 +297,9 @@ addTxCollaterals utxos tx =
297297
filterAdaOnly = Map.filter (isAdaOnly . txOutValue)
298298
usesScripts Tx {txInputs, txMintScripts} =
299299
not (null txMintScripts)
300-
|| isJust
301-
( find (\TxIn {txInType} -> case txInType of Just ConsumeScriptAddress {} -> True; _ -> False) $
302-
Set.toList txInputs
303-
)
300+
|| any
301+
(\TxIn {txInType} -> case txInType of Just ConsumeScriptAddress {} -> True; _ -> False)
302+
(Set.toList txInputs)
304303

305304
-- | Ensures all non ada change goes back to user
306305
handleNonAdaChange :: Address -> Map TxOutRef TxOut -> Tx -> Either Text Tx

0 commit comments

Comments
 (0)