flaw-graphics/Flaw/Graphics/Program/Internal.hs
Use when Open
Open
if stage /= EndStage then fail "wrong program: stage should be end"
else return ()
- Read upRead up
- Exclude checks
Found
if stage /= EndStage then fail "wrong program: stage should be end"
else return ()
Perhaps
when (stage /= EndStage) $
fail "wrong program: stage should be end"
Redundant do Open
Open
funDecl variant = do
funD (mkName $ variant ++ "__") [clause [] (normalB [| SwizzleNode (valueType (undefined :: $(varT v))) (valueType (undefined :: $(conT resultTypeName) $(varT v))) $(litE $ stringL variant) |]) []]
- Read upRead up
- Exclude checks
Found
do funD (mkName $ variant ++ "__")
[clause []
(normalB
[|
SwizzleNode (valueType (undefined :: $( varT v )))
(valueType (undefined :: $( conT resultTypeName ) $( varT v )))
$( litE $ stringL variant )
|])
[]]
Perhaps
funD (mkName $ variant ++ "__")
[clause []
(normalB
[|
SwizzleNode (valueType (undefined :: $( varT v )))
(valueType (undefined :: $( conT resultTypeName ) $( varT v )))
$( litE $ stringL variant )
|])
[]]
Use infix Open
Open
variantFilter variant = all (\c -> elem c components) variant && elem (last components) variant
- Read upRead up
- Exclude checks
Found
elem c components
Perhaps
c `elem` components
Redundant $ Open
Open
[ funD (mkName $ [c, '_']) [clause [] (normalB [| ComponentNode (valueType (undefined :: $(varT v))) (valueType (undefined :: VecElement $(varT v))) $(litE $ charL c) |]) []]
- Read upRead up
- Exclude checks
Found
mkName $ [c, '_']
Perhaps
mkName [c, '_']
Avoid lambda using infix
Open
Open
variantFilter variant = all (\c -> elem c components) variant && elem (last components) variant
- Read upRead up
- Exclude checks
Found
\ c -> elem c components
Perhaps
(`elem` components)
Avoid lambda Open
Open
valueToShowList $(conP name $ map varP ps) = $(listE $ map (\p -> appE (varE 'show) $ varE p) ps)
- Read upRead up
- Exclude checks
Found
\ p -> appE (varE 'show) $ varE p
Perhaps
appE (varE 'show) . varE
Redundant $ Open
Open
, [t| OfVectorType ($(conT $ mkName $ "SwizzleVecResult" ++ nameSuffix) $(varT v)) |]
- Read upRead up
- Exclude checks
Found
conT $ mkName
Perhaps
conT mkName
Avoid lambda Open
Open
valueToShowList $(conP name $ map varP ps) = $(listE $ map (\p -> appE (varE 'show) $ varE p) ps)
- Read upRead up
- Exclude checks
Found
\ p -> appE (varE 'show) $ varE p
Perhaps
appE (varE 'show) . varE