summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/patches/sexpr-0.2.1.patch
blob: acafadba031ef206eae07b7295a349a377e3fd51 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Internal.hs sexpr-0.2.1-patched/Codec/Sexpr/Internal.hs
--- sexpr-0.2.1/Codec/Sexpr/Internal.hs	2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Internal.hs	2018-08-03 01:38:08.000000000 +0200
@@ -62,11 +62,6 @@
                               return $ List []]
           arbSexpr n = oneof [Atom <$> arbitrary,
                               List <$> (resize (n `div` 2) arbitrary)]
-    coarbitrary (Atom s) = variant 0 . coarbitrary s
-    coarbitrary (HintedAtom h s) = variant 1 . coarbitrary_h . coarbitrary s
-        where coarbitrary_h = 
-                foldr (\a b -> variant (ord a) . variant 1 . b) (variant 0) h
-    coarbitrary (List ss) = variant 2 . coarbitrary ss
 
 -- |@fold f s@ applies f to each sub-S-expression of s, from each leaf
 -- to the root.  @f@ need not preserve the shape of @s@, in contrast
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Printer.hs sexpr-0.2.1-patched/Codec/Sexpr/Printer.hs
--- sexpr-0.2.1/Codec/Sexpr/Printer.hs	2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Printer.hs	2018-08-03 01:41:56.000000000 +0200
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, OverlappingInstances #-}
+{-# LANGUAGE FlexibleInstances #-}
 
 -- | Export S-expressions in any of the three ordinary forms: 
 -- 
@@ -17,6 +17,8 @@
 
 module Codec.Sexpr.Printer where
 
+import Prelude hiding ((<>))
+
 import Codec.Sexpr.Internal
 
 import Data.Binary.Put
@@ -30,7 +32,7 @@
 instance Show (Sexpr String) where
     show s = advancedString s
 
-instance Show s => Show (Sexpr s) where
+instance {-# OVERLAPPABLE #-} Show s => Show (Sexpr s) where
     show s = advancedString $ fmap show s
 
 raw :: String -> String -> String
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Tests.hs sexpr-0.2.1-patched/Codec/Sexpr/Tests.hs
--- sexpr-0.2.1/Codec/Sexpr/Tests.hs	2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Tests.hs	2018-08-03 01:46:32.000000000 +0200
@@ -67,11 +67,9 @@
 
 instance Arbitrary B.ByteString where
     arbitrary = B.pack `fmap` arbitrary
-    coarbitrary = undefined
 
 instance Arbitrary Char where
   arbitrary     = choose (32,255) >>= \n -> return (chr n)
-  coarbitrary n = variant (ord n)
 
 
 main :: IO ()
diff -Naurw sexpr-0.2.1/sexpr.cabal sexpr-0.2.1-patched/sexpr.cabal
--- sexpr-0.2.1/sexpr.cabal	2018-08-03 01:36:11.000000000 +0200
+++ sexpr-0.2.1-patched/sexpr.cabal	2018-08-03 01:49:13.000000000 +0200
@@ -13,23 +13,9 @@
 maintainer:          bts@evenmere.org
 build-type: 	     Simple
 
-flag testing
-    description: build test executable
-    default: False
-
 library
-    if flag(testing)
-       ghc-options: -Wall
-    Build-Depends: base, base64-string, pretty, bytestring, binary
+    Build-Depends: base, base64-string, pretty, bytestring, binary, QuickCheck
     Exposed-modules: Codec.Sexpr
-
-executable sexpr-test
-    if !flag(testing)
-        buildable: False
-        ghc-options: -Wall
-    main-is: Codec/Sexpr/Tests.hs
-    other-modules:  Codec.Sexpr
-                    Codec.Sexpr.Parser
+    other-modules:  Codec.Sexpr.Parser
                     Codec.Sexpr.Printer
                     Codec.Sexpr.Internal
-    build-depends: QuickCheck, random