module PlutusTx.Base (fst, snd, curry, uncurry, ($), flip, until, (.), const, id) where
import PlutusTx.Bool
fst :: (a, b) -> a
fst :: forall a b. (a, b) -> a
fst (a
a, b
_) = a
a
{-# INLINABLE fst #-}
snd :: (a, b) -> b
snd :: forall a b. (a, b) -> b
snd (a
_, b
b) = b
b
{-# INLINABLE snd #-}
curry :: ((a, b) -> c) -> a -> b -> c
curry :: forall a b c. ((a, b) -> c) -> a -> b -> c
curry (a, b) -> c
f a
a b
b = (a, b) -> c
f (a
a, b
b)
{-# INLINABLE curry #-}
uncurry :: (a -> b -> c) -> (a, b) -> c
uncurry :: forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry a -> b -> c
f (a
a, b
b) = a -> b -> c
f a
a b
b
{-# INLINABLE uncurry #-}
infixr 0 $
($) :: (a -> b) -> a -> b
a -> b
f $ :: forall a b. (a -> b) -> a -> b
$ a
a = a -> b
f a
a
{-# INLINABLE ($) #-}
flip :: (a -> b -> c) -> b -> a -> c
flip :: forall a b c. (a -> b -> c) -> b -> a -> c
flip a -> b -> c
f b
x a
y = a -> b -> c
f a
y b
x
{-# INLINABLE flip #-}
until :: (a -> Bool) -> (a -> a) -> a -> a
until :: forall a. (a -> Bool) -> (a -> a) -> a -> a
until a -> Bool
p a -> a
f = a -> a
go
where
go :: a -> a
go a
x | a -> Bool
p a
x = a
x
| Bool
otherwise = a -> a
go (a -> a
f a
x)
{-# INLINABLE until #-}
infixr 9 .
(.) :: (b -> c) -> (a -> b) -> a -> c
. :: forall b c a. (b -> c) -> (a -> b) -> a -> c
(.) b -> c
f a -> b
g = \a
x -> b -> c
f (a -> b
g a
x)
{-# INLINABLE (.) #-}
const :: a -> b -> a
const :: forall a b. a -> b -> a
const a
x b
_ = a
x
{-# INLINABLE const #-}
id :: a -> a
id :: forall a. a -> a
id a
x = a
x
{-# INLINABLE id #-}