ekmett / hkd

higher-kinded data
Other
30 stars 2 forks source link

Add `COMPLETE` pragma to `FCompose` #5

Closed RyanGlScott closed 1 year ago

RyanGlScott commented 2 years ago

distributive currently produces -Wincomplete-uni-patterns warnings when built with GHC 9.2:

[ 3 of 21] Compiling Data.Rep.Internal ( src/Data/Rep/Internal.hs, /home/ryanglscott/Documents/Hacking/Haskell/ci-maintenance/checkout/ekmett/distributive/dist-newstyle/build/x86_64-linux/ghc-9.2.2/distributive-1/build/Data/Rep/Internal.o, /home/ryanglscott/Documents/Hacking/Haskell/ci-maintenance/checkout/ekmett/distributive/dist-newstyle/build/x86_64-linux/ghc-9.2.2/distributive-1/build/Data/Rep/Internal.dyn_o )

src/Data/Rep/Internal.hs:368:41: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a lambda abstraction:
        Patterns of type ‘FCompose a f Identity’ not matched: FCompose' _
    |
368 | distribute = \f -> distrib (FCompose f) \(FCompose f') -> runIdentity <$> f'
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

<and many others...>

I believe the underlying cause is the FCompose pattern synonym not having a COMPLETE pragma. This patch adds one.

RyanGlScott commented 1 year ago

Fixed independently in 41e31ab366660f1b92436b31dd8df68efbf50589.