lol-0.7.0.0: A library for lattice cryptography.

Copyright(c) Eric Crockett 2011-2017
Chris Peikert 2011-2017
LicenseGPL-3
Maintainerecrockett0@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Crypto.Lol.Types.IZipVector

Contents

Description

Provides applicative-like functions for indexed vectors.

Synopsis

Documentation

data IZipVector (m :: Factored) a Source #

Indexed Zip Vector: a wrapper around a (boxed) Vector that has zip-py Applicative behavior, analogous to ZipList for lists. The index m enforces proper lengths (and is necessary to implement pure).

Instances
Functor (IZipVector m) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Methods

fmap :: (a -> b) -> IZipVector m a -> IZipVector m b #

(<$) :: a -> IZipVector m b -> IZipVector m a #

Fact m => Applicative (IZipVector m) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Methods

pure :: a -> IZipVector m a #

(<*>) :: IZipVector m (a -> b) -> IZipVector m a -> IZipVector m b #

liftA2 :: (a -> b -> c) -> IZipVector m a -> IZipVector m b -> IZipVector m c #

(*>) :: IZipVector m a -> IZipVector m b -> IZipVector m b #

(<*) :: IZipVector m a -> IZipVector m b -> IZipVector m a #

Foldable (IZipVector m) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Methods

fold :: Monoid m0 => IZipVector m m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> IZipVector m a -> m0 #

foldr :: (a -> b -> b) -> b -> IZipVector m a -> b #

foldr' :: (a -> b -> b) -> b -> IZipVector m a -> b #

foldl :: (b -> a -> b) -> b -> IZipVector m a -> b #

foldl' :: (b -> a -> b) -> b -> IZipVector m a -> b #

foldr1 :: (a -> a -> a) -> IZipVector m a -> a #

foldl1 :: (a -> a -> a) -> IZipVector m a -> a #

toList :: IZipVector m a -> [a] #

null :: IZipVector m a -> Bool #

length :: IZipVector m a -> Int #

elem :: Eq a => a -> IZipVector m a -> Bool #

maximum :: Ord a => IZipVector m a -> a #

minimum :: Ord a => IZipVector m a -> a #

sum :: Num a => IZipVector m a -> a #

product :: Num a => IZipVector m a -> a #

Traversable (IZipVector m) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Methods

traverse :: Applicative f => (a -> f b) -> IZipVector m a -> f (IZipVector m b) #

sequenceA :: Applicative f => IZipVector m (f a) -> f (IZipVector m a) #

mapM :: Monad m0 => (a -> m0 b) -> IZipVector m a -> m0 (IZipVector m b) #

sequence :: Monad m0 => IZipVector m (m0 a) -> m0 (IZipVector m a) #

Eq a => Eq (IZipVector m a) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Methods

(==) :: IZipVector m a -> IZipVector m a -> Bool #

(/=) :: IZipVector m a -> IZipVector m a -> Bool #

Show a => Show (IZipVector m a) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Methods

showsPrec :: Int -> IZipVector m a -> ShowS #

show :: IZipVector m a -> String #

showList :: [IZipVector m a] -> ShowS #

NFData a => NFData (IZipVector m a) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Methods

rnf :: IZipVector m a -> () #

C a => C (IZipVector m a) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Methods

isZero :: IZipVector m a -> Bool #

(Protoable (IZipVector m (RRq q Double)), ProtoType (IZipVector m (RRq q Double)) ~ KqProduct, Protoable (IZipVector m b), ProtoType (IZipVector m b) ~ KqProduct) => Protoable (IZipVector m (RRq q Double, b)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Associated Types

type ProtoType (IZipVector m (RRq q Double, b)) :: Type Source #

(Protoable (IZipVector m (ZqBasic q Int64)), ProtoType (IZipVector m (ZqBasic q Int64)) ~ RqProduct, Protoable (IZipVector m b), ProtoType (IZipVector m b) ~ RqProduct) => Protoable (IZipVector m (ZqBasic q Int64, b)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Associated Types

type ProtoType (IZipVector m (ZqBasic q Int64, b)) :: Type Source #

(Fact m, Reflects q Double) => Protoable (IZipVector m (RRq q Double)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Associated Types

type ProtoType (IZipVector m (RRq q Double)) :: Type Source #

(Fact m, Reflects q Int64) => Protoable (IZipVector m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Associated Types

type ProtoType (IZipVector m (ZqBasic q Int64)) :: Type Source #

Fact m => Protoable (IZipVector m Double) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Associated Types

type ProtoType (IZipVector m Double) :: Type Source #

Fact m => Protoable (IZipVector m Int64) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

Associated Types

type ProtoType (IZipVector m Int64) :: Type Source #

type ProtoType (IZipVector m (RRq q Double, b)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

type ProtoType (IZipVector m (ZqBasic q Int64, b)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

type ProtoType (IZipVector m (RRq q Double)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

type ProtoType (IZipVector m (ZqBasic q Int64)) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

type ProtoType (IZipVector m Double) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

type ProtoType (IZipVector m Int64) Source # 
Instance details

Defined in Crypto.Lol.Types.IZipVector

iZipVector :: forall m a. Fact m => Vector a -> Maybe (IZipVector m a) Source #

Smart constructor that checks whether length of input is right (should be totient of m).

unIZipVector :: IZipVector m a -> Vector a Source #

Deconstructor

unzipIZV :: IZipVector m (a, b) -> (IZipVector m a, IZipVector m b) Source #

Unzip an IZipVector.

Orphan instances

C a => C (Vector a) Source # 
Instance details

Methods

isZero :: Vector a -> Bool #