diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-09-01 15:28:07 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2016-09-02 01:42:21 -0700 |
commit | 818760d68c0e5e4479a4f64fc863303ff5f23a3a (patch) | |
tree | 776910c07ceaebf3a90dd63d5dcb8848787b938b /compiler/utils/Binary.hs | |
parent | 0cc3931bd7831fa8d042f968a5a9114534a656e4 (diff) | |
download | haskell-818760d68c0e5e4479a4f64fc863303ff5f23a3a.tar.gz |
Fix #10923 by fingerprinting optimization level.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonmar, austin, bgamari, thomie, rwbarton
Differential Revision: https://phabricator.haskell.org/D2509
GHC Trac Issues: #10923
Diffstat (limited to 'compiler/utils/Binary.hs')
-rw-r--r-- | compiler/utils/Binary.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs index 9f7c03dbcc..c3814cd908 100644 --- a/compiler/utils/Binary.hs +++ b/compiler/utils/Binary.hs @@ -420,6 +420,17 @@ instance (Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary f <- get bh return (a,b,c,d,e,f) +instance (Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g) => Binary (a,b,c,d,e,f,g) where + put_ bh (a,b,c,d,e,f,g) = do put_ bh a; put_ bh b; put_ bh c; put_ bh d; put_ bh e; put_ bh f; put_ bh g + get bh = do a <- get bh + b <- get bh + c <- get bh + d <- get bh + e <- get bh + f <- get bh + g <- get bh + return (a,b,c,d,e,f,g) + instance Binary a => Binary (Maybe a) where put_ bh Nothing = putByte bh 0 put_ bh (Just a) = do putByte bh 1; put_ bh a |