bollu/symengine.hs

View on GitHub
src/Symengine/Internal.hs

Summary

Maintainability
Test Coverage

Unused LANGUAGE pragma
Open

{-# LANGUAGE RecordWildCards #-}
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

{-# LANGUAGE RecordWildCards #-}

Perhaps

Applying this change:

  • may require {-# LANGUAGE DisambiguateRecordFields #-} adding to the top of the file

Use fewer imports
Open

import Control.Monad -- for foldM
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

import Control.Monad
import Control.Monad

Perhaps

import Control.Monad

Eta reduce
Open

throwOnSymIntException i = forceException . cIntToEnum $ i
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

throwOnSymIntException i = forceException . cIntToEnum $ i

Perhaps

throwOnSymIntException = forceException . cIntToEnum

Redundant as-pattern
Open

  error @ _ -> throwIO error
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

error@_

Perhaps

error

Redundant return
Open

mkForeignPtr cons des = do
  rawptr <- cons
  finalized <- newForeignPtr des rawptr
  return  finalized
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

do rawptr <- cons
   finalized <- newForeignPtr des rawptr
   return finalized

Perhaps

do rawptr <- cons
   newForeignPtr des rawptr

Redundant bracket
Open

mkForeignPtr :: (IO (Ptr a)) -> FunPtr (Ptr a -> IO ()) -> IO (ForeignPtr a)
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

(IO (Ptr a)) -> FunPtr (Ptr a -> IO ()) -> IO (ForeignPtr a)

Perhaps

IO (Ptr a) -> FunPtr (Ptr a -> IO ()) -> IO (ForeignPtr a)

Avoid lambda
Open

with2 o1 o2 f = with o1 (\p1 -> with o2 (\p2 -> f p1 p2))
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

\ p2 -> f p1 p2

Perhaps

f p1

Avoid lambda
Open

with3 o1 o2 o3 f = with2 o1 o2 (\p1 p2 -> with o3 (\p3 -> f p1 p2 p3))
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

\ p3 -> f p1 p2 p3

Perhaps

f p1 p2

Avoid lambda
Open

with4 o1 o2 o3 o4 f = with o1 (\p1 -> with3 o2 o3 o4 (\p2 p3 p4 -> f p1 p2 p3 p4))
Severity: Minor
Found in src/Symengine/Internal.hs by hlint

Found

\ p2 p3 p4 -> f p1 p2 p3 p4

Perhaps

f p1

There are no issues that match your filters.

Category
Status