Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
binary
======

binary-0.9.0.0
binary-x.x.x.x
--------------

- Don't reexport `Data.Word` from `Data.Binary`
- Add `Binary (Proxy a)` instance

binary-0.8.9.2
--------------
Expand Down
5 changes: 5 additions & 0 deletions src/Data/Binary/Class.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE PatternGuards #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE Trustworthy #-}

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

View workflow job for this annotation

GitHub Actions / build (8.0.2)

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

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

View workflow job for this annotation

GitHub Actions / build (8.0.2)

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

#if MIN_VERSION_base(4,16,0)
#define HAS_TYPELITS_CHAR
Expand Down Expand Up @@ -51,6 +51,7 @@
import Data.Bits
import Data.Int
import Data.Complex (Complex(..))
import Data.Proxy (Proxy(..))
#ifdef HAS_VOID
import Data.Void
#endif
Expand Down Expand Up @@ -194,6 +195,10 @@
put () = mempty
get = return ()

instance Binary (Proxy a) where
put Proxy = pure ()
get = pure Proxy

-- Bools are encoded as a byte in the range 0 .. 1
instance Binary Bool where
put = putWord8 . fromIntegral . fromEnum
Expand Down Expand Up @@ -824,9 +829,9 @@

#if __GLASGOW_HASKELL__ < 901
-- | @since 0.8.4.0
instance Binary a => Binary (Semigroup.Option a) where

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

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of type constructor or class ‘Option’

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

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of type constructor or class ‘Option’
get = fmap Semigroup.Option get

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

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of data constructor ‘Option’

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

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of data constructor ‘Option’
put = put . Semigroup.getOption

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

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of ‘getOption’ (imported from Data.Semigroup):

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

View workflow job for this annotation

GitHub Actions / build (9.0.2)

In the use of ‘getOption’ (imported from Data.Semigroup):
#endif

-- | @since 0.8.4.0
Expand Down
Loading