type-hint-0.1: Guide type inference with proxy values
Safe HaskellSafe-Inferred
LanguageHaskell2010

Type.Hint

Description

This module provides Proxy values for various types from the base library and functions to use these values as hints for type inference.

Synopsis

Hinting functions

hintType :: α -> p α -> α infixl 1 Source #

Hint the type system about the type.

hintType1 :: f α -> p f -> f α infixl 1 Source #

Hint the type system about the type constructor.

hintTypeArg :: f α -> p α -> f α infixl 1 Source #

Hint the type system about the type argument.

hintType2 :: f α β -> p f -> f α β infixl 1 Source #

Hint the type system about the two-argument type constructor.

hintType2Arg1 :: f α β -> p α -> f α β infixl 1 Source #

Hint the type system about the first type argument.

hintType2Arg2 :: f α β -> p β -> f α β infixl 1 Source #

Hint the type system about the second type argument.

hintType3 :: f α β γ -> p f -> f α β γ infixl 1 Source #

Hint the type system about the three-argument type constructor.

hintType3Arg1 :: f α β γ -> p α -> f α β γ infixl 1 Source #

Hint the type system about the first type argument.

hintType3Arg2 :: f α β γ -> p β -> f α β γ infixl 1 Source #

Hint the type system about the second type argument.

hintType3Arg3 :: f α β γ -> p γ -> f α β γ infixl 1 Source #

Hint the type system about the third type argument.

Standard types proxies

data Proxy (t :: k) #

Constructors

Proxy 

Instances

Instances details
Monad (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b

(>>) :: Proxy a -> Proxy b -> Proxy b

return :: a -> Proxy a

Functor (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b

(<$) :: a -> Proxy b -> Proxy a

Applicative (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c

(*>) :: Proxy a -> Proxy b -> Proxy b

(<*) :: Proxy a -> Proxy b -> Proxy a

Foldable (Proxy :: Type -> Type) 
Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m

foldMap :: Monoid m => (a -> m) -> Proxy a -> m

foldMap' :: Monoid m => (a -> m) -> Proxy a -> m

foldr :: (a -> b -> b) -> b -> Proxy a -> b

foldr' :: (a -> b -> b) -> b -> Proxy a -> b

foldl :: (b -> a -> b) -> b -> Proxy a -> b

foldl' :: (b -> a -> b) -> b -> Proxy a -> b

foldr1 :: (a -> a -> a) -> Proxy a -> a

foldl1 :: (a -> a -> a) -> Proxy a -> a

toList :: Proxy a -> [a]

null :: Proxy a -> Bool

length :: Proxy a -> Int

elem :: Eq a => a -> Proxy a -> Bool

maximum :: Ord a => Proxy a -> a

minimum :: Ord a => Proxy a -> a

sum :: Num a => Proxy a -> a

product :: Num a => Proxy a -> a

Traversable (Proxy :: Type -> Type) 
Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b)

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a)

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b)

sequence :: Monad m => Proxy (m a) -> m (Proxy a)

