derive-has-field 0.0.1.5 → 0.1.0.0
raw patch · 2 files changed
+3/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- derive-has-field.cabal +1/−1
- src/DeriveHasField.hs +2/−0
derive-has-field.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: derive-has-field-version: 0.0.1.5+version: 0.1.0.0 synopsis: Derive HasField instances with Template Haskell description: A Template Haskell function to derive HasField instances to utilize OverloadedRecordDot more effectively. category: Template Haskell
src/DeriveHasField.hs view
@@ -28,6 +28,8 @@ constructorInfo <- case datatypeInfo.datatypeCons of [info] -> pure info _ -> fail "deriveHasField: only supports product types with a single data constructor"+ when (nameBase constructorInfo.constructorName /= nameBase datatypeInfo.datatypeName) $+ fail "deriveHasField: type and data constructor must have the same string representation" let dropPrefix prefix input = fromMaybe input $ stripPrefix prefix input makeDeriveHasField (dropPrefix $ lowerFirst $ nameBase constructorInfo.constructorName) datatypeInfo