{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PolyKinds #-}
module Data.Proxy
(
Proxy(..), asProxyTypeOf
, KProxy(..)
) where
import GHC.Base
import GHC.Show
import GHC.Read
import GHC.Enum
import GHC.Arr
data Proxy t = Proxy deriving ( Bounded
, Read
)
data KProxy (t :: Type) = KProxy
instance Eq (Proxy s) where
_ == :: Proxy s -> Proxy s -> Bool
== _ = Bool
True
instance Ord (Proxy s) where
compare :: Proxy s -> Proxy s -> Ordering
compare _ _ = Ordering
EQ
instance Show (Proxy s) where
showsPrec :: Int -> Proxy s -> ShowS
showsPrec _ _ = String -> ShowS
showString "Proxy"
instance Enum (Proxy s) where
succ :: Proxy s -> Proxy s
succ _ = String -> Proxy s
forall a. String -> a
errorWithoutStackTrace "Proxy.succ"
pred :: Proxy s -> Proxy s
pred _ = String -> Proxy s
forall a. String -> a
errorWithoutStackTrace "Proxy.pred"
fromEnum :: Proxy s -> Int
fromEnum _ = 0
toEnum :: Int -> Proxy s
toEnum 0 = Proxy s
forall k (t :: k). Proxy t
Proxy
toEnum _ = String -> Proxy s
forall a. String -> a
errorWithoutStackTrace "Proxy.toEnum: 0 expected"
enumFrom :: Proxy s -> [Proxy s]
enumFrom _ = [Proxy s
forall k (t :: k). Proxy t
Proxy]
enumFromThen :: Proxy s -> Proxy s -> [Proxy s]
enumFromThen _ _ = [Proxy s
forall k (t :: k). Proxy t
Proxy]
enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s]
enumFromThenTo _ _ _ = [Proxy s
forall k (t :: k). Proxy t
Proxy]
enumFromTo :: Proxy s -> Proxy s -> [Proxy s]
enumFromTo _ _ = [Proxy s
forall k (t :: k). Proxy t
Proxy]
instance Ix (Proxy s) where
range :: (Proxy s, Proxy s) -> [Proxy s]
range _ = [Proxy s
forall k (t :: k). Proxy t
Proxy]
index :: (Proxy s, Proxy s) -> Proxy s -> Int
index _ _ = 0
inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool
inRange _ _ = Bool
True
rangeSize :: (Proxy s, Proxy s) -> Int
rangeSize _ = 1
unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int
unsafeIndex _ _ = 0
unsafeRangeSize :: (Proxy s, Proxy s) -> Int
unsafeRangeSize _ = 1
instance Semigroup (Proxy s) where
_ <> :: Proxy s -> Proxy s -> Proxy s
<> _ = Proxy s
forall k (t :: k). Proxy t
Proxy
sconcat :: NonEmpty (Proxy s) -> Proxy s
sconcat _ = Proxy s
forall k (t :: k). Proxy t
Proxy
stimes :: b -> Proxy s -> Proxy s
stimes _ _ = Proxy s
forall k (t :: k). Proxy t
Proxy
instance Monoid (Proxy s) where
mempty :: Proxy s
mempty = Proxy s
forall k (t :: k). Proxy t
Proxy
mconcat :: [Proxy s] -> Proxy s
mconcat _ = Proxy s
forall k (t :: k). Proxy t
Proxy
instance Functor Proxy where
fmap :: (a -> b) -> Proxy a -> Proxy b
fmap _ _ = Proxy b
forall k (t :: k). Proxy t
Proxy
{-# INLINE fmap #-}
instance Applicative Proxy where
pure :: a -> Proxy a
pure _ = Proxy a
forall k (t :: k). Proxy t
Proxy
{-# INLINE pure #-}
_ <*> :: Proxy (a -> b) -> Proxy a -> Proxy b
<*> _ = Proxy b
forall k (t :: k). Proxy t
Proxy
{-# INLINE (<*>) #-}
instance Alternative Proxy where
empty :: Proxy a
empty = Proxy a
forall k (t :: k). Proxy t
Proxy
{-# INLINE empty #-}
_ <|> :: Proxy a -> Proxy a -> Proxy a
<|> _ = Proxy a
forall k (t :: k). Proxy t
Proxy
{-# INLINE (<|>) #-}
instance Monad Proxy where
_ >>= :: Proxy a -> (a -> Proxy b) -> Proxy b
>>= _ = Proxy b
forall k (t :: k). Proxy t
Proxy
{-# INLINE (>>=) #-}
instance MonadPlus Proxy
asProxyTypeOf :: a -> proxy a -> a
asProxyTypeOf :: a -> proxy a -> a
asProxyTypeOf = a -> proxy a -> a
forall a b. a -> b -> a
const
{-# INLINE asProxyTypeOf #-}