jbi-0.1.0.0: Just Build It - a "do what I mean" abstraction for Haskell build tools

Copyright(c) Ivan Lazar Miljenovic
LicenseMIT
MaintainerIvan.Miljenovic@gmail.com
Safe HaskellNone
LanguageHaskell2010

System.JBI.Tagged

Contents

Description

 

Synopsis

Documentation

class WithTagged g where Source #

Methods

withTaggedF :: (Coercible a a', Coercible b b', Functor f) => (a' -> f (g b')) -> Tagged t a -> f (g (Tagged t b)) Source #

Strip off type safety, run the function, put type safety back on.

withTaggedF :: (Coercible a a', Coercible b b', Functor f, Coercible (g b') (g (Tagged t b)), Coercible (g (Tagged t b)) (g b')) => (a' -> f (g b')) -> Tagged t a -> f (g (Tagged t b)) Source #

Strip off type safety, run the function, put type safety back on.

tagInner :: Tagged t (g a) -> g (Tagged t a) Source #

tagInner :: (Coercible (Tagged t (g a)) (g (Tagged t a)), Coercible (g (Tagged t a)) (g a)) => Tagged t (g a) -> g (Tagged t a) Source #

tagOuter :: g (Tagged t a) -> Tagged t (g a) Source #

tagOuter :: Coercible (g (Tagged t a)) (Tagged t (g a)) => g (Tagged t a) -> Tagged t (g a) Source #

Instances

WithTagged [] Source # 

Methods

withTaggedF :: (Coercible * a a', Coercible * b b', Functor f) => (a' -> f [b']) -> Tagged * t a -> f [Tagged * t b] Source #

tagInner :: Tagged * t [a] -> [Tagged * t a] Source #

tagOuter :: [Tagged * t a] -> Tagged * t [a] Source #

WithTagged Maybe Source # 

Methods

withTaggedF :: (Coercible * a a', Coercible * b b', Functor f) => (a' -> f (Maybe b')) -> Tagged * t a -> f (Maybe (Tagged * t b)) Source #

tagInner :: Tagged * t (Maybe a) -> Maybe (Tagged * t a) Source #

tagOuter :: Maybe (Tagged * t a) -> Tagged * t (Maybe a) Source #

stripTag :: Coercible a a' => Tagged t a -> a' Source #

Remove the tag along with (potentially) any newtype wrappers added on.

stripTags :: Coercible a a' => [Tagged t a] -> [a'] Source #

tag :: Coercible a a' => a -> Tagged t a' Source #

Put the appropriate tag on.

Re-export

newtype Tagged k s b :: forall k. k -> * -> * #

A Tagged s b value is a value b with an attached phantom type s. This can be used in place of the more traditional but less safe idiom of passing in an undefined value with the type, because unlike an (s -> b), a Tagged s b can't try to use the argument s as a real value.

Moreover, you don't have to rely on the compiler to inline away the extra argument, because the newtype is "free"

Tagged has kind k -> * -> * if the compiler supports PolyKinds, therefore there is an extra k showing in the instance haddocks that may cause confusion.

Constructors

Tagged 

Fields

Instances

ToJSON2 (Tagged *) 

Methods

liftToJSON2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> Tagged * a b -> Value #

liftToJSONList2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> [Tagged * a b] -> Value #

liftToEncoding2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> Tagged * a b -> Encoding #

liftToEncodingList2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> [Tagged * a b] -> Encoding #

Eq2 (Tagged *) 

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Tagged * a c -> Tagged * b d -> Bool #

Ord2 (Tagged *) 

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Tagged * a c -> Tagged * b d -> Ordering #

Read2 (Tagged *) 

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Tagged * a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Tagged * a b] #

Show2 (Tagged *) 

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Tagged * a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Tagged * a b] -> ShowS #

Bifunctor (Tagged *) 

Methods

bimap :: (a -> b) -> (c -> d) -> Tagged * a c -> Tagged * b d #

first :: (a -> b) -> Tagged * a c -> Tagged * b c #

second :: (b -> c) -> Tagged * a b -> Tagged * a c #

Monad (Tagged k s) 

Methods

(>>=) :: Tagged k s a -> (a -> Tagged k s b) -> Tagged k s b #

(>>) :: Tagged k s a -> Tagged k s b -> Tagged k s b #

return :: a -> Tagged k s a #

fail :: String -> Tagged k s a #

Functor (Tagged k s) 

Methods

fmap :: (a -> b) -> Tagged k s a -> Tagged k s b #

(<$) :: a -> Tagged k s b -> Tagged k s a #

Applicative (Tagged k s) 

Methods

pure :: a -> Tagged k s a #

(<*>) :: Tagged k s (a -> b) -> Tagged k s a -> Tagged k s b #

