git.iko.soy/typeable/bloodhound
on master help sign in
Merge remote-tracking branch 'upstream/master' into es5
ca25c0dJosh Berman
.travis.yml+2−2
@@ -16,13 +16,13 @@ env:
16 - GHCVER=7.10 ESVER=1.5.2
16 - GHCVER=7.10 ESVER=1.5.2
17 - GHCVER=7.10 ESVER=1.6.0
17 - GHCVER=7.10 ESVER=1.6.0
18 - GHCVER=7.10 ESVER=1.7.2
18 - GHCVER=7.10 ESVER=1.7.2
19+ - GHCVER=8.0 ESVER=1.7.2
19
20
20install:
21install:
21 # stack
22 # stack
22 - export STACK_YAML=stack-$GHCVER.yaml
23 - export STACK_YAML=stack-$GHCVER.yaml
23 - mkdir -p ~/.local/bin
24 - mkdir -p ~/.local/bin
24− - travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v0.1.4.0/stack-0.1.4.0-x86_64-linux.tar.gz | tar -xvzf -
25+ - travis_retry curl -L https://github.com/commercialhaskell/stack/releases/download/v1.2.0/stack-1.2.0-linux-x86_64.tar.gz | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
25− - mv stack ~/.local/bin
26 - export PATH=~/.local/bin:$PATH
26 - export PATH=~/.local/bin:$PATH
27 - stack --version
27 - stack --version
28
28
bloodhound5.cabal+4−4
@@ -9,7 +9,7 @@ author: Chris Allen
9maintainer: cma@bitemyapp.com
9maintainer: cma@bitemyapp.com
10copyright: 2015, Chris Allen
10copyright: 2015, Chris Allen
11category: Database, Search
11category: Database, Search
12−build-type: Custom
12+build-type: Simple
13cabal-version: >=1.10
13cabal-version: >=1.10
14
14
15extra-source-files:
15extra-source-files:
@@ -32,7 +32,7 @@ library
32 build-depends: base >= 4.3 && <5,
32 build-depends: base >= 4.3 && <5,
33 bytestring >= 0.10.0 && <0.11,
33 bytestring >= 0.10.0 && <0.11,
34 containers >= 0.5.0.0 && <0.6,
34 containers >= 0.5.0.0 && <0.6,
35− aeson >= 0.11.1 && <0.12,
35+ aeson >= 0.11.1 && <1.1,
36 http-client >= 0.4.30 && <0.6,
36 http-client >= 0.4.30 && <0.6,
37 network-uri >= 2.6 && <2.7,
37 network-uri >= 2.6 && <2.7,
38 semigroups >= 0.15 && <0.19,
38 semigroups >= 0.15 && <0.19,
@@ -62,7 +62,7 @@ test-suite tests
62 http-client,
62 http-client,
63 http-types,
63 http-types,
64 containers,
64 containers,
65− hspec >= 1.8 && <2.3,
65+ hspec >= 1.8 && <2.4,
66 text,
66 text,
67 time,
67 time,
68 aeson,
68 aeson,
@@ -72,7 +72,7 @@ test-suite tests
72 unordered-containers >= 0.2.5.0 && <0.3,
72 unordered-containers >= 0.2.5.0 && <0.3,
73 mtl,
73 mtl,
74 quickcheck-properties,
74 quickcheck-properties,
75− derive,
75+ generics-sop >=0.2 && <0.3,
76 errors,
76 errors,
77 exceptions,
77 exceptions,
78 temporary,
78 temporary,
changelog.md+39−4
@@ -1,7 +1,42 @@
10.12.0.0
10.12.0.0
2===================
2===================
3+This release contains several new APIs, documentation fixes, and some minor type updates, and steps towards ES 2.0 support. Thanks to all of our contributors!
4+
5+* @bermanjosh
3−* #138 Make `nodeOSLoad` record a `Maybe` for Windows compatibility
6+ - #139 Make `nodeOSLoad` record a `Maybe` for Windows compatibility
4−* #138 Change the `nodePluginVersion` record to deal with plugins which report `NA` as their version.
7+ - #138 Change the `nodePluginVersion` record to deal with plugins which report `NA` as their version.
8+* @phadej
9+ - #155 Shed `derive` dependency in test.
10+ - #154 Switch to `Simple` build type.
11+ - #153 Loosen deps on aeson, hspec.
12+* @andrewthad
13+ - #151 Add `waitForYellowIndex`
14+* @michaelxavier
15+ - #150 Fix some failing QuickCheck tests.
16+ - #147 Drop dependency on deprecated doctest-prop.
17+ - #137 Add node stats API.
18+ - #128 Add nodes API.
19+ - #127 Add haddock sections to break up API.
20+ - #126 Add snapshot/restore API.
21+ - #125 Set lower bound for http-client
22+ - #123 Allow replica count of 0 in smart constructor.
23+* @23Skidoo
24+ - #143 Fix an example.
25+ - #142 Docs cleanup.
26+* @alistair
27+ - #135 Changes date formatting to have leading zeroes to bring us closer to ES 2.0 support.
28+ - #133 Fix parent child tests for ES 2.0.
29+ - #132 Parse status API from ES 2.0.
30+ - #131 Add cardinality aggregations.
31+* @dinnu93
32+ - #130 Add OverloadedStrings to first example.
33+* @MaxGabriel
34+ - #117 Fix haddocks italicizing forward slashes.
35+
36+0.11.1.0
37+===================
38+* @bitemyapp
39+ - Add http-client-0.5.0 support
5
40
60.11.0.0
410.11.0.0
7===================
42===================
@@ -84,7 +119,7 @@ Thanks to the following people, Bloodhound 0.8.0.0 is being released!
84 - #61: Filter aggregation support
119 - #61: Filter aggregation support
85 - #60: Add value_count aggregation support
120 - #60: Add value_count aggregation support
86 - #58: Eliminate partiality in EsResult
121 - #58: Eliminate partiality in EsResult
87−
122+
88* @centromere
123* @centromere
89 - #59: Fixed bug with IndexSettings serialization
124 - #59: Fixed bug with IndexSettings serialization
90 - #56: Added fields support to Search
125 - #56: Added fields support to Search
@@ -93,7 +128,7 @@ Thanks to the following people, Bloodhound 0.8.0.0 is being released!
93 - #52: Added ability to manipulate templates
128 - #52: Added ability to manipulate templates
94 - #51: Fixed mapping API
129 - #51: Fixed mapping API
95 - #50: Fixed problem with put sending POST
130 - #50: Fixed problem with put sending POST
96−
131+
97* @bermanjosh
132* @bermanjosh
98 - #63: Url query encoding bug
133 - #63: Url query encoding bug
99 - #53: Scan type
134 - #53: Scan type
stack-7.8.yaml+1
@@ -15,4 +15,5 @@ extra-deps:
15- tagged-0.8.3
15- tagged-0.8.3
16- uri-bytestring-0.1.9
16- uri-bytestring-0.1.9
17- void-0.7.1
17- void-0.7.1
18+- generics-sop-0.2.2.0
18resolver: lts-2.18
19resolver: lts-2.18
tests/tests.hs+128−110
@@ -7,9 +7,11 @@
7{-# LANGUAGE OverloadedStrings #-}
7{-# LANGUAGE OverloadedStrings #-}
8{-# LANGUAGE RecordWildCards #-}
8{-# LANGUAGE RecordWildCards #-}
9{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
10−{-# LANGUAGE TemplateHaskell #-}
11{-# LANGUAGE TypeOperators #-}
10{-# LANGUAGE TypeOperators #-}
12{-# OPTIONS_GHC -fno-warn-orphans #-}
11{-# OPTIONS_GHC -fno-warn-orphans #-}
12+#if __GLASGOW_HASKELL__ < 800
13+{-# OPTIONS_GHC -fcontext-stack=100 #-}
14+#endif
13module Main where
15module Main where
14
16
15import Control.Applicative
17import Control.Applicative
@@ -21,7 +23,6 @@ import Control.Monad.Reader
21import Data.Aeson
23import Data.Aeson
22import Data.Aeson.Types (parseEither)
24import Data.Aeson.Types (parseEither)
23import qualified Data.ByteString.Lazy.Char8 as BL8
25import qualified Data.ByteString.Lazy.Char8 as BL8
24−import Data.DeriveTH
25import qualified Data.HashMap.Strict as HM
26import qualified Data.HashMap.Strict as HM
26import Data.List (nub)
27import Data.List (nub)
27import qualified Data.List as L
28import qualified Data.List as L
@@ -54,6 +55,8 @@ import Test.QuickCheck.Property.Monoid (T (..), eq, prop_Monoid)
54import Test.Hspec.QuickCheck (prop)
55import Test.Hspec.QuickCheck (prop)
55import Test.QuickCheck
56import Test.QuickCheck
56
57
58+import qualified Generics.SOP as SOP
59+import qualified Generics.SOP.GGP as SOP
57
60
58testServer :: Server
61testServer :: Server
59testServer = Server "http://localhost:9200"
62testServer = Server "http://localhost:9200"
@@ -589,7 +592,8 @@ instance ApproxEq BoolMatch
589instance ApproxEq MultiMatchQuery
592instance ApproxEq MultiMatchQuery
590instance ApproxEq IndexSettings
593instance ApproxEq IndexSettings
591instance ApproxEq AllocationPolicy
594instance ApproxEq AllocationPolicy
592−instance ApproxEq Char where (=~) = (==)
595+instance ApproxEq Char where
596+ (=~) = (==)
593instance ApproxEq Vers.Version where
597instance ApproxEq Vers.Version where
594 (=~) = (==)
598 (=~) = (==)
595instance (ApproxEq a, Show a) => ApproxEq [a] where
599instance (ApproxEq a, Show a) => ApproxEq [a] where
@@ -787,113 +791,113 @@ instance Arbitrary VersionNumber where
787 where
791 where
788 mk versions = VersionNumber (Vers.Version versions [])
792 mk versions = VersionNumber (Vers.Version versions [])
789
793
790−$(derive makeArbitrary ''IndexName)
794+instance Arbitrary IndexName where arbitrary = sopArbitrary; shrink = genericShrink
791−$(derive makeArbitrary ''MappingName)
795+instance Arbitrary MappingName where arbitrary = sopArbitrary; shrink = genericShrink
792−$(derive makeArbitrary ''DocId)
796+instance Arbitrary DocId where arbitrary = sopArbitrary; shrink = genericShrink
793−$(derive makeArbitrary ''Version)
797+instance Arbitrary Version where arbitrary = sopArbitrary; shrink = genericShrink
794−$(derive makeArbitrary ''BuildHash)
798+instance Arbitrary BuildHash where arbitrary = sopArbitrary; shrink = genericShrink
795−$(derive makeArbitrary ''IndexAliasRouting)
799+instance Arbitrary IndexAliasRouting where arbitrary = sopArbitrary; shrink = genericShrink
796−$(derive makeArbitrary ''ShardCount)
800+instance Arbitrary ShardCount where arbitrary = sopArbitrary; shrink = genericShrink
797−$(derive makeArbitrary ''ReplicaCount)
801+instance Arbitrary ReplicaCount where arbitrary = sopArbitrary; shrink = genericShrink
798−$(derive makeArbitrary ''TemplateName)
802+instance Arbitrary TemplateName where arbitrary = sopArbitrary; shrink = genericShrink
799−$(derive makeArbitrary ''TemplatePattern)
803+instance Arbitrary TemplatePattern where arbitrary = sopArbitrary; shrink = genericShrink
800−$(derive makeArbitrary ''QueryString)
804+instance Arbitrary QueryString where arbitrary = sopArbitrary; shrink = genericShrink
801−$(derive makeArbitrary ''CacheName)
805+instance Arbitrary CacheName where arbitrary = sopArbitrary; shrink = genericShrink
802−$(derive makeArbitrary ''CacheKey)
806+instance Arbitrary CacheKey where arbitrary = sopArbitrary; shrink = genericShrink
803−$(derive makeArbitrary ''Existence)
807+instance Arbitrary Existence where arbitrary = sopArbitrary; shrink = genericShrink
804−$(derive makeArbitrary ''CutoffFrequency)
808+instance Arbitrary CutoffFrequency where arbitrary = sopArbitrary; shrink = genericShrink
805−$(derive makeArbitrary ''Analyzer)
809+instance Arbitrary Analyzer where arbitrary = sopArbitrary; shrink = genericShrink
806−$(derive makeArbitrary ''MaxExpansions)
810+instance Arbitrary MaxExpansions where arbitrary = sopArbitrary; shrink = genericShrink
807−$(derive makeArbitrary ''Lenient)
811+instance Arbitrary Lenient where arbitrary = sopArbitrary; shrink = genericShrink
808−$(derive makeArbitrary ''Tiebreaker)
812+instance Arbitrary Tiebreaker where arbitrary = sopArbitrary; shrink = genericShrink
809−$(derive makeArbitrary ''Boost)
813+instance Arbitrary Boost where arbitrary = sopArbitrary; shrink = genericShrink
810−$(derive makeArbitrary ''BoostTerms)
814+instance Arbitrary BoostTerms where arbitrary = sopArbitrary; shrink = genericShrink
811−$(derive makeArbitrary ''MinimumMatch)
815+instance Arbitrary MinimumMatch where arbitrary = sopArbitrary; shrink = genericShrink
812−$(derive makeArbitrary ''DisableCoord)
816+instance Arbitrary DisableCoord where arbitrary = sopArbitrary; shrink = genericShrink
813−$(derive makeArbitrary ''IgnoreTermFrequency)
817+instance Arbitrary IgnoreTermFrequency where arbitrary = sopArbitrary; shrink = genericShrink
814−$(derive makeArbitrary ''MinimumTermFrequency)
818+instance Arbitrary MinimumTermFrequency where arbitrary = sopArbitrary; shrink = genericShrink
815−$(derive makeArbitrary ''MaxQueryTerms)
819+instance Arbitrary MaxQueryTerms where arbitrary = sopArbitrary; shrink = genericShrink
816−$(derive makeArbitrary ''Fuzziness)
820+instance Arbitrary Fuzziness where arbitrary = sopArbitrary; shrink = genericShrink
817−$(derive makeArbitrary ''PrefixLength)
821+instance Arbitrary PrefixLength where arbitrary = sopArbitrary; shrink = genericShrink
818−$(derive makeArbitrary ''TypeName)
822+instance Arbitrary TypeName where arbitrary = sopArbitrary; shrink = genericShrink
819−$(derive makeArbitrary ''PercentMatch)
823+instance Arbitrary PercentMatch where arbitrary = sopArbitrary; shrink = genericShrink
820−$(derive makeArbitrary ''StopWord)
824+instance Arbitrary StopWord where arbitrary = sopArbitrary; shrink = genericShrink
821−$(derive makeArbitrary ''QueryPath)
825+instance Arbitrary QueryPath where arbitrary = sopArbitrary; shrink = genericShrink
822−$(derive makeArbitrary ''AllowLeadingWildcard)
826+instance Arbitrary AllowLeadingWildcard where arbitrary = sopArbitrary; shrink = genericShrink
823−$(derive makeArbitrary ''LowercaseExpanded)
827+instance Arbitrary LowercaseExpanded where arbitrary = sopArbitrary; shrink = genericShrink
824−$(derive makeArbitrary ''EnablePositionIncrements)
828+instance Arbitrary EnablePositionIncrements where arbitrary = sopArbitrary; shrink = genericShrink
825−$(derive makeArbitrary ''AnalyzeWildcard)
829+instance Arbitrary AnalyzeWildcard where arbitrary = sopArbitrary; shrink = genericShrink
826−$(derive makeArbitrary ''GeneratePhraseQueries)
830+instance Arbitrary GeneratePhraseQueries where arbitrary = sopArbitrary; shrink = genericShrink
827−$(derive makeArbitrary ''Locale)
831+instance Arbitrary Locale where arbitrary = sopArbitrary; shrink = genericShrink
828−$(derive makeArbitrary ''MaxWordLength)
832+instance Arbitrary MaxWordLength where arbitrary = sopArbitrary; shrink = genericShrink
829−$(derive makeArbitrary ''MinWordLength)
833+instance Arbitrary MinWordLength where arbitrary = sopArbitrary; shrink = genericShrink
830−$(derive makeArbitrary ''PhraseSlop)
834+instance Arbitrary PhraseSlop where arbitrary = sopArbitrary; shrink = genericShrink
831−$(derive makeArbitrary ''MinDocFrequency)
835+instance Arbitrary MinDocFrequency where arbitrary = sopArbitrary; shrink = genericShrink
832−$(derive makeArbitrary ''MaxDocFrequency)
836+instance Arbitrary MaxDocFrequency where arbitrary = sopArbitrary; shrink = genericShrink
833−$(derive makeArbitrary ''Regexp)
837+instance Arbitrary Regexp where arbitrary = sopArbitrary; shrink = genericShrink
834−$(derive makeArbitrary ''SimpleQueryStringQuery)
838+instance Arbitrary SimpleQueryStringQuery where arbitrary = sopArbitrary; shrink = genericShrink
835−$(derive makeArbitrary ''FieldOrFields)
839+instance Arbitrary FieldOrFields where arbitrary = sopArbitrary; shrink = genericShrink
836−$(derive makeArbitrary ''SimpleQueryFlag)
840+instance Arbitrary SimpleQueryFlag where arbitrary = sopArbitrary; shrink = genericShrink
837−$(derive makeArbitrary ''RegexpQuery)
841+instance Arbitrary RegexpQuery where arbitrary = sopArbitrary; shrink = genericShrink
838−$(derive makeArbitrary ''QueryStringQuery)
842+instance Arbitrary QueryStringQuery where arbitrary = sopArbitrary; shrink = genericShrink
839−$(derive makeArbitrary ''RangeQuery)
843+instance Arbitrary RangeQuery where arbitrary = sopArbitrary; shrink = genericShrink
840−$(derive makeArbitrary ''RangeValue)
844+instance Arbitrary RangeValue where arbitrary = sopArbitrary; shrink = genericShrink
841−$(derive makeArbitrary ''PrefixQuery)
845+instance Arbitrary PrefixQuery where arbitrary = sopArbitrary; shrink = genericShrink
842−$(derive makeArbitrary ''NestedQuery)
846+instance Arbitrary NestedQuery where arbitrary = sopArbitrary; shrink = genericShrink
843−$(derive makeArbitrary ''MoreLikeThisFieldQuery)
847+instance Arbitrary MoreLikeThisFieldQuery where arbitrary = sopArbitrary; shrink = genericShrink
844−$(derive makeArbitrary ''MoreLikeThisQuery)
848+instance Arbitrary MoreLikeThisQuery where arbitrary = sopArbitrary; shrink = genericShrink
845−$(derive makeArbitrary ''IndicesQuery)
849+instance Arbitrary IndicesQuery where arbitrary = sopArbitrary; shrink = genericShrink
846−$(derive makeArbitrary ''HasParentQuery)
850+instance Arbitrary HasParentQuery where arbitrary = sopArbitrary; shrink = genericShrink
847−$(derive makeArbitrary ''HasChildQuery)
851+instance Arbitrary HasChildQuery where arbitrary = sopArbitrary; shrink = genericShrink
848−$(derive makeArbitrary ''FuzzyQuery)
852+instance Arbitrary FuzzyQuery where arbitrary = sopArbitrary; shrink = genericShrink
849−$(derive makeArbitrary ''FuzzyLikeFieldQuery)
853+instance Arbitrary FuzzyLikeFieldQuery where arbitrary = sopArbitrary; shrink = genericShrink
850−$(derive makeArbitrary ''FuzzyLikeThisQuery)
854+instance Arbitrary FuzzyLikeThisQuery where arbitrary = sopArbitrary; shrink = genericShrink
851−$(derive makeArbitrary ''DisMaxQuery)
855+instance Arbitrary DisMaxQuery where arbitrary = sopArbitrary; shrink = genericShrink
852−$(derive makeArbitrary ''CommonTermsQuery)
856+instance Arbitrary CommonTermsQuery where arbitrary = sopArbitrary; shrink = genericShrink
853−$(derive makeArbitrary ''DistanceRange)
857+instance Arbitrary DistanceRange where arbitrary = sopArbitrary; shrink = genericShrink
854−$(derive makeArbitrary ''MultiMatchQuery)
858+instance Arbitrary MultiMatchQuery where arbitrary = sopArbitrary; shrink = genericShrink
855−$(derive makeArbitrary ''LessThanD)
859+instance Arbitrary LessThanD where arbitrary = sopArbitrary; shrink = genericShrink
856−$(derive makeArbitrary ''LessThanEqD)
860+instance Arbitrary LessThanEqD where arbitrary = sopArbitrary; shrink = genericShrink
857−$(derive makeArbitrary ''GreaterThanD)
861+instance Arbitrary GreaterThanD where arbitrary = sopArbitrary; shrink = genericShrink
858−$(derive makeArbitrary ''GreaterThanEqD)
862+instance Arbitrary GreaterThanEqD where arbitrary = sopArbitrary; shrink = genericShrink
859−$(derive makeArbitrary ''LessThan)
863+instance Arbitrary LessThan where arbitrary = sopArbitrary; shrink = genericShrink
860−$(derive makeArbitrary ''LessThanEq)
864+instance Arbitrary LessThanEq where arbitrary = sopArbitrary; shrink = genericShrink
861−$(derive makeArbitrary ''GreaterThan)
865+instance Arbitrary GreaterThan where arbitrary = sopArbitrary; shrink = genericShrink
862−$(derive makeArbitrary ''GreaterThanEq)
866+instance Arbitrary GreaterThanEq where arbitrary = sopArbitrary; shrink = genericShrink
863−$(derive makeArbitrary ''GeoPoint)
867+instance Arbitrary GeoPoint where arbitrary = sopArbitrary; shrink = genericShrink
864−$(derive makeArbitrary ''NullValue)
868+instance Arbitrary NullValue where arbitrary = sopArbitrary; shrink = genericShrink
865−$(derive makeArbitrary ''MinimumMatchHighLow)
869+instance Arbitrary MinimumMatchHighLow where arbitrary = sopArbitrary; shrink = genericShrink
866−$(derive makeArbitrary ''CommonMinimumMatch)
870+instance Arbitrary CommonMinimumMatch where arbitrary = sopArbitrary; shrink = genericShrink
867−$(derive makeArbitrary ''BoostingQuery)
871+instance Arbitrary BoostingQuery where arbitrary = sopArbitrary; shrink = genericShrink
868−$(derive makeArbitrary ''BoolQuery)
872+instance Arbitrary BoolQuery where arbitrary = sopArbitrary; shrink = genericShrink
869−$(derive makeArbitrary ''MatchQuery)
873+instance Arbitrary MatchQuery where arbitrary = sopArbitrary; shrink = genericShrink
870−$(derive makeArbitrary ''MultiMatchQueryType)
874+instance Arbitrary MultiMatchQueryType where arbitrary = sopArbitrary; shrink = genericShrink
871−$(derive makeArbitrary ''BooleanOperator)
875+instance Arbitrary BooleanOperator where arbitrary = sopArbitrary; shrink = genericShrink
872−$(derive makeArbitrary ''ZeroTermsQuery)
876+instance Arbitrary ZeroTermsQuery where arbitrary = sopArbitrary; shrink = genericShrink
873−$(derive makeArbitrary ''MatchQueryType)
877+instance Arbitrary MatchQueryType where arbitrary = sopArbitrary; shrink = genericShrink
874−$(derive makeArbitrary ''SearchAliasRouting)
878+instance Arbitrary SearchAliasRouting where arbitrary = sopArbitrary; shrink = genericShrink
875−$(derive makeArbitrary ''ScoreType)
879+instance Arbitrary ScoreType where arbitrary = sopArbitrary; shrink = genericShrink
876−$(derive makeArbitrary ''Distance)
880+instance Arbitrary Distance where arbitrary = sopArbitrary; shrink = genericShrink
877−$(derive makeArbitrary ''DistanceUnit)
881+instance Arbitrary DistanceUnit where arbitrary = sopArbitrary; shrink = genericShrink
878−$(derive makeArbitrary ''DistanceType)
882+instance Arbitrary DistanceType where arbitrary = sopArbitrary; shrink = genericShrink
879−$(derive makeArbitrary ''OptimizeBbox)
883+instance Arbitrary OptimizeBbox where arbitrary = sopArbitrary; shrink = genericShrink
880−$(derive makeArbitrary ''GeoBoundingBoxConstraint)
884+instance Arbitrary GeoBoundingBoxConstraint where arbitrary = sopArbitrary; shrink = genericShrink
881−$(derive makeArbitrary ''GeoFilterType)
885+instance Arbitrary GeoFilterType where arbitrary = sopArbitrary; shrink = genericShrink
882−$(derive makeArbitrary ''GeoBoundingBox)
886+instance Arbitrary GeoBoundingBox where arbitrary = sopArbitrary; shrink = genericShrink
883−$(derive makeArbitrary ''LatLon)
887+instance Arbitrary LatLon where arbitrary = sopArbitrary; shrink = genericShrink
884−$(derive makeArbitrary ''RangeExecution)
888+instance Arbitrary RangeExecution where arbitrary = sopArbitrary; shrink = genericShrink
885−$(derive makeArbitrary ''RegexpFlag)
889+instance Arbitrary RegexpFlag where arbitrary = sopArbitrary; shrink = genericShrink
886−$(derive makeArbitrary ''BoolMatch)
890+instance Arbitrary BoolMatch where arbitrary = sopArbitrary; shrink = genericShrink
887−$(derive makeArbitrary ''Term)
891+instance Arbitrary Term where arbitrary = sopArbitrary; shrink = genericShrink
888−$(derive makeArbitrary ''IndexSettings)
892+instance Arbitrary IndexSettings where arbitrary = sopArbitrary; shrink = genericShrink
889−$(derive makeArbitrary ''UpdatableIndexSetting)
893+instance Arbitrary UpdatableIndexSetting where arbitrary = sopArbitrary; shrink = genericShrink
890−$(derive makeArbitrary ''Bytes)
894+instance Arbitrary Bytes where arbitrary = sopArbitrary; shrink = genericShrink
891−$(derive makeArbitrary ''AllocationPolicy)
895+instance Arbitrary AllocationPolicy where arbitrary = sopArbitrary; shrink = genericShrink
892−$(derive makeArbitrary ''InitialShardCount)
896+instance Arbitrary InitialShardCount where arbitrary = sopArbitrary; shrink = genericShrink
893−$(derive makeArbitrary ''FSType)
897+instance Arbitrary FSType where arbitrary = sopArbitrary; shrink = genericShrink
894−$(derive makeArbitrary ''CompoundFormat)
898+instance Arbitrary CompoundFormat where arbitrary = sopArbitrary; shrink = genericShrink
895−$(derive makeArbitrary ''FsSnapshotRepo)
899+instance Arbitrary FsSnapshotRepo where arbitrary = sopArbitrary; shrink = genericShrink
896−$(derive makeArbitrary ''SnapshotRepoName)
900+instance Arbitrary SnapshotRepoName where arbitrary = sopArbitrary; shrink = genericShrink
897
901
898newtype UpdatableIndexSetting' = UpdatableIndexSetting' UpdatableIndexSetting
902newtype UpdatableIndexSetting' = UpdatableIndexSetting' UpdatableIndexSetting
899 deriving (Show, Eq, ToJSON, FromJSON, ApproxEq, Typeable)
903 deriving (Show, Eq, ToJSON, FromJSON, ApproxEq, Typeable)
@@ -1617,3 +1621,17 @@ main = hspec $ do
1617 propJSON (Proxy :: Proxy InitialShardCount)
1621 propJSON (Proxy :: Proxy InitialShardCount)
1618 propJSON (Proxy :: Proxy FSType)
1622 propJSON (Proxy :: Proxy FSType)
1619 propJSON (Proxy :: Proxy CompoundFormat)
1623 propJSON (Proxy :: Proxy CompoundFormat)
1624+
1625+-- Temporary solution for lacking of generic derivation of Arbitrary
1626+-- We use generics-sop, as it's much more concise than directly using GHC.Generics
1627+--
1628+-- This will be unneeded after https://github.com/nick8325/quickcheck/pull/112
1629+-- is merged and released
1630+sopArbitrary :: forall a. (Generic a, SOP.GTo a, SOP.All SOP.SListI (SOP.GCode a), SOP.All2 Arbitrary (SOP.GCode a)) => Gen a
1631+sopArbitrary = fmap SOP.gto sopArbitrary'
1632+
1633+sopArbitrary' :: forall xss. (SOP.All SOP.SListI xss, SOP.All2 Arbitrary xss) => Gen (SOP.SOP SOP.I xss)
1634+sopArbitrary' = SOP.hsequence =<< elements (SOP.apInjs_POP $ SOP.hcpure p arbitrary)
1635+ where
1636+ p :: Proxy Arbitrary
1637+ p = Proxy