vext-0.1.7.0: src/Vector/Int64.hs
{-# language DataKinds #-}
{-# language MagicHash #-}
{-# language NumericUnderscores #-}
{-# language BangPatterns #-}
{-# language TypeApplications #-}
{-# language TypeOperators #-}
module Vector.Int64
( -- Types
Vector(..)
, Vector#
, MutableVector(..)
, MutableVector#
, Bounded(..)
-- * Primitives
, write#
, write
, read#
, index#
, index
, unlift
, substitute
, initialized
, unsafeCoerceLength
, expose
, expose#
-- * Ranges
, set
, setSlice
-- * Freeze
, unsafeShrinkFreeze
, unsafeFreeze
, freeze
, freezeSlice
-- * Copy
, thaw
-- * Composite
, map
, foldr
, ifoldl'
, ifoldlSlice'
, traverse_
, itraverse_
, replicate
, empty
, empty_
, construct3
, construct4
, append
, clone
, cloneSlice
-- * Index
, index0
, index1
, index2
, index3
-- * Ordered
, unique
, equals
, maximum
, maximumSlice
, maximumSliceInitial
, bubbleSort
, bubbleSortSlice
, bubbleSortSliceInPlace
, mapEq
-- * Show
, show
-- * Interop with primitive
, cloneFromByteArray
) where
import Prelude hiding (replicate,map,maximum,Bounded,all,foldr,show)
import Arithmetic.Types (Nat#)
import Data.Primitive (ByteArray)
import GHC.Exts (Int64#)
import GHC.Int (Int64(I64#))
import Vector.Std.Int64
import Vector.Ord.Int64
import qualified Vector.Prim.Int64
-- | Crashes the program if the range is out of bounds. That is,
-- behavior is always well defined.
--
-- Interprets the bytes in a native-endian fashion.
cloneFromByteArray ::
Int -- ^ Offset into byte array, units are elements, not bytes
-> Nat# n -- ^ Length of the vector, units are elements, not bytes
-> ByteArray
-> Vector n Int64#
cloneFromByteArray = Vector.Prim.Int64.unsafeCloneFromByteArray
show :: Nat# n -> Vector n Int64# -> String
show n v = liftShows (\i s -> shows (I64# i) s) n v ""