(*>) :: Tagged k s a -> Tagged k s b -> Tagged k s b #

(<*) :: Tagged k s a -> Tagged k s b -> Tagged k s a #

Foldable (Tagged k s) 

Methods

fold :: Monoid m => Tagged k s m -> m #

foldMap :: Monoid m => (a -> m) -> Tagged k s a -> m #

foldr :: (a -> b -> b) -> b -> Tagged k s a -> b #

foldr' :: (a -> b -> b) -> b -> Tagged k s a -> b #

foldl :: (b -> a -> b) -> b -> Tagged k s a -> b #

foldl' :: (b -> a -> b) -> b -> Tagged k s a -> b #

foldr1 :: (a -> a -> a) -> Tagged k s a -> a #

foldl1 :: (a -> a -> a) -> Tagged k s a -> a #

toList :: Tagged k s a -> [a] #

null :: Tagged k s a -> Bool #

length :: Tagged k s a -> Int #

elem :: Eq a => a -> Tagged k s a -> Bool #

maximum :: Ord a => Tagged k s a -> a #

minimum :: Ord a => Tagged k s a -> a #

sum :: Num a => Tagged k s a -> a #

product :: Num a => Tagged k s a -> a #

Traversable (Tagged k s) 

Methods

traverse :: Applicative f => (a -> f b) -> Tagged k s a -> f (Tagged k s b) #

sequenceA :: Applicative f => Tagged k s (f a) -> f (Tagged k s a) #

mapM :: Monad m => (a -> m b) -> Tagged k s a -> m (Tagged k s b) #

sequence :: Monad m => Tagged k s (m a) -> m (Tagged k s a) #

Generic1 (Tagged k s) 

Associated Types

type Rep1 (Tagged k s :: * -> *) :: * -> * #

Methods

from1 :: Tagged k s a -> Rep1 (Tagged k s) a #

to1 :: Rep1 (Tagged k s) a -> Tagged k s a #

ToJSON1 (Tagged k a) 

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Tagged k a a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Tagged k a a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Tagged k a a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Tagged k a a] -> Encoding #

Eq1 (Tagged k s) 

Methods

liftEq :: (a -> b -> Bool) -> Tagged k s a -> Tagged k s b -> Bool #

Ord1 (Tagged k s) 

Methods

liftCompare :: (a -> b -> Ordering) -> Tagged k s a -> Tagged k s b -> Ordering #

Read1 (Tagged k s) 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Tagged k s a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Tagged k s a] #

Show1 (Tagged k s) 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Tagged k s a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Tagged k s a] -> ShowS #

Bounded b => Bounded (Tagged k s b) 

Methods

minBound :: Tagged k s b #

maxBound :: Tagged k s b #

Enum a => Enum (Tagged k s a) 

Methods

succ :: Tagged k s a -> Tagged k s a #

pred :: Tagged k s a -> Tagged k s a #

toEnum :: Int -> Tagged k s a #

fromEnum :: Tagged k s a -> Int #

enumFrom :: Tagged k s a -> [Tagged k s a] #

enumFromThen :: Tagged k s a -> Tagged k s a -> [Tagged k s a] #

enumFromTo :: Tagged k s a -> Tagged k s a -> [Tagged k s a] #

enumFromThenTo :: Tagged k s a -> Tagged k s a -> Tagged k s a -> [Tagged k s a] #

Eq b => Eq (Tagged k s b) 

Methods

(==) :: Tagged k s b -> Tagged k s b -> Bool #

(/=) :: Tagged k s b -> Tagged k s b -> Bool #

Floating a => Floating (Tagged k s a) 

Methods

pi :: Tagged k s a #

exp :: Tagged k s a -> Tagged k s a #

log :: Tagged k s a -> Tagged k s a #

sqrt :: Tagged k s a -> Tagged k s a #

(**) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

logBase :: Tagged k s a -> Tagged k s a -> Tagged k s a #

sin :: Tagged k s a -> Tagged k s a #

cos :: Tagged k s a -> Tagged k s a #

tan :: Tagged k s a -> Tagged k s a #

asin :: Tagged k s a -> Tagged k s a #

acos :: Tagged k s a -> Tagged k s a #

atan :: Tagged k s a -> Tagged k s a #

sinh :: Tagged k s a -> Tagged k s a #

cosh :: Tagged k s a -> Tagged k s a #

tanh :: Tagged k s a -> Tagged k s a #

asinh :: Tagged k s a -> Tagged k s a #

acosh :: Tagged k s a -> Tagged k s a #

atanh :: Tagged k s a -> Tagged k s a #

log1p :: Tagged k s a -> Tagged k s a #

expm1 :: Tagged k s a -> Tagged k s a #

