-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Define embeddings of small bit vectors into larger ones -- -- Data structures for defining embeddings of small bit vectors into -- larger ones. Functions that perform the embedding and extracting. @package bv-embed @version 0.1.0 -- | This module exports types and functions for defining how a small bit -- vector is embedded into a larger one. module Data.BitVector.Embed -- | Defines a mapping from each bit of a small bit vector into a larger -- one. data BitEmbedding -- | Construct a BitEmbedding from a list, where the length of the -- list is the same as the width of the "small" bit vector we are -- embedding into the larger one. The nth element of the list tells us at -- which bit index in the target to embed bit n of the source. fromList :: [Int] -> BitEmbedding -- | Embed a smaller bit vector into a larger one using a -- BitEmbedding. -- --
-- >>> bitEmbed (fromList [4,5,7] 7 0) -- 176 --bitEmbed :: (Bits src, Bits tgt) => BitEmbedding -> src -> tgt -> tgt -- | Extract a smaller bit vector from a larger one using a -- BitEmbedding. -- --
-- >>> bitExtract (fromList [4,5,7] 7 0) 176 -- 7 --bitExtract :: (Bits src, Bits tgt) => BitEmbedding -> tgt -> src instance GHC.Show.Show Data.BitVector.Embed.BitEmbedding instance GHC.Classes.Ord Data.BitVector.Embed.BitEmbedding instance GHC.Classes.Eq Data.BitVector.Embed.BitEmbedding