Commit 0adaed92 authored by Lennart Kolmodin's avatar Lennart Kolmodin
Browse files

Only support Void for >= GHC 7.10.

parent 57cf1f04
......@@ -50,10 +50,6 @@ library
-- prior to ghc-7.4 generics lived in ghc-prim
build-depends: ghc-prim
if impl(ghc <= 7.8)
-- Data.Void was moved to base for 7.10
build-depends: void
ghc-options: -O2 -Wall -fliberate-case-threshold=1000
-- Due to circular dependency, we cannot make any of the test-suites or
......
......@@ -8,6 +8,7 @@
#if MIN_VERSION_base(4,8,0)
#define HAS_NATURAL
#define HAS_VOID
#endif
#if __GLASGOW_HASKELL__ >= 704
......@@ -43,7 +44,9 @@ module Data.Binary.Class (
import Data.Word
import Data.Bits
import Data.Int
#ifdef HAS_VOID
import Data.Void
#endif
import Data.Binary.Put
import Data.Binary.Get
......@@ -129,11 +132,13 @@ class Binary t where
------------------------------------------------------------------------
-- Simple instances
#ifdef HAS_VOID
-- Void never gets written nor reconstructed since it's impossible to have a
-- value of that type
instance Binary Void where
put = absurd
get = mzero
#endif
-- The () type need never be written to disk: values of singleton type
-- can be reconstructed from the type alone
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment