@@ -479,7 +479,7 @@ argsToValue jc tjs opts multiCons (NormalC conName ts) = do
479479 litE (integerL $ fromIntegral len))
480480 stmts = [ noBindS $
481481 [|VM.unsafeWrite|] `appE`
482− (varE mv) `appE`
482+ varE mv `appE`
483483 litE (integerL ix) `appE`
484484 e
485485 | (ix, e) <- zip [(0::Integer)..] es
@@ -618,7 +618,7 @@ nullarySumToEncoding opts multiCons conName =
618618 case sumEncoding opts of
619619 TaggedObject{tagFieldName} ->
620620 object $
621− ([|E.text (T.pack tagFieldName)|] <:> encStr opts conName)
621+ [|E.text (T.pack tagFieldName)|] <:> encStr opts conName
622622 _ -> sumToEncoding opts multiCons conName [e|toEncoding ([] :: [()])|]
623623
624624-- | Generates code to generate the JSON encoding of a single constructor.
@@ -859,7 +859,7 @@ consFromJSON jc tName opts cons = do
859859 [ liftM2 (,)
860860 (normalG [|otherwise|])
861861 ( [|noMatchFail|]
862− `appE` (litE $ stringL $ show tName)
862+ `appE` litE (stringL $ show tName)
863863 `appE` ([|T.unpack|] `appE` varE txt)
864864 )
865865 ]
@@ -868,7 +868,7 @@ consFromJSON jc tName opts cons = do
868868 , do other <- newName "other"
869869 match (varP other)
870870 (normalB $ [|noStringFail|]
871− `appE` (litE $ stringL $ show tName)
871+ `appE` litE (stringL $ show tName)
872872 `appE` ([|valueConName|] `appE` varE other)
873873 )
874874 []
@@ -883,15 +883,15 @@ consFromJSON jc tName opts cons = do
883883 TwoElemArray ->
884884 [ do arr <- newName "array"
885885 match (conP 'Array [varP arr])
886− (guardedB $
886+ (guardedB
887887 [ liftM2 (,) (normalG $ infixApp ([|V.length|] `appE` varE arr)
888888 [|(==)|]
889889 (litE $ integerL 2))
890890 (parse2ElemArray pjs arr)
891891 , liftM2 (,) (normalG [|otherwise|])
892− (([|not2ElemArray|]
893− `appE` (litE $ stringL $ show tName)
894− `appE` ([|V.length|] `appE` varE arr)))
892+ ([|not2ElemArray|]
893+ `appE` litE (stringL $ show tName)
894+ `appE` ([|V.length|] `appE` varE arr))
895895 ]
896896 )
897897 []
@@ -899,7 +899,7 @@ consFromJSON jc tName opts cons = do
899899 match (varP other)
900900 ( normalB
901901 $ [|noArrayFail|]
902− `appE` (litE $ stringL $ show tName)
902+ `appE` litE (stringL $ show tName)
903903 `appE` ([|valueConName|] `appE` varE other)
904904 )
905905 []
@@ -912,7 +912,7 @@ consFromJSON jc tName opts cons = do
912912 match (varP other)
913913 ( normalB
914914 $ [|noObjectFail|]
915− `appE` (litE $ stringL $ show tName)
915+ `appE` litE (stringL $ show tName)
916916 `appE` ([|valueConName|] `appE` varE other)
917917 )
918918 []
@@ -952,7 +952,7 @@ consFromJSON jc tName opts cons = do
952952 match (varP other)
953953 ( normalB
954954 $ [|firstElemNoStringFail|]
955− `appE` (litE $ stringL $ show tName)
955+ `appE` litE (stringL $ show tName)
956956 `appE` ([|valueConName|] `appE` varE other)
957957 )
958958 []
@@ -969,7 +969,7 @@ consFromJSON jc tName opts cons = do
969969 , do other <- newName "other"
970970 match (varP other)
971971 (normalB $ [|wrongPairCountFail|]
972− `appE` (litE $ stringL $ show tName)
972+ `appE` litE (stringL $ show tName)
973973 `appE` ([|show . length|] `appE` varE other)
974974 )
975975 []
@@ -991,7 +991,7 @@ consFromJSON jc tName opts cons = do
991991 [ liftM2 (,)
992992 (normalG [e|otherwise|])
993993 ( varE errorFun
994− `appE` (litE $ stringL $ show tName)
994+ `appE` litE (stringL $ show tName)
995995 `appE` listE (map ( litE
996996 . stringL
997997 . constructorTagModifier opts
@@ -1010,13 +1010,13 @@ parseNullaryMatches :: Name -> Name -> [Q Match]
10101010parseNullaryMatches tName conName =
10111011 [ do arr <- newName "arr"
10121012 match (conP 'Array [varP arr])
1013− (guardedB $
1013+ (guardedB
10141014 [ liftM2 (,) (normalG $ [|V.null|] `appE` varE arr)
10151015 ([|pure|] `appE` conE conName)
10161016 , liftM2 (,) (normalG [|otherwise|])
10171017 (parseTypeMismatch tName conName
10181018 (litE $ stringL "an empty Array")
1019− (infixApp (litE $ stringL $ "Array of length ")
1019+ (infixApp (litE $ stringL "Array of length ")
10201020 [|(++)|]
10211021 ([|show . V.length|] `appE` varE arr)
10221022 )
@@ -1055,9 +1055,9 @@ parseRecord jc tvMap argTys opts tName conName ts obj =
10551055 where
10561056 x:xs = [ [|lookupField|]
10571057 `appE` dispatchParseJSON jc conName tvMap argTy
1058− `appE` (litE $ stringL $ show tName)
1059− `appE` (litE $ stringL $ constructorTagModifier opts $ nameBase conName)
1060− `appE` (varE obj)
1058+ `appE` litE (stringL $ show tName)
1059+ `appE` litE (stringL $ constructorTagModifier opts $ nameBase conName)
1060+ `appE` varE obj
10611061 `appE` ( [|T.pack|] `appE` fieldLabelExp opts field
10621062 )
10631063 | ((field, _, _), argTy) <- zip ts argTys
@@ -1069,7 +1069,7 @@ getValField obj valFieldName matches = do
10691069 doE [ bindS (varP val) $ infixApp (varE obj)
10701070 [|(.:)|]
10711071 ([|T.pack|] `appE`
1072− (litE $ stringL valFieldName))
1072+ litE (stringL valFieldName))
10731073 , noBindS $ caseE (varE val) matches
10741074 ]
10751075
@@ -1172,7 +1172,7 @@ parseProduct jc tvMap argTys tName conName numArgs =
11721172 )
11731173 ( parseTypeMismatch tName conName
11741174 (litE $ stringL $ "Array of length " ++ show numArgs)
1175− ( infixApp (litE $ stringL $ "Array of length ")
1175+ ( infixApp (litE $ stringL "Array of length ")
11761176 [|(++)|]
11771177 ([|show . V.length|] `appE` varE arr)
11781178 )
@@ -1306,7 +1306,7 @@ deriveJSONClass :: [(JSONFun, JSONClass -> Name -> Options -> [Con] -> Q Exp)]
13061306 -> Q [Dec]
13071307deriveJSONClass consFuns jc opts name =
13081308 withType name $ \name' ctxt tvbs cons mbTys ->
1309− fmap (:[]) $ fromCons name' ctxt tvbs cons mbTys
1309+ (:[]) <$> fromCons name' ctxt tvbs cons mbTys
13101310 where
13111311 fromCons :: Name -> Cxt -> [TyVarBndr] -> [Con] -> Maybe [Type] -> Q Dec
13121312 fromCons name' ctxt tvbs cons mbTys = do
@@ -1379,8 +1379,8 @@ dispatchFunByType jc jf conName tvMap list ty = do
13791379 if any (`mentionsName` tyVarNames) lhsArgs
13801380 || itf && any (`mentionsName` tyVarNames) tyArgs
13811381 then outOfPlaceTyVarError jc conName
1382− else appsE $ [ varE . jsonFunValOrListName list jf $ toEnum numLastArgs]
1383− ++ zipWith (dispatchFunByType jc jf conName tvMap)
1382+ else appsE $ varE (jsonFunValOrListName list jf $ toEnum numLastArgs)
1383+ : zipWith (dispatchFunByType jc jf conName tvMap)
13841384 (cycle [False,True])
13851385 (interleave rhsArgs rhsArgs)
13861386
@@ -1590,7 +1590,7 @@ buildTypeInstanceFromTys tyConName jc dataCxt varTysOrig isDataFamily = do
15901590
15911591 -- Check there are enough types to drop and that all of them are either of
15921592 -- kind * or kind k (for some kind variable k). If not, throw an error.
1593− when (remainingLength < 0 || any (== NotKindStar) droppedStarKindStati) $
1593+ when (remainingLength < 0 || elem NotKindStar droppedStarKindStati) $
15941594 derivingKindError jc tyConName
15951595
15961596 let droppedKindVarNames :: [Name]
@@ -1854,7 +1854,7 @@ reifyConTys jc tpjs conName = do
18541854 -- arguments of a type that it (1) one of the last type variables,
18551855 -- and (2) of a truly polymorphic type.
18561856 jArity = arityInt jc
1857− mbTvNames = map varTToName_maybe $
1857+ mbTvNames = map varTToNameMaybe $
18581858 NE.drop (NE.length unapResTy - jArity) unapResTy
18591859 -- We use M.fromList to ensure that if there are any duplicate type
18601860 -- variables (as can happen in a GADT), the rightmost type variable gets
@@ -1990,15 +1990,15 @@ tyKind _ = starK
19901990
19911991-- | Extract Just the Name from a type variable. If the argument Type is not a
19921992-- type variable, return Nothing.
1993−varTToName_maybe :: Type -> Maybe Name
1994−varTToName_maybe (VarT n) = Just n
1995−varTToName_maybe (SigT t _) = varTToName_maybe t
1996−varTToName_maybe _ = Nothing
1993+varTToNameMaybe :: Type -> Maybe Name
1994+varTToNameMaybe (VarT n) = Just n
1995+varTToNameMaybe (SigT t _) = varTToNameMaybe t
1996+varTToNameMaybe _ = Nothing
19971997
19981998-- | Extract the Name from a type variable. If the argument Type is not a
19991999-- type variable, throw an error.
20002000varTToName :: Type -> Name
2001−varTToName = fromMaybe (error "Not a type variable!") . varTToName_maybe
2001+varTToName = fromMaybe (error "Not a type variable!") . varTToNameMaybe
20022002
20032003-- | Extracts the name from a constructor.
20042004getConName :: Con -> Name
@@ -2195,7 +2195,7 @@ canEtaReduce remaining dropped =
21952195-- | Expands all type synonyms in a type. Written by Dan Rosén in the
21962196-- @genifunctors@ package (licensed under BSD3).
21972197expandSyn :: Type -> Q Type
2198−expandSyn (ForallT tvs ctx t) = fmap (ForallT tvs ctx) $ expandSyn t
2198+expandSyn (ForallT tvs ctx t) = ForallT tvs ctx <$> expandSyn t
21992199expandSyn t@AppT{} = expandSynApp t []
22002200expandSyn t@ConT{} = expandSynApp t []
22012201expandSyn (SigT t k) = do t' <- expandSyn t