Skip to content

Commit e81c34a

Browse files
author
Evgenii Akentev
authored
1 parent c32e251 commit e81c34a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

plutus-tx/src/PlutusTx/Prelude.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-- Need some extra imports from the Prelude for doctests, annoyingly
2+
{-# LANGUAGE NoImplicitPrelude #-}
23
{-# LANGUAGE OverloadedStrings #-}
34
{-# OPTIONS_GHC -Wno-unused-imports #-}
45
{-# OPTIONS_GHC -fno-omit-interface-pragmas #-}
@@ -116,12 +117,8 @@ import PlutusTx.Ratio as Ratio
116117
import PlutusTx.Semigroup as Semigroup
117118
import PlutusTx.Trace as Trace
118119
import PlutusTx.Traversable as Traversable
119-
import Prelude hiding (Applicative (..), Enum (..), Eq (..), Foldable (..), Functor (..),
120-
Monoid (..), Num (..), Ord (..), Rational, Semigroup (..), Traversable (..), all,
121-
and, any, concat, concatMap, const, curry, divMod, either, elem, error, filter,
122-
fst, head, id, length, map, mapM_, max, maybe, min, not, notElem, null, or,
123-
quotRem, reverse, round, sequence, snd, take, uncurry, zip, (!!), ($), (&&),
124-
(++), (<$>), (||))
120+
import Prelude (Integer, dropWhile, flip, otherwise, return, until, zipWith, (.), (=<<), (>>),
121+
(>>=))
125122

126123
-- this module does lots of weird stuff deliberately
127124
{- HLINT ignore -}
@@ -181,6 +178,10 @@ quotient = Builtins.quotientInteger
181178
remainder :: Integer -> Integer -> Integer
182179
remainder = Builtins.remainderInteger
183180

181+
{-# INLINABLE even #-}
182+
even :: Integer -> Bool
183+
even n = if modulo n 2 == 0 then True else False
184+
184185
{-# INLINABLE fst #-}
185186
-- | Plutus Tx version of 'Data.Tuple.fst'
186187
fst :: (a, b) -> a

0 commit comments

Comments
 (0)