on master help sign in
Add missing Binary cases for bitstring values
6e5c6cdBenjamin Saunders
src/Idris/IBC.hs+33−24
@@ -353,18 +353,22 @@ instance Binary Const where
353 put x1
353 put x1
354 Str x1 -> do putWord8 4
354 Str x1 -> do putWord8 4
355 put x1
355 put x1
356− IType -> putWord8 5
356+ B8 x1 -> putWord8 5 >> put x1
357− BIType -> putWord8 6
357+ B16 x1 -> putWord8 6 >> put x1
358− FlType -> putWord8 7
358+ B32 x1 -> putWord8 7 >> put x1
359+ B64 x1 -> putWord8 8 >> put x1
360+
361+ IType -> putWord8 9
362+ BIType -> putWord8 10
363+ FlType -> putWord8 11
359− ChType -> putWord8 8
364+ ChType -> putWord8 12
360− StrType -> putWord8 9
365+ StrType -> putWord8 13
361− PtrType -> putWord8 10
366+ PtrType -> putWord8 14
362− Forgot -> putWord8 11
367+ Forgot -> putWord8 15
363−
364− B8Type -> putWord8 12
368+ B8Type -> putWord8 16
365− B16Type -> putWord8 13
369+ B16Type -> putWord8 17
366− B32Type -> putWord8 14
370+ B32Type -> putWord8 18
367− B64Type -> putWord8 15
371+ B64Type -> putWord8 19
368 get
372 get
369 = do i <- getWord8
373 = do i <- getWord8
370 case i of
374 case i of
@@ -378,18 +382,23 @@ instance Binary Const where
378 return (Ch x1)
382 return (Ch x1)
379 4 -> do x1 <- get
383 4 -> do x1 <- get
380 return (Str x1)
384 return (Str x1)
385+ 5 -> fmap B8 get
386+ 6 -> fmap B16 get
387+ 7 -> fmap B32 get
388+ 8 -> fmap B64 get
389+
381− 5 -> return IType
390+ 9 -> return IType
382− 6 -> return BIType
391+ 10 -> return BIType
383− 7 -> return FlType
392+ 11 -> return FlType
384− 8 -> return ChType
393+ 12 -> return ChType
385− 9 -> return StrType
394+ 13 -> return StrType
386− 10 -> return PtrType
395+ 14 -> return PtrType
387− 11 -> return Forgot
396+ 15 -> return Forgot
388−
397+
389− 12 -> return B8Type
398+ 16 -> return B8Type
390− 13 -> return B16Type
399+ 17 -> return B16Type
391− 14 -> return B32Type
400+ 18 -> return B32Type
392− 15 -> return B64Type
401+ 19 -> return B64Type
393
402
394 _ -> error "Corrupted binary data for Const"
403 _ -> error "Corrupted binary data for Const"
395
404