Alternative (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

empty :: Proxy a

(<|>) :: Proxy a -> Proxy a -> Proxy a

some :: Proxy a -> Proxy [a]

many :: Proxy a -> Proxy [a]

MonadPlus (Proxy :: Type -> Type) 
Instance details

Defined in Data.Proxy

Methods

mzero :: Proxy a

mplus :: Proxy a -> Proxy a -> Proxy a

Bounded (Proxy t) 
Instance details

Defined in Data.Proxy

Methods

minBound :: Proxy t

maxBound :: Proxy t

Enum (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

succ :: Proxy s -> Proxy s

pred :: Proxy s -> Proxy s

toEnum :: Int -> Proxy s

fromEnum :: Proxy s -> Int

enumFrom :: Proxy s -> [Proxy s]

enumFromThen :: Proxy s -> Proxy s -> [Proxy s]

enumFromTo :: Proxy s -> Proxy s -> [Proxy s]

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s]

Eq (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

(==) :: Proxy s -> Proxy s -> Bool

(/=) :: Proxy s -> Proxy s -> Bool

Ord (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

compare :: Proxy s -> Proxy s -> Ordering

(<) :: Proxy s -> Proxy s -> Bool

(<=) :: Proxy s -> Proxy s -> Bool

(>) :: Proxy s -> Proxy s -> Bool

(>=) :: Proxy s -> Proxy s -> Bool

max :: Proxy s -> Proxy s -> Proxy s

min :: Proxy s -> Proxy s -> Proxy s

Read (Proxy t) 
Instance details

Defined in Data.Proxy

Methods

readsPrec :: Int -> ReadS (Proxy t)

readList :: ReadS [Proxy t]

readPrec :: ReadPrec (Proxy t)

readListPrec :: ReadPrec [Proxy t]

Show (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS

show :: Proxy s -> String

showList :: [Proxy s] -> ShowS

Ix (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

range :: (Proxy s, Proxy s) -> [Proxy s]

index :: (Proxy s, Proxy s) -> Proxy s -> Int

unsafeIndex :: (Proxy s, Proxy s) -> Proxy s -> Int

inRange :: (Proxy s, Proxy s) -> Proxy s -> Bool

rangeSize :: (Proxy s, Proxy s) -> Int

unsafeRangeSize :: (Proxy s, Proxy s) -> Int

Semigroup (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s

sconcat :: NonEmpty (Proxy s) -> Proxy s

stimes :: Integral b => b -> Proxy s -> Proxy s

Monoid (Proxy s) 
Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s

mappend :: Proxy s -> Proxy s -> Proxy s

mconcat :: [Proxy s] -> Proxy s

aUnit :: Proxy () Source #

() proxy value.

aChar :: Proxy Char Source #

Char proxy value.

anInteger :: Proxy Integer Source #

Integer proxy value.

anInt :: Proxy Int Source #

Int proxy value.

anInt8 :: Proxy Int8 Source #

Int8 proxy value.

anInt16 :: Proxy Int16 Source #

Int16 proxy value.

anInt32 :: Proxy Int32 Source #

Int32 proxy value.

anInt64 :: Proxy Int64 Source #

Int64 proxy value.

aWord :: Proxy Word Source #

Word proxy value.

aWord8 :: Proxy Word8 Source #

Word8 proxy value.

aWord16 :: Proxy Word16 Source #

Word16 proxy value.

aWord32 :: Proxy Word32 Source #

Word32 proxy value.

aWord64 :: Proxy Word64 Source #

Word64 proxy value.

aRatio :: Proxy Ratio Source #

Ratio proxy value.

aRatioOf :: Proxy α -> Proxy (Ratio α) Source #

Ratio α proxy value.

aRational :: Proxy Rational Source #

Rational proxy value.

aFixed :: Proxy Fixed Source #

Fixed proxy value.

aFixedOf :: Proxy α -> Proxy (Fixed α) Source #

Fixed α proxy value.

aUni :: Proxy Uni Source #

Uni proxy value.

aDeci :: Proxy Deci Source #

Deci proxy value.

aCenti :: Proxy Centi Source #

Centi proxy value.

aMilli :: Proxy Milli Source #

Milli proxy value.

aMicro :: Proxy Micro Source #

Micro proxy value.

aNano :: Proxy Nano Source #

Nano proxy value.

aPico :: Proxy Pico Source #

Pico proxy value.

aFloat :: Proxy Float Source #

Float proxy value.

aDouble :: Proxy Double Source #

Double proxy value.

aMaybe :: Proxy Maybe Source #

Maybe proxy value.

aMaybeOf :: Proxy α -> Proxy (Maybe α) Source #

Maybe α proxy value.

aPair :: Proxy (,) Source #

Pair proxy value.

aPairOf :: Proxy α -> Proxy β -> Proxy (α, β) Source #

(α, β) proxy value.

aTriple :: Proxy (,,) Source #

Triple proxy value.

aTripleOf :: Proxy α -> Proxy β -> Proxy γ -> Proxy (α, β, γ) Source #

(α, β, γ) proxy value.

anEither :: Proxy Either Source #

Either proxy value.

anEitherOf :: Proxy α -> Proxy β -> Proxy (Either α β) Source #

Either α β proxy value.

aList :: Proxy [] Source #

List proxy value.

aListOf :: Proxy α -> Proxy [α] Source #

List of α proxy value.

anIo :: Proxy IO Source #

IO proxy value.

anIoOf :: Proxy α -> Proxy (IO α) Source #

IO α proxy value.

anIoRef :: Proxy IORef Source #

IORef proxy value.

anIoRefOf :: Proxy α -> Proxy (IORef α) Source #

IORef α proxy value.

anSt :: Proxy ST Source #

ST proxy value.

anStOf :: Proxy α -> Proxy (ST α) Source #

ST α proxy value.

anStRef :: Proxy STRef Source #

STRef proxy value.

anStRefOf :: Proxy α -> Proxy (STRef α) Source #

STRef α proxy value.