Skip to content

Commit

Permalink
Update for GHC 8.0 Generics
Browse files Browse the repository at this point in the history
There are two issues here,

 * `NoSelector` is now encoded as a `Maybe Symbol` field in `MetaSel`.

 * We now need `DataKinds` and `PolyKinds` to apply `Proxy` to a
   selector, of kind `Meta`.
  • Loading branch information
bgamari committed Jan 19, 2016
1 parent 64a4ec6 commit ab1476a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Data/Csv/Conversion.hs
Expand Up @@ -2,6 +2,8 @@
BangPatterns,
CPP,
DefaultSignatures,
DataKinds,
PolyKinds,
FlexibleContexts,
FlexibleInstances,
KindSignatures,
Expand Down Expand Up @@ -1018,7 +1020,7 @@ type Success a f r = a -> f r
-- lets you compose several field conversions together in such a way
-- that if any of them fail, the whole record conversion fails.
newtype Parser a = Parser {
unParser :: forall f r.
unParser :: forall (f :: * -> *) (r :: *).
Failure f r
-> Success a f r
-> f r
Expand Down Expand Up @@ -1202,7 +1204,12 @@ instance GToNamedRecordHeader a => GToNamedRecordHeader (M1 C c a)

-- | Instance to ensure that you cannot derive DefaultOrdered for
-- constructors without selectors.
#if MIN_VERSION_base(4,9,0)
instance DefaultOrdered (M1 S ('MetaSel 'Nothing srcpk srcstr decstr) a ())
=> GToNamedRecordHeader (M1 S ('MetaSel 'Nothing srcpk srcstr decstr) a)
#else
instance DefaultOrdered (M1 S NoSelector a ()) => GToNamedRecordHeader (M1 S NoSelector a)
#endif
where
gtoNamedRecordHeader _ =
error "You cannot derive DefaultOrdered for constructors without selectors."
Expand Down

0 comments on commit ab1476a

Please sign in to comment.