log1pexp :: Tagged k s a -> Tagged k s a #

log1mexp :: Tagged k s a -> Tagged k s a #

Fractional a => Fractional (Tagged k s a) 

Methods

(/) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

recip :: Tagged k s a -> Tagged k s a #

fromRational :: Rational -> Tagged k s a #

Integral a => Integral (Tagged k s a) 

Methods

quot :: Tagged k s a -> Tagged k s a -> Tagged k s a #

rem :: Tagged k s a -> Tagged k s a -> Tagged k s a #

div :: Tagged k s a -> Tagged k s a -> Tagged k s a #

mod :: Tagged k s a -> Tagged k s a -> Tagged k s a #

quotRem :: Tagged k s a -> Tagged k s a -> (Tagged k s a, Tagged k s a) #

divMod :: Tagged k s a -> Tagged k s a -> (Tagged k s a, Tagged k s a) #

toInteger :: Tagged k s a -> Integer #

(Data s, Data b) => Data (Tagged * s b) 

Methods

gfoldl :: (forall d a. Data d => c (d -> a) -> d -> c a) -> (forall g. g -> c g) -> Tagged * s b -> c (Tagged * s b) #

gunfold :: (forall a r. Data a => c (a -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tagged * s b) #

toConstr :: Tagged * s b -> Constr #

dataTypeOf :: Tagged * s b -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Tagged * s b)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tagged * s b)) #

gmapT :: (forall a. Data a => a -> a) -> Tagged * s b -> Tagged * s b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tagged * s b -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tagged * s b -> r #

