We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Binary (Proxy a)
1 parent a0e29ca commit aad266dCopy full SHA for aad266d
2 files changed
changelog.md
@@ -1,10 +1,11 @@
1
binary
2
======
3
4
-binary-0.9.0.0
+binary-x.x.x.x
5
--------------
6
7
- Don't reexport `Data.Word` from `Data.Binary`
8
+- Add `Binary (Proxy a)` instance
9
10
binary-0.8.9.2
11
src/Data/Binary/Class.hs
@@ -51,6 +51,7 @@ import Data.Word
51
import Data.Bits
52
import Data.Int
53
import Data.Complex (Complex(..))
54
+import Data.Proxy (Proxy(..))
55
#ifdef HAS_VOID
56
import Data.Void
57
#endif
@@ -194,6 +195,10 @@ instance Binary () where
194
195
put () = mempty
196
get = return ()
197
198
+instance Binary (Proxy a) where
199
+ put Proxy = pure ()
200
+ get = pure Proxy
201
+
202
-- Bools are encoded as a byte in the range 0 .. 1
203
instance Binary Bool where
204
put = putWord8 . fromIntegral . fromEnum
0 commit comments