All hints

All files

Report generated by HLint v2.1.11 - a tool to suggest improvements to your Haskell code.

./flaw-app/Flaw/App.hs:95:5: Error: Parse error
Found
  data AppConfig where
    AppConfig :: BinaryCache c =>
>     { appConfigTitle :: !T.Text
      , appConfigWindowPosition :: !(Maybe (Int, Int))
      , appConfigWindowSize :: !(Maybe (Int, Int))
./flaw-editor/Flaw/Editor/BlobService.hs:37:5: Error: Parse error
Found
  data BlobService where
    BlobService :: BinaryCache c =>
>     { blobServiceCache :: !c
      , blobServiceHttpManager :: !H.Manager
      } -> BlobService
./flaw-editor/Flaw/Editor/Entity.hs:221:5: Error: Parse error
Found
    EntityHistoryEnd :: EntityHistory
    EntityHistoryChange :: Entity a =>
>     { entityHistoryRevision :: {-# UNPACK #-} !Revision
      , entityHistoryEntity :: !a
      , entityHistoryChange :: !(EntityChange a)
./flaw-game/Flaw/Game/Lockstep.hs:128:44: Error: Parse error
Found
  lockstepClientRender LockstepClient
    { lockstepClientConfig = config
>   , lockstepClientRenderDelay = realToFrac -> renderDelay
    , lockstepClientMinRenderDelay = realToFrac -> minRenderDelay
    , lockstepClientMaxRenderDelay = realToFrac -> maxRenderDelay
./flaw-gamejolt-webapi/Flaw/GameJolt/WebApi.hs:87:30: Error: Parse error
Found
      ]
    A.Object (HM.lookup "response" -> Just (A.Object (HM.lookup "users" -> Just (A.fromJSON -> A.Success [User
>     { u_id = read . T.unpack -> userId
      , u_username = userName1
      , u_avatar_url = userAvatarUrl
./flaw-gl/Flaw/Graphics/WebGL.hs:142:5: Error: Parse error
Found
    -- enable extensions
    let extensions =
>     [ "ANGLE_instanced_arrays"
      , "EXT_color_buffer_half_float"
      , "EXT_frag_depth"
./flaw-graphics/Flaw/Graphics/Program/Internal.hs:382:5: Error: Parse error
Found
    SwizzleNode :: (OfVectorType a, OfVectorType b) => ValueType -> ValueType -> String -> Node a -> Node b
    SampleNode :: (OfVectorType (v c), OfVectorType (v Int32)) =>
>     { sampleNodeSamplerNode :: SamplerNode s (v c)
      , sampleNodeCoordsNode :: Node (v c)
      , sampleNodeOffsetNode :: Maybe (Node (v Int32))
./flaw-input/Flaw/Input/Sdl.hs:278:85: Error: Parse error
Found
        { SDL.eventType = eventType
        , SDL.controllerButtonEventWhich = joystickId
>       , SDL.controllerButtonEventButton = gamepadButtonFromSdlButton . fromIntegral -> button
        } -> when (button /= GamepadButtonUnknown) $ case eventType of
        SDL.SDL_CONTROLLERBUTTONDOWN -> addGamepadEvent joystickId $ GamepadButtonDownEvent button
./flaw-script/Flaw/Script.hs:33:5: Error: Parse error
Found
  data Task where
    Task :: Typeable a =>
>     { taskModules :: [T.Text]
      , taskExpression :: !T.Text
      , taskResultVar :: {-# UNPACK #-} !(TMVar (Either I.InterpreterError a))
./flaw-steam-webapi/Flaw/Steam/WebApi.hs:90:49: Error: Parse error
Found
      (J.fromJSON -> J.Success AuthenticatedUserTicket
        { aut_result = "OK"
>       , aut_steamid = SteamId . read . T.unpack -> steamId
        , aut_ownersteamid = SteamId . read . T.unpack -> ownerSteamId
        , aut_vacbanned = vacBanned
./flaw-ui/Flaw/UI/ListBox.hs:102:5: Error: Parse error
Found
  data ListBoxColumnDesc v where
    ListBoxColumnDesc :: Ord k =>
>     { listBoxColumnDescVisual :: !SomeVisual
      , listBoxColumnDescWidth :: {-# UNPACK #-} !Metric
      , listBoxColumnDescKeyFunc :: !(v -> k)
./flaw-websocket-client/Flaw/Network/WebSocket.hs:50:7: Error: Parse error
Found
    callback <- asyncCallback1 $ \messageEvent -> do
      let bytes = case WME.getData $ unsafeCoerce messageEvent of
>       WME.StringData s -> T.encodeUtf8 $ textFromJSString s
        WME.BlobData b -> arrayBufferToByteString $ blobToArrayBuffer b
        WME.ArrayBufferData d -> arrayBufferToByteString d
./flaw-websocket-server/Flaw/Network/WebSocket/Wai.hs:61:11: Error: Parse error
Found
          -- step loops until timeout
          let step = join $ atomically $ do
>           let readPing = do
              timedOut <- readTVar delayVar
              unless timedOut retry
./flaw-window/Flaw/Window/Web/Canvas.hs:43:5: Error: Parse error
Found
    eventsChan <- newBroadcastTChanIO
    let canvas = Canvas
>     { canvasElement = jsCanvas
      , canvasEventsChan = eventsChan
      }
./flaw-al/Flaw/Audio/OpenAL.hs:232:5: Suggestion: Use =<<
Found
join $ mapM_ snd <$> readIORef repeatOperationsRef
Perhaps
mapM_ snd =<< readIORef repeatOperationsRef
./flaw-asset/Flaw/Asset.hs:52:1: Suggestion: Use newtype instead of data
Found
data AssetBuilderError ai = AssetBuilderDuplicateAssetIdError ai
                              deriving Typeable
Perhaps
newtype AssetBuilderError ai = AssetBuilderDuplicateAssetIdError ai
                                 deriving Typeable
Note: decreases laziness
./flaw-bullet/Flaw/Physics/Bullet.hs:92:1: Suggestion: Use camelCase
Found
data C_BulletWorld
Perhaps
data CBulletWorld
./flaw-bullet/Flaw/Physics/Bullet.hs:93:1: Suggestion: Use camelCase
Found
data C_btCollisionShape
Perhaps
data CBtCollisionShape
./flaw-bullet/Flaw/Physics/Bullet.hs:94:1: Suggestion: Use camelCase
Found
data C_BulletRigidBody
Perhaps
data CBulletRigidBody
./flaw-bullet/Flaw/Physics/Bullet.hs:95:1: Suggestion: Use camelCase
Found
data C_BulletGhost
Perhaps
data CBulletGhost
./flaw-bullet/Flaw/Physics/Bullet.hs:96:1: Suggestion: Use camelCase
Found
data C_BulletCharacter
Perhaps
data CBulletCharacter
./flaw-collada/Flaw/Asset/Collada.hs:162:17: Suggestion: Redundant bracket
Found
(read . T.unpack) <$> getElementAttr "meter" unitElement
Perhaps
read . T.unpack <$> getElementAttr "meter" unitElement
./flaw-collada/Flaw/Asset/Collada.hs:194:26: Warning: Use gets
Found
MS.lookup name . ccElementsById <$> get
Perhaps
gets (MS.lookup name . ccElementsById)
./flaw-collada/Flaw/Asset/Collada.hs:242:21: Warning: Use gets
Found
ccWord32Arrays <$> get
Perhaps
gets ccWord32Arrays
./flaw-collada/Flaw/Asset/Collada.hs:250:21: Warning: Use gets
Found
ccFloatArrays <$> get
Perhaps
gets ccFloatArrays
./flaw-collada/Flaw/Asset/Collada.hs:258:21: Warning: Use gets
Found
ccNameArrays <$> get
Perhaps
gets ccNameArrays
./flaw-collada/Flaw/Asset/Collada.hs:385:11: Warning: Use gets
Found
(csUnit . ccSettings) <$> get
Perhaps
gets (csUnit . ccSettings)
./flaw-collada/Flaw/Asset/Collada.hs:385:11: Suggestion: Redundant bracket
Found
(csUnit . ccSettings) <$> get
Perhaps
csUnit . ccSettings <$> get
./flaw-collada/Flaw/Asset/Collada.hs:437:15: Warning: Use gets
Found
ccSettings <$> get
Perhaps
gets ccSettings
./flaw-collada/Flaw/Asset/Collada.hs:541:10: Warning: Use gets
Found
fmap ccSettings get
Perhaps
gets ccSettings
./flaw-collada/Flaw/Asset/Collada.hs:763:10: Warning: Use gets
Found
fmap ccSettings get
Perhaps
gets ccSettings
./flaw-editor/exe/editor.hs:162:11: Warning: Use forM_
Found
case maybeOldLayoutPanelChild of
    Just oldLayoutPanelChild -> removeFreeChild panel
                                  oldLayoutPanelChild
    Nothing -> return ()
Perhaps
Data.Foldable.forM_ maybeOldLayoutPanelChild
  (removeFreeChild panel)
./flaw-editor/exe/editor.hs:235:15: Error: Use readTVarIO
Found
atomically $ readTVar exitVar
Perhaps
readTVarIO exitVar
./flaw-editor/exe/model-editor.hs:959:13: Error: Use readTVarIO
Found
atomically $ readTVar exitVar
Perhaps
readTVarIO exitVar
./flaw-ffi/Flaw/FFI.hs:202:31: Suggestion: Redundant $
Found
normalB $ [| maximum $( listE $ map fieldEnd unionFields ) |]
Perhaps
normalB [| maximum $( listE $ map fieldEnd unionFields ) |]
./flaw-ffmpeg/Flaw/Media/FFmpeg.hs:392:1: Suggestion: Use camelCase
Found
data C_FFmpegScaler
Perhaps
data CFFmpegScaler
./flaw-ffmpeg/Flaw/Media/FFmpeg.hs:400:1: Suggestion: Use camelCase
Found
data C_AVFormatContext
Perhaps
data CAVFormatContext
./flaw-ffmpeg/Flaw/Media/FFmpeg.hs:401:1: Suggestion: Use camelCase
Found
data C_AVStream
Perhaps
data CAVStream
./flaw-ffmpeg/Flaw/Media/FFmpeg.hs:402:1: Suggestion: Use camelCase
Found
data C_AVPacket
Perhaps
data CAVPacket
./flaw-ffmpeg/Flaw/Media/FFmpeg.hs:403:1: Suggestion: Use camelCase
Found
data C_AVFrame
Perhaps
data CAVFrame
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:98:1: Suggestion: Use camelCase
Found
data Hb_font_t
Perhaps
data HbFontT
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:99:1: Suggestion: Use camelCase
Found
data Hb_buffer_t
Perhaps
data HbBufferT
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:100:1: Suggestion: Use camelCase
Found
data Hb_glyph_info_t
Perhaps
data HbGlyphInfoT
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:101:1: Suggestion: Use camelCase
Found
data Hb_glyph_position_t
Perhaps
data HbGlyphPositionT
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:102:1: Suggestion: Use camelCase
Found
type Hb_position_t = Int32
Perhaps
type HbPositionT = Int32
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:103:1: Suggestion: Use camelCase
Found
type Hb_codepoint_t = Word32
Perhaps
type HbCodepointT = Word32
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:119:1: Suggestion: Use camelCase
Found
hb_x_advance = ...
Perhaps
hbXAdvance = ...
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:121:1: Suggestion: Use camelCase
Found
hb_y_advance p = ...
Perhaps
hbYAdvance p = ...
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:123:1: Suggestion: Use camelCase
Found
hb_x_offset p = ...
Perhaps
hbXOffset p = ...
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:125:1: Suggestion: Use camelCase
Found
hb_y_offset p = ...
Perhaps
hbYOffset p = ...
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:127:1: Suggestion: Use camelCase
Found
hb_codepoint = ...
Perhaps
hbCodepoint = ...
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:130:1: Suggestion: Use camelCase
Found
hb_glyph_position_t_size = ...
Perhaps
hbGlyphPositionTSize = ...
./flaw-font-fhi/Flaw/Graphics/Font/Harfbuzz.hs:133:1: Suggestion: Use camelCase
Found
hb_glyph_info_t_size = ...
Perhaps
hbGlyphInfoTSize = ...
./flaw-font-fhi/Flaw/Graphics/Font/FreeType/FFI.hs:38:1: Suggestion: Use camelCase
Found
type FT_Error = CInt
Perhaps
type FTError = CInt
./flaw-font-fhi/Flaw/Graphics/Font/FreeType/FFI.hs:40:1: Suggestion: Use camelCase
Found
data FT_LibraryRec
Perhaps
data FTLibraryRec
./flaw-font-fhi/Flaw/Graphics/Font/FreeType/FFI.hs:41:1: Suggestion: Use camelCase
Found
type FT_Library = Ptr FT_LibraryRec
Perhaps
type FTLibrary = Ptr FT_LibraryRec
./flaw-font-fhi/Flaw/Graphics/Font/FreeType/FFI.hs:43:1: Suggestion: Use camelCase
Found
data FT_FaceRec
Perhaps
data FTFaceRec
./flaw-font-fhi/Flaw/Graphics/Font/FreeType/FFI.hs:44:1: Suggestion: Use camelCase
Found
type FT_Face = Ptr FT_FaceRec
Perhaps
type FTFace = Ptr FT_FaceRec
./flaw-font-fhi/Flaw/Graphics/Font/FreeType/FFI.hs:46:1: Suggestion: Use camelCase
Found
data FT_GlyphSlotRec
Perhaps
data FTGlyphSlotRec
./flaw-font-fhi/Flaw/Graphics/Font/FreeType/FFI.hs:47:1: Suggestion: Use camelCase
Found
type FT_GlyphSlot = Ptr FT_GlyphSlotRec
Perhaps
type FTGlyphSlot = Ptr FT_GlyphSlotRec
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:177:1: Suggestion: Use camelCase
Found
glBufferData_bs target bytes usage = ...
Perhaps
glBufferDataBs target bytes usage = ...
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:182:1: Warning: Eta reduce
Found
glBufferData_null target size usage
  = glBufferData target size nullPtr usage
Perhaps
glBufferData_null target size = glBufferData target size nullPtr
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:182:1: Suggestion: Use camelCase
Found
glBufferData_null target size usage = ...
Perhaps
glBufferDataNull target size usage = ...
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:255:1: Suggestion: Use camelCase
Found
glShaderSource_s shaderName source = ...
Perhaps
glShaderSourceS shaderName source = ...
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:261:1: Suggestion: Use camelCase
Found
glGetProgramInfoLog_s programName = ...
Perhaps
glGetProgramInfoLogS programName = ...
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:272:1: Suggestion: Use camelCase
Found
glGetShaderInfoLog_s shaderName = ...
Perhaps
glGetShaderInfoLogS shaderName = ...
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:284:1: Suggestion: Use camelCase
Found
glBindAttribLocation_s programName index attributeName = ...
Perhaps
glBindAttribLocationS programName index attributeName = ...
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:287:1: Suggestion: Use camelCase
Found
glGetUniformLocation_s programName locationName = ...
Perhaps
glGetUniformLocationS programName locationName = ...
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:290:1: Suggestion: Use camelCase
Found
glGetUniformBlockIndex_s programName uniformBlockName = ...
Perhaps
glGetUniformBlockIndexS programName uniformBlockName = ...
./flaw-gl/Flaw/Graphics/OpenGL/FFI.hs:293:1: Suggestion: Use camelCase
Found
glDrawBuffers_n colorBuffersCount = ...
Perhaps
glDrawBuffersN colorBuffersCount = ...
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:591:1: Suggestion: Use camelCase
Found
newtype JS_WebGLContext = JS_WebGLContext JSVal
Perhaps
newtype JSWebGLContext = JSWebGLContext JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:592:1: Suggestion: Use camelCase
Found
newtype JS_WebGLTexture = JS_WebGLTexture JSVal
Perhaps
newtype JSWebGLTexture = JSWebGLTexture JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:593:1: Suggestion: Use camelCase
Found
newtype JS_WebGLSampler = JS_WebGLSampler JSVal
Perhaps
newtype JSWebGLSampler = JSWebGLSampler JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:594:1: Suggestion: Use camelCase
Found
newtype JS_WebGLRenderbuffer = JS_WebGLRenderbuffer JSVal
Perhaps
newtype JSWebGLRenderbuffer = JSWebGLRenderbuffer JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:595:1: Suggestion: Use camelCase
Found
newtype JS_WebGLFramebuffer = JS_WebGLFramebuffer JSVal
Perhaps
newtype JSWebGLFramebuffer = JSWebGLFramebuffer JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:596:1: Suggestion: Use camelCase
Found
newtype JS_WebGLBuffer = JS_WebGLBuffer JSVal
Perhaps
newtype JSWebGLBuffer = JSWebGLBuffer JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:597:1: Suggestion: Use camelCase
Found
newtype JS_WebGLProgram = JS_WebGLProgram JSVal
Perhaps
newtype JSWebGLProgram = JSWebGLProgram JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:598:1: Suggestion: Use camelCase
Found
newtype JS_WebGLShader = JS_WebGLShader JSVal
Perhaps
newtype JSWebGLShader = JSWebGLShader JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:599:1: Suggestion: Use camelCase
Found
newtype JS_WebGLUniformLocation = JS_WebGLUniformLocation JSVal
Perhaps
newtype JSWebGLUniformLocation = JSWebGLUniformLocation JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:600:1: Suggestion: Use camelCase
Found
newtype JS_WebGLVertexArray = JS_WebGLVertexArray JSVal
Perhaps
newtype JSWebGLVertexArray = JSWebGLVertexArray JSVal
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:753:1: Suggestion: Use camelCase
Found
glShaderSource_s shader source = ...
Perhaps
glShaderSourceS shader source = ...
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:759:1: Suggestion: Use camelCase
Found
glGetShaderInfoLog_s shader = ...
Perhaps
glGetShaderInfoLogS shader = ...
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:765:1: Suggestion: Use camelCase
Found
glGetProgramInfoLog_s program = ...
Perhaps
glGetProgramInfoLogS program = ...
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:768:1: Suggestion: Use camelCase
Found
glBindAttribLocation_s program index attributeName = ...
Perhaps
glBindAttribLocationS program index attributeName = ...
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:771:1: Suggestion: Use camelCase
Found
glGetUniformLocation_s program locationName = ...
Perhaps
glGetUniformLocationS program locationName = ...
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:774:1: Suggestion: Use camelCase
Found
glGetUniformBlockIndex_s programName uniformBlockName = ...
Perhaps
glGetUniformBlockIndexS programName uniformBlockName = ...
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:892:1: Warning: Eta reduce
Found
glBufferData_bs target bytes usage
  = glBufferData_val target (byteStringToJsDataView bytes) usage
Perhaps
glBufferData_bs target bytes
  = glBufferData_val target (byteStringToJsDataView bytes)
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:892:1: Suggestion: Use camelCase
Found
glBufferData_bs target bytes usage = ...
Perhaps
glBufferDataBs target bytes usage = ...
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:896:1: Warning: Eta reduce
Found
glBufferData_null target size usage
  = glBufferData_val target (pToJSVal size) usage
Perhaps
glBufferData_null target size
  = glBufferData_val target (pToJSVal size)
./flaw-gl/Flaw/Graphics/WebGL/FFI.hs:896:1: Suggestion: Use camelCase
Found
glBufferData_null target size usage = ...
Perhaps
glBufferDataNull target size usage = ...
./flaw-gl-mesa/Flaw/Graphics/OpenGL/Mesa.hs:175:1: Suggestion: Use camelCase
Found
data C_OSMesaContext
Perhaps
data COSMesaContext
./flaw-graphics/Flaw/Graphics/Program.hs:99:7: Suggestion: Fuse foldr/map
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
./flaw-graphics/Flaw/Graphics/Program.hs:101:7: Suggestion: Redundant bracket
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)
./flaw-graphics/Flaw/Graphics/Program.hs:101:57: Suggestion: Redundant bracket
Found
[[| valueType $( varE u ) |]] ++ (map varE ps)
Perhaps
[[| valueType $( varE u ) |]] ++ map varE ps
./flaw-graphics/Flaw/Graphics/Program.hs:130:3: Warning: Use when
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"
./flaw-graphics/Flaw/Graphics/Program.hs:168:17: Suggestion: Redundant bracket
Found
s >= (sizeOf (undefined :: Float4))
Perhaps
s >= sizeOf (undefined :: Float4)
./flaw-graphics/Flaw/Graphics/Program.hs:202:46: Suggestion: Redundant bracket
Found
(sizeOf u) * size
Perhaps
sizeOf u * size
./flaw-graphics/Flaw/Graphics/Program.hs:232:14: Warning: Redundant do
Found
do withForeignPtr bytes $ \ ptr -> do pokeByteOff ptr offset value
Perhaps
withForeignPtr bytes $ \ ptr -> do pokeByteOff ptr offset value
./flaw-graphics/Flaw/Graphics/Program.hs:233:34: Warning: Redundant do
Found
do pokeByteOff ptr offset value
Perhaps
pokeByteOff ptr offset value
./flaw-graphics/Flaw/Graphics/Program.hs:245:16: Warning: Redundant do
Found
do withForeignPtr bytes $
     \ ptr -> do pokeElemOff (ptr `plusPtr` offset) i value
Perhaps
withForeignPtr bytes $
  \ ptr -> do pokeElemOff (ptr `plusPtr` offset) i value
./flaw-graphics/Flaw/Graphics/Program.hs:246:34: Warning: Redundant do
Found
do pokeElemOff (ptr `plusPtr` offset) i value
Perhaps
pokeElemOff (ptr `plusPtr` offset) i value
./flaw-graphics/Flaw/Graphics/Program.hs:362:3: Warning: Use when
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"
./flaw-graphics/Flaw/Graphics/Program.hs:379:3: Warning: Use when
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)
./flaw-graphics/Flaw/Graphics/Program.hs:397:3: Warning: Use when
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"
./flaw-graphics/Flaw/Graphics/Program.hs:409:3: Warning: Use when
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"
./flaw-graphics/Flaw/Graphics/Program.hs:421:3: Warning: Use when
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"
./flaw-graphics/Flaw/Graphics/Program.hs:477:1: Warning: Eta reduce
Found
min_ a b = MinNode (nodeValueType a) a b
Perhaps
min_ a = MinNode (nodeValueType a) a
./flaw-graphics/Flaw/Graphics/Program.hs:480:1: Warning: Eta reduce
Found
max_ a b = MaxNode (nodeValueType a) a b
Perhaps
max_ a = MaxNode (nodeValueType a) a
./flaw-graphics/Flaw/Graphics/Program.hs:483:1: Warning: Eta reduce
Found
clamp a b c = ClampNode (nodeValueType a) a b c
Perhaps
clamp a = ClampNode (nodeValueType a) a
./flaw-graphics/Flaw/Graphics/Program.hs:486:1: Warning: Eta reduce
Found
lerp a b c = LerpNode (nodeValueType a) a b c
Perhaps
lerp a = LerpNode (nodeValueType a) a
./flaw-graphics/Flaw/Graphics/Program.hs:489:1: Warning: Eta reduce
Found
equal_ a b = EqualNode (nodeValueType a) a b
Perhaps
equal_ a = EqualNode (nodeValueType a) a
./flaw-graphics/Flaw/Graphics/Program.hs:492:1: Warning: Eta reduce
Found
less_ a b = LessNode (nodeValueType a) a b
Perhaps
less_ a = LessNode (nodeValueType a) a
./flaw-graphics/Flaw/Graphics/Program.hs:495:1: Warning: Eta reduce
Found
lessEqual_ a b = LessEqualNode (nodeValueType a) a b
Perhaps
lessEqual_ a = LessEqualNode (nodeValueType a) a
./flaw-graphics/Flaw/Graphics/Program.hs:504:1: Warning: Eta reduce
Found
if_ c a b = IfNode (nodeValueType a) c a b
Perhaps
if_ c a = IfNode (nodeValueType a) c a
./flaw-input/Flaw/Input/Win32.hs:259:22: Warning: Use when
Found
if (flags .&. RI_MOUSE_LEFT_BUTTON_UP) > 0 then
  addMouseEvent $ MouseUpEvent LeftMouseButton else return ()
Perhaps
when ((flags .&. RI_MOUSE_LEFT_BUTTON_UP) > 0) $
  addMouseEvent $ MouseUpEvent LeftMouseButton
./flaw-input/Flaw/Input/Win32.hs:265:22: Warning: Use when
Found
if (flags .&. RI_MOUSE_RIGHT_BUTTON_UP) > 0 then
  addMouseEvent $ MouseUpEvent RightMouseButton else return ()
Perhaps
when ((flags .&. RI_MOUSE_RIGHT_BUTTON_UP) > 0) $
  addMouseEvent $ MouseUpEvent RightMouseButton
./flaw-input/Flaw/Input/Win32.hs:271:22: Warning: Use when
Found
if (flags .&. RI_MOUSE_MIDDLE_BUTTON_UP) > 0 then
  addMouseEvent $ MouseUpEvent MiddleMouseButton else return ()
Perhaps
when ((flags .&. RI_MOUSE_MIDDLE_BUTTON_UP) > 0) $
  addMouseEvent $ MouseUpEvent MiddleMouseButton
./flaw-itch-webapi/Flaw/Itch/WebApi.hs:7:1: Warning: Unused LANGUAGE pragma
Found
{-# LANGUAGE DeriveGeneric, GeneralizedNewtypeDeriving,
  OverloadedStrings, ViewPatterns #-}
Perhaps
{-# LANGUAGE DeriveGeneric, GeneralizedNewtypeDeriving,
  OverloadedStrings #-}
./flaw-itch-webapi/Flaw/Itch/WebApi.hs:56:85: Warning: Redundant do
Found
do A.parseMaybe parseResponse <$>
     itchWebApiRequest httpManager apiKey
       ("/game/" <> fromString (show gameId) <> "/download_keys")
       [("user_id", Just $ fromString $ show userId)]
Perhaps
A.parseMaybe parseResponse <$>
  itchWebApiRequest httpManager apiKey
    ("/game/" <> fromString (show gameId) <> "/download_keys")
    [("user_id", Just $ fromString $ show userId)]
./flaw-lmdb/Flaw/Data/Lmdb.hs:189:23: Warning: Redundant do
Found
do if r == MDB_SUCCESS then
     do keyLength <- fromIntegral . ptrToIntPtr <$> peek keyBufPtr
        keyPtr <- peekElemOff keyBufPtr 1
        key <- B.packCStringLen (keyPtr, keyLength)
        if B.isPrefixOf keyPrefix key then
          do valueLength <- fromIntegral . ptrToIntPtr <$> peek valueBufPtr
             valuePtr <- peekElemOff valueBufPtr 1
             value <- B.packCStringLen (valuePtr, valueLength)
             (continue, nz) <- step key value z
             if continue then
               iteration nz =<<
                 mdb_cursor_get cursorPtr keyBufPtr valueBufPtr MDB_NEXT
               else return nz
          else return z
     else if r == MDB_NOTFOUND then return z else lmdbThrowError r
Perhaps
if r == MDB_SUCCESS then
  do keyLength <- fromIntegral . ptrToIntPtr <$> peek keyBufPtr
     keyPtr <- peekElemOff keyBufPtr 1
     key <- B.packCStringLen (keyPtr, keyLength)
     if B.isPrefixOf keyPrefix key then
       do valueLength <- fromIntegral . ptrToIntPtr <$> peek valueBufPtr
          valuePtr <- peekElemOff valueBufPtr 1
          value <- B.packCStringLen (valuePtr, valueLength)
          (continue, nz) <- step key value z
          if continue then
            iteration nz =<<
              mdb_cursor_get cursorPtr keyBufPtr valueBufPtr MDB_NEXT
            else return nz
       else return z
  else if r == MDB_NOTFOUND then return z else lmdbThrowError r
./flaw-lmdb/Flaw/Data/Lmdb.hs:240:1: Suggestion: Use camelCase
Found
data MDB_env
Perhaps
data MDBEnv
./flaw-lmdb/Flaw/Data/Lmdb.hs:241:1: Suggestion: Use camelCase
Found
data MDB_txn
Perhaps
data MDBTxn
./flaw-lmdb/Flaw/Data/Lmdb.hs:242:1: Suggestion: Use camelCase
Found
data MDB_cursor
Perhaps
data MDBCursor
./flaw-lmdb/Flaw/Data/Lmdb.hs:243:1: Suggestion: Use camelCase
Found
type MDB_dbi = CUInt
Perhaps
type MDBDbi = CUInt
./flaw-lmdb/Flaw/Data/Lmdb.hs:245:1: Suggestion: Use camelCase
Found
type MDB_val = Ptr CChar
Perhaps
type MDBVal = Ptr CChar
./flaw-lua/Flaw/Script/Lua.hs:125:1: Suggestion: Use newtype instead of data
Found
data LuaLoadError = LuaLoadError !T.Text
                      deriving Show
Perhaps
newtype LuaLoadError = LuaLoadError T.Text
                         deriving Show
./flaw-lua/Flaw/Script/Lua/Chunk.hs:244:5: Suggestion: Use guards
Found
argsSetDecs i
  = if i < numParams then
      do a <- newName "a"
         (restDecs, xs) <- argsSetDecs $ i + 1
         return
           (valD [p| $( varP (paramNames V.! i) ) : $xs |]
              (normalB
                 [|
                   case $( varE a ) of
                       [] -> [LuaNil]
                       _ -> $( varE a )
                   |])
              []
              : restDecs,
            varP a)
      else
      if isVararg then
        do a <- newName "a"
           return ([valD (varP varargName) (normalB $ varE a) []], varP a)
        else return ([], wildP)
Perhaps
argsSetDecs i
  | i < numParams =
    do a <- newName "a"
       (restDecs, xs) <- argsSetDecs $ i + 1
       return
         (valD [p| $( varP (paramNames V.! i) ) : $xs |]
            (normalB
               [|
                 case $( varE a ) of
                     [] -> [LuaNil]
                     _ -> $( varE a )
                 |])
            []
            : restDecs,
          varP a)
  | isVararg =
    do a <- newName "a"
       return ([valD (varP varargName) (normalB $ varE a) []], varP a)
  | otherwise = return ([], wildP)
./flaw-lua/Flaw/Script/Lua/Chunk.hs:310:74: Suggestion: Redundant bracket
Found
((noBindS e) :)
Perhaps
(noBindS e :)
./flaw-lua/Flaw/Script/Lua/Chunk.hs:369:18: Suggestion: Redundant bracket
Found
(bindS (varP f) [| readMutVar $( r a ) |]) :
  getArgsStmts ++ putRetsStmts
Perhaps
bindS (varP f) [| readMutVar $( r a ) |] :
  getArgsStmts ++ putRetsStmts
./flaw-lua/Flaw/Script/Lua/Chunk.hs:384:20: Suggestion: Redundant bracket
Found
(noBindS [| writeMutVar $( r a ) $( kst nax ) |]) :
  nextNextInstStmts
Perhaps
noBindS [| writeMutVar $( r a ) $( kst nax ) |] : nextNextInstStmts
./flaw-lua/Flaw/Script/Lua/Chunk.hs:387:20: Suggestion: Redundant bracket
Found
(noBindS
   [|
     writeMutVar $( r a ) $
       LuaBoolean $( litE $ integerL $ if b > 0 then 1 else 0 )
     |])
  : followingInstStmts
Perhaps
noBindS
  [|
    writeMutVar $( r a ) $
      LuaBoolean $( litE $ integerL $ if b > 0 then 1 else 0 )
    |]
  : followingInstStmts
./flaw-lua/Flaw/Script/Lua/Chunk.hs:440:19: Suggestion: Redundant bracket
Found
(bindS (varP p) [| readMutVar $( r j ) |]) :
  restStmts ++
    [bindS (varP q) [| luaValueConcat $( varE p ) $restE |]]
Perhaps
bindS (varP p) [| readMutVar $( r j ) |] :
  restStmts ++
    [bindS (varP q) [| luaValueConcat $( varE p ) $restE |]]
./flaw-lua/Flaw/Script/Lua/Chunk.hs:446:71: Warning: Redundant return
Found
do jmpInstStmts <- jmpInstCode codeState
   return jmpInstStmts
Perhaps
do jmpInstCode codeState
./flaw-lua/Flaw/Script/Lua/Chunk.hs:468:56: Suggestion: Redundant bracket
Found
(noBindS [| writeMutVar $( r a ) p |]) : nextInstStmts
Perhaps
noBindS [| writeMutVar $( r a ) p |] : nextInstStmts
./flaw-lua/Flaw/Script/Lua/Chunk.hs:473:30: Suggestion: Redundant bracket
Found
(noBindS [| writeMutVar $( r a ) p |]) : nextInstStmts
Perhaps
noBindS [| writeMutVar $( r a ) p |] : nextInstStmts
./flaw-lua/Flaw/Script/Lua/Chunk.hs:484:20: Suggestion: Redundant bracket
Found
(bindS (varP f) [| readMutVar $( r a ) |]) :
  getArgsStmts ++ [noBindS callE]
Perhaps
bindS (varP f) [| readMutVar $( r a ) |] :
  getArgsStmts ++ [noBindS callE]
./flaw-lua/Flaw/Script/Lua/Chunk.hs:499:54: Suggestion: Redundant bracket
Found
(noBindS [| writeMutVar $( r $ a + 3 ) newIdx |]) : jmpInstStmts
Perhaps
noBindS [| writeMutVar $( r $ a + 3 ) newIdx |] : jmpInstStmts
./flaw-lua/Flaw/Script/Lua/Chunk.hs:504:20: Suggestion: Redundant bracket
Found
(noBindS
   [|
     do step <- readMutVar $( r $ a + 2 )
        idx <- readMutVar $( r a )
        writeMutVar $( r a ) =<< luaValueSub idx step
     |])
  : followingInstStmts
Perhaps
noBindS
  [|
    do step <- readMutVar $( r $ a + 2 )
       idx <- readMutVar $( r a )
       writeMutVar $( r a ) =<< luaValueSub idx step
    |]
  : followingInstStmts
./flaw-lua/Flaw/Script/Lua/Chunk.hs:538:74: Warning: Redundant do
Found
do putRets (if b == 0 then Left a else Right [a .. (a + b - 2)])
     [| return $( varE varargName ) |]
     nextInstCode
     codeState
Perhaps
putRets (if b == 0 then Left a else Right [a .. (a + b - 2)])
  [| return $( varE varargName ) |]
  nextInstCode
  codeState
./flaw-lua/Flaw/Script/Lua/Chunk.hs:571:75: Warning: Redundant do
Found
do if instructionsRefCounts VU.! followingInstId == 1 then
     getInstructionCode $ instructions V.! followingInstId else
     return $
       \ LuaCodeState{luaCodeStateTop = top} ->
         do when (top >= 0) $
              reportError
                "flaw-lua: instruction reference cannot send dynamic values"
            return [noBindS $ varE $ instructionsNames V.! followingInstId]
Perhaps
if instructionsRefCounts VU.! followingInstId == 1 then
  getInstructionCode $ instructions V.! followingInstId else
  return $
    \ LuaCodeState{luaCodeStateTop = top} ->
      do when (top >= 0) $
           reportError
             "flaw-lua: instruction reference cannot send dynamic values"
         return [noBindS $ varE $ instructionsNames V.! followingInstId]
./flaw-lua/Flaw/Script/Lua/FFI.hs:104:1: Suggestion: Use camelCase
Found
data C_lua_State
Perhaps
data CLuaState
./flaw-lua/Flaw/Script/Lua/FFI.hs:147:1: Suggestion: Use camelCase
Found
type C_lua_Alloc =
     Ptr () -> Ptr () -> CSize -> CSize -> IO (Ptr ())
Perhaps
type CLuaAlloc = Ptr () -> Ptr () -> CSize -> CSize -> IO (Ptr ())
./flaw-lua/Flaw/Script/Lua/FFI.hs:148:1: Suggestion: Use camelCase
Found
type C_lua_Reader =
     Ptr C_lua_State -> Ptr () -> Ptr CSize -> IO (Ptr CChar)
Perhaps
type CLuaReader =
     Ptr C_lua_State -> Ptr () -> Ptr CSize -> IO (Ptr CChar)
./flaw-lua/Flaw/Script/Lua/FFI.hs:149:1: Suggestion: Use camelCase
Found
type C_lua_Writer =
     Ptr C_lua_State -> Ptr () -> CSize -> Ptr () -> IO CInt
Perhaps
type CLuaWriter =
     Ptr C_lua_State -> Ptr () -> CSize -> Ptr () -> IO CInt
./flaw-lua/Flaw/Script/Lua/FFI.hs:158:1: Suggestion: Use camelCase
Found
lua_pop s n = ...
Perhaps
luaPop s n = ...
./flaw-lua/Flaw/Script/Lua/FFI.hs:162:1: Suggestion: Use camelCase
Found
lua_tostring s i = ...
Perhaps
luaTostring s i = ...
./flaw-lua/Flaw/Script/Lua/Operations.hs:286:10: Suggestion: Redundant bracket
Found
(LuaBoolean . luaCoerceToBool) <$> tryBinaryMetaMethod "__lt" a b
Perhaps
LuaBoolean . luaCoerceToBool <$> tryBinaryMetaMethod "__lt" a b
./flaw-lua/Flaw/Script/Lua/Operations.hs:296:7: Suggestion: Redundant bracket
Found
(LuaBoolean . (`xor` 1) . luaCoerceToBool) <$>
  tryBinaryMetaMethod "__lt" b a
Perhaps
LuaBoolean . (`xor` 1) . luaCoerceToBool <$>
  tryBinaryMetaMethod "__lt" b a
./flaw-math/Flaw/Math.hs:164:52: Suggestion: Redundant bracket
Found
(conT ''Vectorized) `appT` (varT a)
Perhaps
conT ''Vectorized `appT` (varT a)
./flaw-math/Flaw/Math.hs:164:52: Suggestion: Redundant bracket
Found
(conT ''Vectorized) `appT` (varT a)
Perhaps
(conT ''Vectorized) `appT` varT a
./flaw-math/Flaw/Math.hs:164:106: Suggestion: Redundant bracket
Found
(appT arrowT) . varT
Perhaps
appT arrowT . varT
./flaw-math/Flaw/Math.hs:164:129: Suggestion: Redundant bracket
Found
(conT v) `appT` (varT a)
Perhaps
conT v `appT` (varT a)
./flaw-math/Flaw/Math.hs:164:129: Suggestion: Redundant bracket
Found
(conT v) `appT` (varT a)
Perhaps
(conT v) `appT` varT a
./flaw-math/Flaw/Math.hs:177:52: Suggestion: Redundant bracket
Found
(conT ''Vectorized) `appT` (varT a)
Perhaps
conT ''Vectorized `appT` (varT a)
./flaw-math/Flaw/Math.hs:177:52: Suggestion: Redundant bracket
Found
(conT ''Vectorized) `appT` (varT a)
Perhaps
(conT ''Vectorized) `appT` varT a
./flaw-math/Flaw/Math.hs:177:106: Suggestion: Redundant bracket
Found
(appT arrowT) . varT
Perhaps
appT arrowT . varT
./flaw-math/Flaw/Math.hs:177:129: Suggestion: Redundant bracket
Found
(conT v) `appT` (varT a)
Perhaps
conT v `appT` (varT a)
./flaw-math/Flaw/Math.hs:177:129: Suggestion: Redundant bracket
Found
(conT v) `appT` (varT a)
Perhaps
(conT v) `appT` varT a
./flaw-math/Flaw/Math.hs:239:28: Suggestion: Redundant $
Found
conT $ mkName
Perhaps
conT mkName
./flaw-math/Flaw/Math.hs:302:32: Suggestion: Redundant $
Found
normalB $ [| sqrt . norm2 |]
Perhaps
normalB [| sqrt . norm2 |]
./flaw-math/Flaw/Math.hs:320:79: Suggestion: Redundant $
Found
tySynEqn [[t| $( conT srcDataName ) $elemType |]] $
  [t| $( conT dataName ) $elemType |]
Perhaps
tySynEqn [[t| $( conT srcDataName ) $elemType |]]
  [t| $( conT dataName ) $elemType |]
./flaw-math/Flaw/Math.hs:427:99: Suggestion: Fuse foldr/map
Found
foldr ($) [| EQ |] $
  map
    (\ (a, b) c ->
       [|
         case compare $( varE a ) $( varE b ) of
             EQ -> $c
             r -> r
         |])
    $ zip as bs
Perhaps
foldr
  (($) .
     (\ (a, b) c ->
        [|
          case compare $( varE a ) $( varE b ) of
              EQ -> $c
              r -> r
          |]))
  [| EQ |]
  (zip as bs)
./flaw-math/Flaw/Math.hs:457:97: Suggestion: Redundant $
Found
noBindS $ [| return $( foldl appE (conE conName) $ map varE as ) |]
Perhaps
noBindS [| return $( foldl appE (conE conName) $ map varE as ) |]
./flaw-math/Flaw/Math.hs:556:99: Suggestion: Fuse foldr/map
Found
foldr ($) [| EQ |] $
  map
    (\ (a, b) c ->
       [|
         case compare $( varE a ) $( varE b ) of
             EQ -> $c
             r -> r
         |])
    $ zip as bs
Perhaps
foldr
  (($) .
     (\ (a, b) c ->
        [|
          case compare $( varE a ) $( varE b ) of
              EQ -> $c
              r -> r
          |]))
  [| EQ |]
  (zip as bs)
./flaw-math/Flaw/Math.hs:581:97: Suggestion: Redundant $
Found
noBindS $ [| return $( foldl appE (conE conName) $ map varE as ) |]
Perhaps
noBindS [| return $( foldl appE (conE conName) $ map varE as ) |]
./flaw-math/Flaw/Math.hs:729:84: Suggestion: Use tuple-section
Found
\ t -> (Bang NoSourceUnpackedness NoSourceStrictness, t)
Perhaps
(Bang NoSourceUnpackedness NoSourceStrictness,)
Note: may require {-# LANGUAGE TupleSections #-} adding to the top of the file
./flaw-math/Flaw/Math/Internal.hs:103:57: Suggestion: Redundant $
Found
conT $ mkName
Perhaps
conT mkName
./flaw-math/Flaw/Math/Internal.hs:108:57: Suggestion: Redundant $
Found
conT $ mkName
Perhaps
conT mkName
./flaw-network/Flaw/Network/Session.hs:89:3: Warning: Use forM_
Found
case HM.lookup userId sessionsByUserId of
    Just session -> deleteSession sessionManager session
    Nothing -> return ()
Perhaps
Data.Foldable.forM_ (HM.lookup userId sessionsByUserId)
  (deleteSession sessionManager)
./flaw-oil/Flaw/Oil/Repo.hs:186:39: Warning: Redundant do
Found
do let step
         = do r <- sqliteStep query
              if r then
                do line <- sqliteColumn query 0
                   restLines <- step
                   return $ line : restLines
                else return []
     in step
Perhaps
let step
      = do r <- sqliteStep query
           if r then
             do line <- sqliteColumn query 0
                restLines <- step
                return $ line : restLines
             else return []
  in step
./flaw-sdl/Flaw/Sdl.hs:26:1: Suggestion: Use newtype instead of data
Found
data SdlException = SdlException String
                      deriving Show
Perhaps
newtype SdlException = SdlException String
                         deriving Show
Note: decreases laziness
./flaw-steam-encryptedticket/Flaw/Steam/EncryptedTicket.hs:57:1: Suggestion: Use camelCase
Found
data SteamEncryptedTicketException = SteamEncryptedTicketException_DecryptionFailed
                                   | SteamEncryptedTicketException_WrongAppId
                                   | SteamEncryptedTicketException_TicketTimedOut
                                       deriving Show
Perhaps
data SteamEncryptedTicketException = SteamEncryptedTicketExceptionDecryptionFailed
                                   | SteamEncryptedTicketExceptionWrongAppId
                                   | SteamEncryptedTicketExceptionTicketTimedOut
                                       deriving Show
./flaw-visual/Flaw/Visual/Geometry/Simplification.hs:203:32: Warning: Use forM_
Found
case M.lookup (PairKey a b) pairHeapIndexByKey of
    Just h -> VGM.unsafeModify pairTriangleCounts (+ 1) h
    Nothing -> return ()
Perhaps
Data.Foldable.forM_ (M.lookup (PairKey a b) pairHeapIndexByKey)
  (VGM.unsafeModify pairTriangleCounts (+ 1))
./flaw-visual/Flaw/Visual/Geometry/Simplification.hs:312:12: Warning: Use when
Found
if pair_cost rp < pair_cost p && pair_cost rp <= pair_cost lp then
  swap r rp else return ()
Perhaps
when (pair_cost rp < pair_cost p && pair_cost rp <= pair_cost lp) $
  swap r rp
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:344:1: Suggestion: Use camelCase
Found
type FN_vkAllocationFunction =
     Ptr () -> CSize -> CSize -> VkSystemAllocationScope -> IO (Ptr ())
Perhaps
type FNVkAllocationFunction =
     Ptr () -> CSize -> CSize -> VkSystemAllocationScope -> IO (Ptr ())
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:345:1: Suggestion: Use camelCase
Found
type FN_vkReallocationFunction =
     Ptr () ->
       Ptr () -> CSize -> CSize -> VkSystemAllocationScope -> IO (Ptr ())
Perhaps
type FNVkReallocationFunction =
     Ptr () ->
       Ptr () -> CSize -> CSize -> VkSystemAllocationScope -> IO (Ptr ())
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:346:1: Suggestion: Use camelCase
Found
type FN_vkFreeFunction = Ptr () -> Ptr () -> IO ()
Perhaps
type FNVkFreeFunction = Ptr () -> Ptr () -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:347:1: Suggestion: Use camelCase
Found
type FN_vkInternalAllocationNotification =
     Ptr () ->
       CSize ->
         VkInternalAllocationType -> VkSystemAllocationScope -> IO ()
Perhaps
type FNVkInternalAllocationNotification =
     Ptr () ->
       CSize ->
         VkInternalAllocationType -> VkSystemAllocationScope -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:348:1: Suggestion: Use camelCase
Found
type FN_vkInternalFreeNotification =
     Ptr () ->
       CSize ->
         VkInternalAllocationType -> VkSystemAllocationScope -> IO ()
Perhaps
type FNVkInternalFreeNotification =
     Ptr () ->
       CSize ->
         VkInternalAllocationType -> VkSystemAllocationScope -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:620:1: Suggestion: Use camelCase
Found
type FN_vkEnumeratePhysicalDevices =
     VkInstance -> Ptr Word32 -> Ptr VkPhysicalDevice -> IO Word32
Perhaps
type FNVkEnumeratePhysicalDevices =
     VkInstance -> Ptr Word32 -> Ptr VkPhysicalDevice -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:773:1: Suggestion: Use camelCase
Found
type FN_vkGetPhysicalDeviceProperties =
     VkPhysicalDevice -> Ptr VkPhysicalDeviceProperties -> IO ()
Perhaps
type FNVkGetPhysicalDeviceProperties =
     VkPhysicalDevice -> Ptr VkPhysicalDeviceProperties -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:836:1: Suggestion: Use camelCase
Found
type FN_vkGetPhysicalDeviceFeatures =
     VkPhysicalDevice -> Ptr VkPhysicalDeviceFeatures -> IO ()
Perhaps
type FNVkGetPhysicalDeviceFeatures =
     VkPhysicalDevice -> Ptr VkPhysicalDeviceFeatures -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:857:1: Suggestion: Use camelCase
Found
type FN_vkGetPhysicalDeviceQueueFamilyProperties =
     VkPhysicalDevice ->
       Ptr Word32 -> Ptr VkQueueFamilyProperties -> IO ()
Perhaps
type FNVkGetPhysicalDeviceQueueFamilyProperties =
     VkPhysicalDevice ->
       Ptr Word32 -> Ptr VkQueueFamilyProperties -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:868:1: Suggestion: Use camelCase
Found
type FN_vkGetDeviceProcAddr =
     VkDevice -> Ptr CChar -> IO (FunPtr (IO ()))
Perhaps
type FNVkGetDeviceProcAddr =
     VkDevice -> Ptr CChar -> IO (FunPtr (IO ()))
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:898:1: Suggestion: Use camelCase
Found
type FN_vkCreateDevice =
     VkPhysicalDevice ->
       Ptr VkDeviceCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkDevice -> IO Word32
Perhaps
type FNVkCreateDevice =
     VkPhysicalDevice ->
       Ptr VkDeviceCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkDevice -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:905:1: Suggestion: Use camelCase
Found
type FN_vkDestroyDevice =
     VkDevice -> Ptr VkAllocationCallbacks -> IO ()
Perhaps
type FNVkDestroyDevice =
     VkDevice -> Ptr VkAllocationCallbacks -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:915:1: Suggestion: Use camelCase
Found
type FN_vkGetDeviceQueue =
     VkDevice -> Word32 -> Word32 -> Ptr VkQueue -> IO ()
Perhaps
type FNVkGetDeviceQueue =
     VkDevice -> Word32 -> Word32 -> Ptr VkQueue -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:997:1: Suggestion: Use camelCase
Found
type FN_vkCreateImage =
     VkDevice ->
       Ptr VkImageCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkImage -> IO Word32
Perhaps
type FNVkCreateImage =
     VkDevice ->
       Ptr VkImageCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkImage -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1004:1: Suggestion: Use camelCase
Found
type FN_vkDestroyImage =
     VkDevice -> VkImage -> Ptr VkAllocationCallbacks -> IO ()
Perhaps
type FNVkDestroyImage =
     VkDevice -> VkImage -> Ptr VkAllocationCallbacks -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1071:1: Suggestion: Use camelCase
Found
type FN_vkCreateImageView =
     VkDevice ->
       Ptr VkImageViewCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkImageView -> IO Word32
Perhaps
type FNVkCreateImageView =
     VkDevice ->
       Ptr VkImageViewCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkImageView -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1078:1: Suggestion: Use camelCase
Found
type FN_vkDestroyImageView =
     VkDevice -> VkImageView -> Ptr VkAllocationCallbacks -> IO ()
Perhaps
type FNVkDestroyImageView =
     VkDevice -> VkImageView -> Ptr VkAllocationCallbacks -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1224:1: Suggestion: Use camelCase
Found
type FN_vkCreateRenderPass =
     VkDevice ->
       Ptr VkRenderPassCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkRenderPass -> IO Word32
Perhaps
type FNVkCreateRenderPass =
     VkDevice ->
       Ptr VkRenderPassCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkRenderPass -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1231:1: Suggestion: Use camelCase
Found
type FN_vkDestroyRenderPass =
     VkDevice -> VkRenderPass -> Ptr VkAllocationCallbacks -> IO ()
Perhaps
type FNVkDestroyRenderPass =
     VkDevice -> VkRenderPass -> Ptr VkAllocationCallbacks -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1256:1: Suggestion: Use camelCase
Found
type FN_vkCreateFramebuffer =
     VkDevice ->
       Ptr VkFramebufferCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkFramebuffer -> IO Word32
Perhaps
type FNVkCreateFramebuffer =
     VkDevice ->
       Ptr VkFramebufferCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkFramebuffer -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1263:1: Suggestion: Use camelCase
Found
type FN_vkDestroyFramebuffer =
     VkDevice -> VkFramebuffer -> Ptr VkAllocationCallbacks -> IO ()
Perhaps
type FNVkDestroyFramebuffer =
     VkDevice -> VkFramebuffer -> Ptr VkAllocationCallbacks -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1284:1: Suggestion: Use camelCase
Found
type FN_vkCreateShaderModule =
     VkDevice ->
       Ptr VkShaderModuleCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkShaderModule -> IO Word32
Perhaps
type FNVkCreateShaderModule =
     VkDevice ->
       Ptr VkShaderModuleCreateInfo ->
         Ptr VkAllocationCallbacks -> Ptr VkShaderModule -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1291:1: Suggestion: Use camelCase
Found
type FN_vkDestroyShaderModule =
     VkDevice -> VkShaderModule -> Ptr VkAllocationCallbacks -> IO ()
Perhaps
type FNVkDestroyShaderModule =
     VkDevice -> VkShaderModule -> Ptr VkAllocationCallbacks -> IO ()
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1669:1: Suggestion: Use camelCase
Found
type FN_vkCreateGraphicsPipelines =
     VkDevice ->
       VkPipelineCache ->
         Word32 ->
           Ptr VkGraphicsPipelineCreateInfo ->
             Ptr VkAllocationCallbacks -> Ptr VkPipeline -> IO Word32
Perhaps
type FNVkCreateGraphicsPipelines =
     VkDevice ->
       VkPipelineCache ->
         Word32 ->
           Ptr VkGraphicsPipelineCreateInfo ->
             Ptr VkAllocationCallbacks -> Ptr VkPipeline -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1678:1: Suggestion: Use camelCase
Found
type FN_vkCreateComputePipelines =
     VkDevice ->
       VkPipelineCache ->
         Word32 ->
           Ptr VkComputePipelineCreateInfo ->
             Ptr VkAllocationCallbacks -> Ptr VkPipeline -> IO Word32
Perhaps
type FNVkCreateComputePipelines =
     VkDevice ->
       VkPipelineCache ->
         Word32 ->
           Ptr VkComputePipelineCreateInfo ->
             Ptr VkAllocationCallbacks -> Ptr VkPipeline -> IO Word32
./flaw-vulkan/Flaw/Graphics/Vulkan/FFI.hs:1687:1: Suggestion: Use camelCase
Found
type FN_vkDestroyPipeline =
     VkDevice -> VkPipeline -> Ptr VkAllocationCallbacks -> IO ()
Perhaps
type FNVkDestroyPipeline =
     VkDevice -> VkPipeline -> Ptr VkAllocationCallbacks -> IO ()
./flaw-window/Flaw/Window/Sdl.hs:203:59: Error: Use readTVarIO
Found
atomically $ readTVar windowsVar
Perhaps
readTVarIO windowsVar
./flaw-build/Flaw/Build.hs:125:5: Suggestion: Reduce duplication
Found
av <- $( embedIOExp a )
bv <- $( embedIOExp b )
cv <- $( embedIOExp c )
Perhaps
Combine with ./flaw-build/Flaw/Build.hs:133:5
./flaw-bullet/Flaw/Physics/Bullet.hs:61:5: Suggestion: Reduce duplication
Found
position <- peek $ castPtr positionPtr
orientation <- peek $ castPtr orientationPtr
return $ QuatOffset (FloatQ orientation) position
Perhaps
Combine with ./flaw-bullet/Flaw/Physics/Bullet.hs:81:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:283:5: Suggestion: Reduce duplication
Found
srvInterface <- book bk $
                  allocateCOMObject $
                    with srvDesc $
                      \ srvDescPtr ->
                        createCOMObjectViaPtr $
                          m_ID3D11Device_CreateShaderResourceView deviceInterface
                            (pokeCOMObject resourceInterface)
                            srvDescPtr
releaseResourceInterface
samplerState <- book bk $
                  createSamplerState device samplerStateInfo
Perhaps
Combine with ./flaw-dx11/Flaw/Graphics/DirectX11.hs:552:5
./flaw-editor/Flaw/Editor/Entity/Basic.hs:362:5: Suggestion: Reduce duplication
Found
currentValueVar <- lift $ newTVar initialEntity
itemHandlesVar <- lift $ newTVar M.empty
FlowLayoutState{flsMetrics =
                  metrics@Metrics{metricsMainWidth = metricMainWidth}} <- get
Perhaps
Combine with ./flaw-editor/Flaw/Editor/Entity/Basic.hs:450:5
./flaw-editor/exe/model-editor.hs:370:5: Suggestion: Reduce duplication
Found
let v = undefined :: VertexPNT
aPosition <- vertexAttribute 0 0 $ vertexPositionAttribute v
aNormal <- vertexAttribute 0 0 $ vertexNormalAttribute v
Perhaps
Combine with ./flaw-editor/exe/model-editor.hs:398:5
./flaw-editor/exe/editor.hs:114:5: Suggestion: Reduce duplication
Found
windowPanel <- newPanel True
mainWindow <- newWindow window inputManager windowPanel
setWindowCloseHandler mainWindow $ writeTVar exitVar True
Perhaps
Combine with ./flaw-editor/exe/model-editor.hs:511:5
./flaw-editor/exe/model-editor.hs:850:11: Suggestion: Reduce duplication
Found
renderUniformStorage usObject
renderVertexBuffer 0 vbObject
renderIndexBuffer ibObject
Perhaps
Combine with ./flaw-editor/exe/model-editor.hs:886:11
./flaw-editor/exe/model-editor.hs:854:11: Suggestion: Reduce duplication
Found
renderUploadUniformStorage usObject
renderUniformStorage usObject
renderDraw icObject
Perhaps
Combine with ./flaw-editor/exe/model-editor.hs:899:11
./flaw-editor/exe/model-editor.hs:917:13: Suggestion: Reduce duplication
Found
renderUniform usLight uLightColor lightColor
renderUploadUniformStorage usLight
renderUniformStorage usLight
Perhaps
Combine with ./flaw-editor/exe/model-editor.hs:930:11
./flaw-editor/test/entity-test.hs:147:5: Suggestion: Reduce duplication
Found
verify (== 4) $ atomically $ readEntityVar intVar1
verify (== 5) $ atomically $ readEntityVar intVar2
clientWaitAndSync c1
Perhaps
Combine with ./flaw-editor/test/entity-test.hs:151:5
./flaw-gl/Flaw/Graphics/GlContext.hs:435:5: Suggestion: Reduce duplication
Found
textureName <- glAllocTextureName
glBindTexture GL_TEXTURE_2D textureName
glCheckErrors0 "bind texture"
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:473:5
./flaw-gl/Flaw/Graphics/GlContext.hs:564:5: Suggestion: Reduce duplication
Found
bufferName <- glAllocBufferName
glBindBuffer GL_ARRAY_BUFFER bufferName
glCheckErrors0 "bind buffer"
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:583:5
./flaw-gl/Flaw/Graphics/GlContext.hs:669:13: Suggestion: Reduce duplication
Found
glGetProgramiv programName GL_LINK_STATUS statusPtr
glCheckErrors0 "get program link status"
peek statusPtr
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:737:9
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1063:5: Warning: Reduce duplication
Found
oldFrameBuffer <- readIORef frameBufferRef
writeIORef frameBufferRef frameBuffer
r <- scope
writeIORef frameBufferRef oldFrameBuffer
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1067:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1074:5: Warning: Reduce duplication
Found
oldViewport <- readIORef viewportRef
writeIORef viewportRef viewport
r <- scope
writeIORef viewportRef oldViewport
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1078:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1091:5: Warning: Reduce duplication
Found
oldScissor <- readIORef scissorRef
writeIORef scissorRef scissor
r <- scope
writeIORef scissorRef oldScissor
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1095:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1108:5: Warning: Reduce duplication
Found
oldVertexBuffer <- VM.read vertexBuffersVector i
VM.write vertexBuffersVector i vertexBuffer
r <- scope
VM.write vertexBuffersVector i oldVertexBuffer
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1112:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1119:5: Warning: Reduce duplication
Found
oldIndexBuffer <- readIORef indexBufferRef
writeIORef indexBufferRef indexBuffer
r <- scope
writeIORef indexBufferRef oldIndexBuffer
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1123:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1130:5: Warning: Reduce duplication
Found
oldUniformBuffer <- VM.read uniformBuffersVector i
VM.write uniformBuffersVector i uniformBuffer
r <- scope
VM.write uniformBuffersVector i oldUniformBuffer
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1134:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1141:5: Warning: Reduce duplication
Found
oldSampler <- VM.read samplersVector i
VM.write samplersVector i (texture, samplerState)
r <- scope
VM.write samplersVector i oldSampler
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1145:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1152:5: Warning: Reduce duplication
Found
oldBlendState <- readIORef blendStateRef
writeIORef blendStateRef blendState
r <- scope
writeIORef blendStateRef oldBlendState
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1156:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1163:5: Warning: Reduce duplication
Found
oldDepthTestFunc <- readIORef depthTestFuncRef
writeIORef depthTestFuncRef depthTestFunc
r <- scope
writeIORef depthTestFuncRef oldDepthTestFunc
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1167:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1174:5: Warning: Reduce duplication
Found
oldDepthWrite <- readIORef depthWriteRef
writeIORef depthWriteRef depthWrite
r <- scope
writeIORef depthWriteRef oldDepthWrite
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1178:5
./flaw-dx11/Flaw/Graphics/DirectX11.hs:1185:5: Warning: Reduce duplication
Found
oldProgram <- readIORef programRef
writeIORef programRef program
r <- scope
writeIORef programRef oldProgram
return r
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GlContext.hs:1189:5
./flaw-gl-mesa/Flaw/Graphics/OpenGL/Mesa.hs:81:5: Suggestion: Reduce duplication
Found
writeIORef frameBufferRef
  GlFrameBufferId{glFrameBufferName = 0, glFrameBufferWidth = width,
                  glFrameBufferHeight = height}
writeIORef viewportRef $ Vec4 0 0 width height
r <- f
Perhaps
Combine with ./flaw-gl-sdl/Flaw/Graphics/OpenGL/Sdl.hs:119:5
./flaw-gl-mesa/Flaw/Graphics/OpenGL/Mesa.hs:81:5: Suggestion: Reduce duplication
Found
writeIORef frameBufferRef
  GlFrameBufferId{glFrameBufferName = 0, glFrameBufferWidth = width,
                  glFrameBufferHeight = height}
writeIORef viewportRef $ Vec4 0 0 width height
r <- f
Perhaps
Combine with ./flaw-gl-win32/Flaw/Graphics/OpenGL/Win32.hs:83:5
./flaw-graphics/Flaw/Graphics/Program.hs:176:3: Suggestion: Reduce duplication
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
./flaw-math/Flaw/Math.hs:441:7: Warning: Reduce duplication
Found
q <- newName "q"
s <- newName "s"
f <- newName "f"
h <- newName "h"
t <- newName "t"
Perhaps
Combine with ./flaw-math/Flaw/Math.hs:565:7
./flaw-editor/Flaw/Editor/ProcessingCache.hs:121:5: Suggestion: Reduce duplication
Found
sqliteBind query 1 key
sqliteBind query 2 value
sqliteFinalStep query
Perhaps
Combine with ./flaw-oil/Flaw/Oil/ClientRepo.hs:174:5
./flaw-editor/Flaw/Editor/ProcessingCache.hs:39:3: Suggestion: Reduce duplication
Found
db <- book bk $ sqliteDb fileName
sqliteExec db $ T.pack "PRAGMA locking_mode = EXCLUSIVE"
sqliteExec db $ T.pack "PRAGMA journal_mode = WAL"
Perhaps
Combine with ./flaw-oil/Flaw/Oil/Repo.hs:86:3
./flaw-editor/Flaw/Editor/ProcessingCache.hs:52:7: Suggestion: Reduce duplication
Found
r <- sqliteStep query
unless r $
  throwIO $ DescribeFirstException "failed to get application_id"
currentAppVersion <- sqliteColumn query 0
Perhaps
Combine with ./flaw-oil/Flaw/Oil/Repo.hs:97:7
./flaw-oil/test/repo-test.hs:231:5: Warning: Reduce duplication
Found
check b "k2" 0 ""
check b "k3" 0 ""
psp a
psp b
check a "k1" 1 "aaa111"
Perhaps
Combine with ./flaw-oil/test/repo-test.hs:239:5
./flaw-oil/test/repo-test.hs:240:5: Warning: Reduce duplication
Found
check b "k3" 0 ""
psp a
psp b
check a "k1" 1 "aaa111"
check a "k2" 2 "aaa222"
Perhaps
Combine with ./flaw-oil/test/repo-test.hs:248:5
./flaw-oil/test/repo-test.hs:267:5: Suggestion: Reduce duplication
Found
checkPrefixed a "k" ["k1", "k2"]
psp a
checkPrefixed a "k" ["k1", "k2"]
Perhaps
Combine with ./flaw-oil/test/repo-test.hs:271:5
./flaw-editor/Flaw/UI/RenderBox.hs:54:7: Suggestion: Reduce duplication
Found
size <- readTVar sizeVar
let Vec2 sx sy = size
return $ x < sx && y < sy
Perhaps
Combine with ./flaw-ui/Flaw/UI/Button.hs:85:7
./flaw-ui/Flaw/UI/Button.hs:148:11: Suggestion: Reduce duplication
Found
pressed <- readTVar pressedVar
when pressed $
  do click
     writeTVar pressedVar False
return True
Perhaps
Combine with ./flaw-ui/Flaw/UI/Button.hs:160:9
./flaw-editor/Flaw/UI/RenderBox.hs:54:7: Suggestion: Reduce duplication
Found
size <- readTVar sizeVar
let Vec2 sx sy = size
return $ x < sx && y < sy
Perhaps
Combine with ./flaw-ui/Flaw/UI/CheckBox.hs:69:7
./flaw-editor/Flaw/UI/RenderBox.hs:54:7: Suggestion: Reduce duplication
Found
size <- readTVar sizeVar
let Vec2 sx sy = size
return $ x < sx && y < sy
Perhaps
Combine with ./flaw-ui/Flaw/UI/Frame.hs:198:7
./flaw-editor/Flaw/UI/RenderBox.hs:54:7: Suggestion: Reduce duplication
Found
size <- readTVar sizeVar
let Vec2 sx sy = size
return $ x < sx && y < sy
Perhaps
Combine with ./flaw-ui/Flaw/UI/Frame.hs:228:7
./flaw-ui/Flaw/UI/Layout.hs:133:7: Suggestion: Reduce duplication
Found
sub <- subLayoutHandler $ Vec4 (px + labelWidth + gap) py qx qy
let Vec4 _subpx subpy _subqx subqy = sub
return $
  Vec4 px (max (py + labelHeight + gap) subpy) qx (min qy subqy)
Perhaps
Combine with ./flaw-ui/Flaw/UI/Layout.hs:174:7
./flaw-editor/Flaw/UI/RenderBox.hs:54:7: Suggestion: Reduce duplication
Found
size <- readTVar sizeVar
let Vec2 sx sy = size
return $ x < sx && y < sy
Perhaps
Combine with ./flaw-ui/Flaw/UI/ScrollBox.hs:152:5
./flaw-editor/Flaw/UI/RenderBox.hs:54:7: Suggestion: Reduce duplication
Found
size <- readTVar sizeVar
let Vec2 sx sy = size
return $ x < sx && y < sy
Perhaps
Combine with ./flaw-ui/Flaw/UI/Slider.hs:67:7
./flaw-ui/Flaw/UI/Button.hs:106:5: Suggestion: Reduce duplication
Found
size <- readTVar sizeVar
let Vec2 sx sy = size
focused <- readTVar focusedVar
Perhaps
Combine with ./flaw-ui/Flaw/UI/Slider.hs:87:5
./flaw-visual/Flaw/Visual/Geometry/Simplification.hs:317:7: Suggestion: Reduce duplication
Found
p <- VGM.unsafeRead pairHeap i
let m = (i - 1) `quot` 2
mp <- VGM.unsafeRead pairHeap m
Perhaps
Combine with ./flaw-visual/Flaw/Visual/Geometry/Simplification.hs:327:9
./flaw-visual/Flaw/Visual/Geometry/Vertex.hs:162:5: Suggestion: Reduce duplication
Found
positions <- cvdPositions verticesData
normals <- cvdNormals verticesData
texcoords <- fallbackVertexData count (Vec2 0 0) <$>
               cvdTexcoords verticesData
Perhaps
Combine with ./flaw-visual/Flaw/Visual/Geometry/Vertex.hs:199:5
./flaw-visual/Flaw/Visual/Pipeline/Deferred.hs:190:3: Suggestion: Reduce duplication
Found
(albedoOcclusion, material, viewNormal,
 depth) <- deferredPipelineLightPassInput $
             zw__ screenPositionTexcoord
let albedo = xyz__ albedoOcclusion
    diffuse = x_ material
    specular = y_ material
    metalness = zzz__ material
    glossiness = w_ material
viewPositionH <- temp $
                   invProj `mul` cvec211 (xy__ screenPositionTexcoord) depth 1
viewPosition <- temp $ xyz__ viewPositionH / www__ viewPositionH
Perhaps
Combine with ./flaw-visual/Flaw/Visual/Pipeline/Deferred.hs:224:3
./flaw-window/Flaw/Window/Sdl.hs:330:3: Suggestion: Reduce duplication
Found
resultVar <- newEmptyMVar
invokeWithMaybeResultVar (Just resultVar) ws io
result <- takeMVar resultVar
case result of
    Left e -> throwIO e
    Right r -> return r
Perhaps
Combine with ./flaw-window/Flaw/Window/Win32.hs:200:3
./flaw-window/Flaw/Window/Sdl.hs:69:5: Suggestion: Reduce duplication
Found
width <- peek widthPtr
height <- peek heightPtr
return (fromIntegral width, fromIntegral height)
Perhaps
Combine with ./flaw-window/Flaw/Window/Win32.hs:226:3
./flaw-dx11/Flaw/Graphics/DirectX11/HLSL.hs:396:5: Warning: Reduce duplication
Found
binaryOpSource :: Builder -> Node a -> Node b -> Builder
binaryOpSource op a b
  = "(" <> nodeSource a <> ") " <> op <> " (" <> nodeSource b <> ")"
func1Source :: Builder -> Node a -> Builder
func1Source func a = func <> "(" <> nodeSource a <> ")"
func2Source :: Builder -> Node a -> Node b -> Builder
func2Source func a b
  = func <> "(" <> nodeSource a <> ", " <> nodeSource b <> ")"
func3Source :: Builder -> Node a -> Node b -> Node c -> Builder
func3Source func a b c
  = func <>
      "(" <>
        nodeSource a <> ", " <> nodeSource b <> ", " <> nodeSource c <> ")"
func4Source ::
            Builder -> Node a -> Node b -> Node c -> Node d -> Builder
func4Source func a b c d
  = func <>
      "(" <>
        nodeSource a <>
          ", " <>
            nodeSource b <> ", " <> nodeSource c <> ", " <> nodeSource d <> ")"
Perhaps
Combine with ./flaw-gl/Flaw/Graphics/GLSL.hs:571:5
./flaw-math/Flaw/Math/Geometry.hs:62:3: Suggestion: Reduce duplication
Found
ha = angle * 0.5
sa = sin ha
ca = cos ha
r = Quat $ Vec4 (x * sa) (y * sa) (z * sa) ca
Perhaps
Combine with ./flaw-math/Flaw/Math/Transform.hs:68:3
./flaw-math/Flaw/Math/Geometry.hs:70:3: Warning: Reduce duplication
Found
ww = w * w
xx = x * x
yy = y * y
zz = z * z
wx2 = w * x * 2
wy2 = w * y * 2
wz2 = w * z * 2
xy2 = x * y * 2
xz2 = x * z * 2
yz2 = y * z * 2
Perhaps
Combine with ./flaw-math/Flaw/Math/Transform.hs:102:5
./flaw-math/Flaw/Math/Transform.hs:123:5: Warning: Reduce duplication
Found
k = sqrt (1 + m11 + m22 + m33)
kk = 0.5 / k
x = (m32 - m23) * kk
y = (m13 - m31) * kk
z = (m21 - m12) * kk
w = k * 0.5
Perhaps
Combine with ./flaw-math/Flaw/Math/Transform.hs:201:5
./flaw-visual/Flaw/Visual/Geometry/Simplification.hs:169:9: Suggestion: Reduce duplication
Found
i1 = indices VG.! (i * 3)
i2 = indices VG.! (i * 3 + 1)
i3 = indices VG.! (i * 3 + 2)
Perhaps
Combine with ./flaw-visual/Flaw/Visual/Geometry/Simplification.hs:200:11
./flaw-visual/Flaw/Visual/Pipeline/Deferred.hs:192:5: Warning: Reduce duplication
Found
albedo = xyz__ albedoOcclusion
diffuse = x_ material
specular = y_ material
metalness = zzz__ material
glossiness = w_ material
Perhaps
Combine with ./flaw-visual/Flaw/Visual/Pipeline/Deferred.hs:226:5