gmapQ :: (forall d. Data d => d -> u) -> Tagged * s b -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Tagged * s b -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tagged * s b -> m (Tagged * s b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged * s b -> m (Tagged * s b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged * s b -> m (Tagged * s b) #

Num a => Num (Tagged k s a) 

Methods

(+) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

(-) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

(*) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

negate :: Tagged k s a -> Tagged k s a #

abs :: Tagged k s a -> Tagged k s a #

signum :: Tagged k s a -> Tagged k s a #

fromInteger :: Integer -> Tagged k s a #

Ord b => Ord (Tagged k s b) 

Methods

compare :: Tagged k s b -> Tagged k s b -> Ordering #

(<) :: Tagged k s b -> Tagged k s b -> Bool #

(<=) :: Tagged k s b -> Tagged k s b -> Bool #

(>) :: Tagged k s b -> Tagged k s b -> Bool #

(>=) :: Tagged k s b -> Tagged k s b -> Bool #

max :: Tagged k s b -> Tagged k s b -> Tagged k s b #

min :: Tagged k s b -> Tagged k s b -> Tagged k s b #

Read b => Read (Tagged k s b) 

Methods

readsPrec :: Int -> ReadS (Tagged k s b) #

readList :: ReadS [Tagged k s b] #

readPrec :: ReadPrec (Tagged k s b) #

readListPrec :: ReadPrec [Tagged k s b] #

Real a => Real (Tagged k s a) 

Methods

toRational :: Tagged k s a -> Rational #

RealFloat a => RealFloat (Tagged k s a) 

Methods

floatRadix :: Tagged k s a -> Integer #

floatDigits :: Tagged k s a -> Int #

floatRange :: Tagged k s a -> (Int, Int) #

decodeFloat :: Tagged k s a -> (Integer, Int) #

encodeFloat :: Integer -> Int -> Tagged k s a #

exponent :: Tagged k s a -> Int #

significand :: Tagged k s a -> Tagged k s a #

scaleFloat :: Int -> Tagged k s a -> Tagged k s a #

isNaN :: Tagged k s a -> Bool #

isInfinite :: Tagged k s a -> Bool #

isDenormalized :: Tagged k s a -> Bool #

isNegativeZero :: Tagged k s a -> Bool #

isIEEE :: Tagged k s a -> Bool #

atan2 :: Tagged k s a -> Tagged k s a -> Tagged k s a #

RealFrac a => RealFrac (Tagged k s a) 

Methods

properFraction :: Integral b => Tagged k s a -> (b, Tagged k s a) #

truncate :: Integral b => Tagged k s a -> b #

round :: Integral b => Tagged k s a -> b #

ceiling :: Integral b => Tagged k s a -> b #

floor :: Integral b => Tagged k s a -> b #

Show b => Show (Tagged k s b) 

Methods

showsPrec :: Int -> Tagged k s b -> ShowS #

show :: Tagged k s b -> String #

showList :: [Tagged k s b] -> ShowS #

Ix b => Ix (Tagged k s b) 

Methods

range :: (Tagged k s b, Tagged k s b) -> [Tagged k s b] #

index :: (Tagged k s b, Tagged k s b) -> Tagged k s b -> Int #

unsafeIndex :: (Tagged k s b, Tagged k s b) -> Tagged k s b -> Int

inRange :: (Tagged k s b, Tagged k s b) -> Tagged k s b -> Bool #

rangeSize :: (Tagged k s b, Tagged k s b) -> Int #

unsafeRangeSize :: (Tagged k s b, Tagged k s b) -> Int

IsString a => IsString (Tagged k s a) 

Methods

fromString :: String -> Tagged k s a #

Generic (Tagged k s b) 

Associated Types

type Rep (Tagged k s b) :: * -> * #

Methods

from :: Tagged k s b -> Rep (Tagged k s b) x #

to :: Rep (Tagged k s b) x -> Tagged k s b #

Semigroup a => Semigroup (Tagged k s a) 

Methods

(<>) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

sconcat :: NonEmpty (Tagged k s a) -> Tagged k s a #

stimes :: Integral b => b -> Tagged k s a -> Tagged k s a #

(Semigroup a, Monoid a) => Monoid (Tagged k s a) 

Methods

mempty :: Tagged k s a #

mappend :: Tagged k s a -> Tagged k s a -> Tagged k s a #

mconcat :: [Tagged k s a] -> Tagged k s a #

ToJSON b => ToJSON (Tagged k a b) 

Methods

toJSON :: Tagged k a b -> Value #

toEncoding :: Tagged k a b -> Encoding #

toJSONList :: [Tagged k a b] -> Value #

toEncodingList :: [Tagged k a b] -> Encoding #

ToJSONKey b => ToJSONKey (Tagged k a b) 
Storable a => Storable (Tagged k s a) 

Methods

sizeOf :: Tagged k s a -> Int #

alignment :: Tagged k s a -> Int #

peekElemOff :: Ptr (Tagged k s a) -> Int -> IO (Tagged k s a) #

pokeElemOff :: Ptr (Tagged k s a) -> Int -> Tagged k s a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Tagged k s a) #

pokeByteOff :: Ptr b -> Int -> Tagged k s a -> IO () #

peek :: Ptr (Tagged k s a) -> IO (Tagged k s a) #

poke :: Ptr (Tagged k s a) -> Tagged k s a -> IO () #

Bits a => Bits (Tagged k s a) 

Methods

(.&.) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

(.|.) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

xor :: Tagged k s a -> Tagged k s a -> Tagged k s a #

complement :: Tagged k s a -> Tagged k s a #

shift :: Tagged k s a -> Int -> Tagged k s a #

rotate :: Tagged k s a -> Int -> Tagged k s a #

zeroBits :: Tagged k s a #

bit :: Int -> Tagged k s a #

setBit :: Tagged k s a -> Int -> Tagged k s a #

clearBit :: Tagged k s a -> Int -> Tagged k s a #

complementBit :: Tagged k s a -> Int -> Tagged k s a #

testBit :: Tagged k s a -> Int -> Bool #

bitSizeMaybe :: Tagged k s a -> Maybe Int #

bitSize :: Tagged k s a -> Int #

isSigned :: Tagged k s a -> Bool #

shiftL :: Tagged k s a -> Int -> Tagged k s a #

unsafeShiftL :: Tagged k s a -> Int -> Tagged k s a #

shiftR :: Tagged k s a -> Int -> Tagged k s a #

unsafeShiftR :: Tagged k s a -> Int -> Tagged k s a #

rotateL :: Tagged k s a -> Int -> Tagged k s a #

rotateR :: Tagged k s a -> Int -> Tagged k s a #

popCount :: Tagged k s a -> Int #

FiniteBits a => FiniteBits (Tagged k s a) 

Methods

finiteBitSize :: Tagged k s a -> Int #

countLeadingZeros :: Tagged k s a -> Int #

countTrailingZeros :: Tagged k s a -> Int #

NFData b => NFData (Tagged k s b) 

Methods

rnf :: Tagged k s b -> () #

type Rep1 (Tagged k s) 
type Rep1 (Tagged k s) = D1 (MetaData "Tagged" "Data.Tagged" "tagged-0.8.5-jDBtbBndklGIlXZjVMhpH" True) (C1 (MetaCons "Tagged" PrefixI True) (S1 (MetaSel (Just Symbol "unTagged") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep (Tagged k s b) 
type Rep (Tagged k s b) = D1 (MetaData "Tagged" "Data.Tagged" "tagged-0.8.5-jDBtbBndklGIlXZjVMhpH" True) (C1 (MetaCons "Tagged" PrefixI True) (S1 (MetaSel (Just Symbol "unTagged") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 b)))

proxy :: Tagged k s a -> proxy s -> a #

Convert from a Tagged representation to a representation based on a Proxy.