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
10 changes: 4 additions & 6 deletions src/Data/Binary/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE Trustworthy #-}

Check warning on line 10 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / ghc (8.0.2)

‘Data.Binary.Class’ is marked as Trustworthy but has been inferred as safe!

Check warning on line 10 in src/Data/Binary/Class.hs

View workflow job for this annotation

GitHub Actions / ghc (8.0.2)

‘Data.Binary.Class’ is marked as Trustworthy but has been inferred as safe!

#if MIN_VERSION_base(4,10,0)
{-# LANGUAGE MultiWayIf #-}
Expand Down Expand Up @@ -773,12 +773,11 @@
instance (Binary i, Ix i, Binary e) => Binary (Array i e) where
put a =
put (bounds a)
<> put (rangeSize $ bounds a) -- write the length
<> mapM_ put (elems a) -- now the elems.
<> mapM_ put (elems a)
get = do
bs <- get
n <- get -- read the length
xs <- getMany n -- now the elems.
let n = rangeSize bs
xs <- getMany n
return (listArray bs xs)

--
Expand All @@ -787,11 +786,10 @@
instance (Binary i, Ix i, Binary e, IArray UArray e) => Binary (UArray i e) where
put a =
put (bounds a)
<> put (rangeSize $ bounds a) -- now write the length
<> mapM_ put (elems a)
get = do
bs <- get
n <- get
let n = rangeSize bs
xs <- getMany n
return (listArray bs xs)

Expand Down
Loading