symengine/symengine.hs

View on GitHub

Showing 32 of 32 total issues

Eta reduce
Open

diff expr symbol = (basic_binaryop basic_diff_ffi) expr symbol
Severity: Minor
Found in src/Symengine.hs by hlint

Found

diff expr symbol = (basic_binaryop basic_diff_ffi) expr symbol

Perhaps

diff = (basic_binaryop basic_diff_ffi)

Eta reduce
Open

withBasicSym p f = withForeignPtr (fptr p ) f
Severity: Minor
Found in src/Symengine.hs by hlint

Found

withBasicSym p f = withForeignPtr (fptr p) f

Perhaps

withBasicSym p = withForeignPtr (fptr p)

Eta reduce
Open

complex a b = (basic_binaryop complex_set_ffi) a b
Severity: Minor
Found in src/Symengine.hs by hlint

Found

complex a b = (basic_binaryop complex_set_ffi) a b

Perhaps

complex = (basic_binaryop complex_set_ffi)

Use camelCase
Open

basic_str :: BasicSym -> String
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_str :: BasicSym -> String

Perhaps

basicStr :: BasicSym -> String

Use camelCase
Open

basic_str basic_ptr = unsafePerformIO $ withBasicSym basic_ptr (basic_str_ffi >=> peekCString)
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_str basic_ptr = ...

Perhaps

basicStr basic_ptr = ...

Use camelCase
Open

basic_int_signed :: Int -> BasicSym
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_int_signed :: Int -> BasicSym

Perhaps

basicIntSigned :: Int -> BasicSym

Use camelCase
Open

basic_unaryop f a = unsafePerformIO $ do
    s <- create_basic_ptr
    withBasicSym2 s a f
    return s 
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_unaryop f a = ...

Perhaps

basicUnaryop f a = ...

Avoid lambda
Open

withBasicSym2 p1 p2 f = withBasicSym p1 (\p1 -> withBasicSym p2 (\p2 -> f p1 p2))
Severity: Minor
Found in src/Symengine.hs by hlint

Found

\ p2 -> f p1 p2

Perhaps

f p1

Use camelCase
Open

create_basic_ptr :: IO BasicSym
Severity: Minor
Found in src/Symengine.hs by hlint

Found

create_basic_ptr :: IO BasicSym

Perhaps

createBasicPtr :: IO BasicSym

Use camelCase
Open

basic_obj_constructor :: (Ptr BasicStruct -> IO ()) -> BasicSym
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_obj_constructor :: (Ptr BasicStruct -> IO ()) -> BasicSym

Perhaps

basicObjConstructor :: (Ptr BasicStruct -> IO ()) -> BasicSym

Use camelCase
Open

basic_int_signed i = unsafePerformIO $ do
    iptr <- create_basic_ptr
    withBasicSym iptr (\iptr -> integer_set_si_ffi iptr (intToCLong i) )
    return iptr
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_int_signed i = ...

Perhaps

basicIntSigned i = ...

Use camelCase
Open

basic_binaryop f a b = unsafePerformIO $ do
    s <- create_basic_ptr
    withBasicSym3 s a b f
    return s 
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_binaryop f a b = ...

Perhaps

basicBinaryop f a b = ...

Use camelCase
Open

basic_pow :: BasicSym -> BasicSym -> BasicSym
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_pow :: BasicSym -> BasicSym -> BasicSym

Perhaps

basicPow :: BasicSym -> BasicSym -> BasicSym

Use camelCase
Open

minus_one :: BasicSym
Severity: Minor
Found in src/Symengine.hs by hlint

Found

minus_one :: BasicSym

Perhaps

minusOne :: BasicSym

Use newtype instead of data
Open

data BasicStruct = BasicStruct {
    data_ptr :: Ptr ()
}
Severity: Minor
Found in src/Symengine.hs by hlint

Found

data BasicStruct = BasicStruct {data_ptr :: Ptr ()}

Perhaps

newtype BasicStruct = BasicStruct {data_ptr :: Ptr ()}

Applying this change:

  • decreases laziness

Redundant bracket
Open

diff expr symbol = (basic_binaryop basic_diff_ffi) expr symbol
Severity: Minor
Found in src/Symengine.hs by hlint

Found

(basic_binaryop basic_diff_ffi) expr

Perhaps

basic_binaryop basic_diff_ffi expr

Use camelCase
Open

basic_binaryop :: (Ptr BasicStruct -> Ptr BasicStruct -> Ptr BasicStruct -> IO ()) -> BasicSym -> BasicSym -> BasicSym
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_binaryop ::
  (Ptr BasicStruct -> Ptr BasicStruct -> Ptr BasicStruct -> IO ())
  -> BasicSym -> BasicSym -> BasicSym

Perhaps

basicBinaryop ::
  (Ptr BasicStruct -> Ptr BasicStruct -> Ptr BasicStruct -> IO ())
  -> BasicSym -> BasicSym -> BasicSym

Use camelCase
Open

basic_pow = basic_binaryop basic_pow_ffi
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_pow = ...

Perhaps

basicPow = ...

Use camelCase
Open

minus_one = basic_obj_constructor basic_const_minus_one_ffi
Severity: Minor
Found in src/Symengine.hs by hlint

Found

minus_one = ...

Perhaps

minusOne = ...

Use camelCase
Open

ascii_art_str = ascii_art_str_ffi >>= peekCString
Severity: Minor
Found in src/Symengine.hs by hlint

Found

ascii_art_str = ...

Perhaps

asciiArtStr = ...
Severity
Category
Status
Source
Language