flaw-graphics/Flaw/Graphics/Program.hs
Redundant do Open
Open
withForeignPtr bytes $ \ptr -> do
pokeByteOff ptr offset value
- Read upRead up
- Exclude checks
Found
do pokeByteOff ptr offset value
Perhaps
pokeByteOff ptr offset value
Eta reduce Open
Open
lerp a b c = LerpNode (nodeValueType a) a b c
- Read upRead up
- Exclude checks
Found
lerp a b c = LerpNode (nodeValueType a) a b c
Perhaps
lerp a = LerpNode (nodeValueType a) a
Use when Open
Open
if stage /= PixelStage then fail "depthTarget can be used only in pixel program"
else return ()
- Read upRead up
- Exclude checks
Found
if stage /= PixelStage then
fail "depthTarget can be used only in pixel program" else return ()
Perhaps
Control.Monad.when (stage /= PixelStage) $
fail "depthTarget can be used only in pixel program"
Use when Open
Open
if stage /= VertexStage then fail "attribute can only be defined in vertex program"
else return ()
- Read upRead up
- Exclude checks
Found
if stage /= VertexStage then
fail "attribute can only be defined in vertex program" else
return ()
Perhaps
Control.Monad.when (stage /= VertexStage) $
fail "attribute can only be defined in vertex program"
Eta reduce Open
Open
equal_ a b = EqualNode (nodeValueType a) a b
- Read upRead up
- Exclude checks
Found
equal_ a b = EqualNode (nodeValueType a) a b
Perhaps
equal_ a = EqualNode (nodeValueType a) a
Eta reduce Open
Open
lessEqual_ a b = LessEqualNode (nodeValueType a) a b
- Read upRead up
- Exclude checks
Found
lessEqual_ a b = LessEqualNode (nodeValueType a) a b
Perhaps
lessEqual_ a = LessEqualNode (nodeValueType a) a
Redundant do Open
Open
withForeignPtr bytes $ \ptr -> do
pokeElemOff (ptr `plusPtr` offset) i value
- Read upRead up
- Exclude checks
Found
do pokeElemOff (ptr `plusPtr` offset) i value
Perhaps
pokeElemOff (ptr `plusPtr` offset) i value
Use when Open
Open
if stage /= PixelStage then fail "colorTarget can be used only in pixel program"
else return ()
- Read upRead up
- Exclude checks
Found
if stage /= PixelStage then
fail "colorTarget can be used only in pixel program" else return ()
Perhaps
Control.Monad.when (stage /= PixelStage) $
fail "colorTarget can be used only in pixel program"
Redundant do Open
Open
}) value = do
withForeignPtr bytes $ \ptr -> do
pokeByteOff ptr offset value
- Read upRead up
- Exclude checks
Found
do withForeignPtr bytes $ \ ptr -> do pokeByteOff ptr offset value
Perhaps
withForeignPtr bytes $ \ ptr -> do pokeByteOff ptr offset value
Use when Open
Open
if stage /= PixelStage then fail "dualColorTarget can be used only in pixel program"
else return ()
- Read upRead up
- Exclude checks
Found
if stage /= PixelStage then
fail "dualColorTarget can be used only in pixel program" else
return ()
Perhaps
Control.Monad.when (stage /= PixelStage) $
fail "dualColorTarget can be used only in pixel program"
Eta reduce Open
Open
less_ a b = LessNode (nodeValueType a) a b
- Read upRead up
- Exclude checks
Found
less_ a b = LessNode (nodeValueType a) a b
Perhaps
less_ a = LessNode (nodeValueType a) a
Use when Open
Open
if stage == EndStage then fail "failed to add temp after end of the program"
else return ()
- Read upRead up
- Exclude checks
Found
if stage == EndStage then
fail "failed to add temp after end of the program" else return ()
Perhaps
Control.Monad.when (stage == EndStage) $
fail "failed to add temp after end of the program"
Eta reduce Open
Open
if_ c a b = IfNode (nodeValueType a) c a b
- Read upRead up
- Exclude checks
Found
if_ c a b = IfNode (nodeValueType a) c a b
Perhaps
if_ c a = IfNode (nodeValueType a) c a
Eta reduce Open
Open
max_ a b = MaxNode (nodeValueType a) a b
- Read upRead up
- Exclude checks
Found
max_ a b = MaxNode (nodeValueType a) a b
Perhaps
max_ a = MaxNode (nodeValueType a) a
Use when Open
Open
if stage /= VertexStage then fail $ show ("wrong stage to add pixel program", stage)
else return ()
- Read upRead up
- Exclude checks
Found
if stage /= VertexStage then
fail $ show ("wrong stage to add pixel program", stage) else
return ()
Perhaps
Control.Monad.when (stage /= VertexStage) $
fail $ show ("wrong stage to add pixel program", stage)
Eta reduce Open
Open
clamp a b c = ClampNode (nodeValueType a) a b c
- Read upRead up
- Exclude checks
Found
clamp a b c = ClampNode (nodeValueType a) a b c
Perhaps
clamp a = ClampNode (nodeValueType a) a
Redundant do Open
Open
}) i value = do
withForeignPtr bytes $ \ptr -> do
pokeElemOff (ptr `plusPtr` offset) i value
- Read upRead up
- Exclude checks
Found
do withForeignPtr bytes $
\ ptr -> do pokeElemOff (ptr `plusPtr` offset) i value
Perhaps
withForeignPtr bytes $
\ ptr -> do pokeElemOff (ptr `plusPtr` offset) i value
Eta reduce Open
Open
min_ a b = MinNode (nodeValueType a) a b
- Read upRead up
- Exclude checks
Found
min_ a b = MinNode (nodeValueType a) a b
Perhaps
min_ a = MinNode (nodeValueType a) a
Redundant bracket Open
Open
(map (\a -> [| nodeValueType $(varE a) |]) ps) ++ [ [| valueType $(varE u) |] ] ++ (map varE ps)
- Read upRead up
- Exclude checks
Found
(map (\ a -> [| nodeValueType $( varE a ) |]) ps) ++
[[| valueType $( varE u ) |]] ++ (map varE ps)
Perhaps
map (\ a -> [| nodeValueType $( varE a ) |]) ps ++
[[| valueType $( varE u ) |]] ++ (map varE ps)
Redundant bracket Open
Open
| n <= s || s >= (sizeOf (undefined :: Float4)) = s
- Read upRead up
- Exclude checks
Found
s >= (sizeOf (undefined :: Float4))
Perhaps
s >= sizeOf (undefined :: Float4)
Redundant bracket Open
Open
writeIORef sizeRef $ alignedBufferSize + (sizeOf u) * size
- Read upRead up
- Exclude checks
Found
(sizeOf u) * size
Perhaps
sizeOf u * size
Fuse foldr/map Open
Open
foldr (\a b -> [t| $a -> $b |]) [t| Node $(vecType $ sum cs) |] $ map argType cs
- Read upRead up
- Exclude checks
Found
foldr (\ a b -> [t| $a -> $b |]) [t| Node $( vecType $ sum cs ) |]
$ map argType cs
Perhaps
foldr ((\ a b -> [t| $a -> $b |]) . argType)
[t| Node $( vecType $ sum cs ) |]
cs
Redundant bracket Open
Open
(map (\a -> [| nodeValueType $(varE a) |]) ps) ++ [ [| valueType $(varE u) |] ] ++ (map varE ps)
- Read upRead up
- Exclude checks
Found
[[| valueType $( varE u ) |]] ++ (map varE ps)
Perhaps
[[| valueType $( varE u ) |]] ++ map varE ps
Reduce duplication Open
Open
bufferSize <- readIORef sizeRef
- Read upRead up
- Exclude checks
Found
bufferSize <- readIORef sizeRef
let align = shaderAlignment u
let alignedBufferSize
= ((bufferSize + align - 1) `quot` align) * align
Perhaps
Combine with flaw-graphics/Flaw/Graphics/Program.hs:199:5