Skip to content

Commit

Permalink
Fix even (#3930).
Browse files Browse the repository at this point in the history
  • Loading branch information
ak3n committed Sep 15, 2021
1 parent c32e251 commit 4fa00a0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions plutus-tx/src/PlutusTx/Prelude.hs
@@ -1,4 +1,5 @@
-- Need some extra imports from the Prelude for doctests, annoyingly
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
Expand Down Expand Up @@ -116,12 +117,8 @@ import PlutusTx.Ratio as Ratio
import PlutusTx.Semigroup as Semigroup
import PlutusTx.Trace as Trace
import PlutusTx.Traversable as Traversable
import Prelude hiding (Applicative (..), Enum (..), Eq (..), Foldable (..), Functor (..),
Monoid (..), Num (..), Ord (..), Rational, Semigroup (..), Traversable (..), all,
and, any, concat, concatMap, const, curry, divMod, either, elem, error, filter,
fst, head, id, length, map, mapM_, max, maybe, min, not, notElem, null, or,
quotRem, reverse, round, sequence, snd, take, uncurry, zip, (!!), ($), (&&),
(++), (<$>), (||))
import Prelude (Integer, dropWhile, flip, otherwise, return, until, zipWith, (.), (=<<), (>>),
(>>=))

-- this module does lots of weird stuff deliberately
{- HLINT ignore -}
Expand Down Expand Up @@ -181,6 +178,10 @@ quotient = Builtins.quotientInteger
remainder :: Integer -> Integer -> Integer
remainder = Builtins.remainderInteger

{-# INLINABLE even #-}
even :: Integer -> Bool
even n = if modulo n 2 == 0 then True else False

{-# INLINABLE fst #-}
-- | Plutus Tx version of 'Data.Tuple.fst'
fst :: (a, b) -> a
Expand Down

0 comments on commit 4fa00a0

Please sign in to comment.