symengine/symengine.hs

View on GitHub

Showing 32 of 32 total issues

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)

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

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)

Use newtype instead of data
Open

data BasicSym = BasicSym { fptr :: ForeignPtr BasicStruct }
Severity: Minor
Found in src/Symengine.hs by hlint

Found

data BasicSym = BasicSym {fptr :: ForeignPtr BasicStruct}

Perhaps

newtype BasicSym = BasicSym {fptr :: ForeignPtr BasicStruct}

Applying this change:

  • decreases laziness

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_from_integer i = unsafePerformIO $ do
    iptr <- create_basic_ptr
    withBasicSym iptr (\iptr -> integer_set_si_ffi iptr (fromInteger i))
    return iptr
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_from_integer i = ...

Perhaps

basicFromInteger i = ...

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

Avoid lambda
Open

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

Found

\ p3 -> f p1 p2 p3

Perhaps

f p1 p2

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_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_rational_from_integer :: Integer -> Integer -> BasicSym
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_rational_from_integer :: Integer -> Integer -> BasicSym

Perhaps

basicRationalFromInteger :: Integer -> Integer -> BasicSym

Use camelCase
Open

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

Found

minus_one :: BasicSym

Perhaps

minusOne :: BasicSym

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 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

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

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

Found

ascii_art_str = ...

Perhaps

asciiArtStr = ...

Use camelCase
Open

create_basic_ptr = do
    basic_ptr <- newArray [BasicStruct { data_ptr = nullPtr }]
    basic_new_heap_ffi basic_ptr
    finalized_ptr <- newForeignPtr ptr_basic_free_heap_ffi basic_ptr
    return $ BasicSym { fptr = finalized_ptr }
Severity: Minor
Found in src/Symengine.hs by hlint

Found

create_basic_ptr = ...

Perhaps

createBasicPtr = ...

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

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_from_integer :: Integer -> BasicSym
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_from_integer :: Integer -> BasicSym

Perhaps

basicFromInteger :: Integer -> BasicSym
Severity
Category
Status
Source
Language