Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Data/Vector/Binary.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
--------------------------------------------------------------------
-- |
Expand Down Expand Up @@ -50,6 +51,9 @@ import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Storable as S
import qualified Data.Vector.Primitive as P
import Data.Vector (Vector)
#if MIN_VERSION_vector(0,13,2)
import qualified Data.Vector.Strict as VV
#endif
import System.IO.Unsafe

import Foreign.Storable (Storable)
Expand All @@ -62,6 +66,14 @@ instance Binary a => Binary (Vector a) where
get = genericGetVector
{-# INLINE get #-}

#if MIN_VERSION_vector(0,13,2)
instance Binary a => Binary (VV.Vector a) where
put = genericPutVector
get = genericGetVector
{-# INLINE get #-}
#endif


-- | Unboxed vectors
instance (U.Unbox a, Binary a) => Binary (U.Vector a) where
put = genericPutVector
Expand Down