bitemyapp / bloodhound

Haskell Elasticsearch client and query DSL
bitemyapp.com
BSD 3-Clause "New" or "Revised" License
424 stars 118 forks source link

Fixup warnings about unused function and redundant constraints. #186

Closed tmcgilchrist closed 7 years ago

tmcgilchrist commented 7 years ago

Compiling with GHC 8.0.1 and warnings as errors I had the following issues:

[ 3 of 10] Compiling Database.V5.Bloodhound.Types ( src/Database/V5/Bloodhound/Types.hs, dist/build/Database/V5/Bloodhound/Types.o )

src/Database/V5/Bloodhound/Types.hs:2101:10: warning: [-Wredundant-constraints]
    • Redundant constraint: BucketAggregation a
    • In the instance declaration for ‘FromJSON (Bucket a)’

src/Database/V5/Bloodhound/Types.hs:5242:1: warning: [-Wunused-top-binds]
    Defined but not used: ‘mkPhraseSuggesterCollate’

This change is just fixing those issues for V5 and V1. I didn't really dig into the code too much so if I'm barking up the wrong tree please let me know.

MichaelXavier commented 7 years ago

@bitemyapp LGTM. I think we just lacked the warnings to eliminate this dead code in older GHCs.

bitemyapp commented 7 years ago

@tmcgilchrist thank you for PR'ing this!

@MichaelXavier thank you for the review & nudge!