git.iko.soy/typeable/http-api-data
on master help sign in
Add warning for DeriveAnyClass (closes #27)
57bf0a3Nickolay Kudasov
Web/HttpApiData/Internal.hs+6
@@ -44,6 +44,9 @@ import TextShow (TextShow, showt)
44#endif
44#endif
45
45
46-- | Convert value to HTTP API data.
46-- | Convert value to HTTP API data.
47+--
48+-- __WARNING__: Do not derive this using @DeriveAnyClass@ as the generated
49+-- instance will loop indefinitely.
47class ToHttpApiData a where
50class ToHttpApiData a where
48 {-# MINIMAL toUrlPiece | toQueryParam #-}
51 {-# MINIMAL toUrlPiece | toQueryParam #-}
49 -- | Convert to URL path piece.
52 -- | Convert to URL path piece.
@@ -59,6 +62,9 @@ class ToHttpApiData a where
59 toQueryParam = toUrlPiece
62 toQueryParam = toUrlPiece
60
63
61-- | Parse value from HTTP API data.
64-- | Parse value from HTTP API data.
65+--
66+-- __WARNING__: Do not derive this using @DeriveAnyClass@ as the generated
67+-- instance will loop indefinitely.
62class FromHttpApiData a where
68class FromHttpApiData a where
63 {-# MINIMAL parseUrlPiece | parseQueryParam #-}
69 {-# MINIMAL parseUrlPiece | parseQueryParam #-}
64 -- | Parse URL path piece.
70 -- | Parse URL path piece.