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

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)

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

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

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

Found

basic_from_integer :: Integer -> BasicSym

Perhaps

basicFromInteger :: Integer -> 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_obj_constructor init_fn = unsafePerformIO $ do
    basic_ptr <- create_basic_ptr
    withBasicSym basic_ptr init_fn
    return basic_ptr
Severity: Minor
Found in src/Symengine.hs by hlint

Found

basic_obj_constructor init_fn = ...

Perhaps

basicObjConstructor init_fn = ...

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

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

ascii_art_str :: IO String
Severity: Minor
Found in src/Symengine.hs by hlint

Found

ascii_art_str :: IO String

Perhaps

asciiArtStr :: IO String

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

Redundant bracket
Open

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

Found

(basic_binaryop complex_set_ffi) a

Perhaps

basic_binaryop complex_set_ffi a

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

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

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

Found

minus_one :: BasicSym

Perhaps

minusOne :: BasicSym

Use camelCase
Open

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

Found

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

Perhaps

basicUnaryop ::
  (Ptr BasicStruct -> Ptr BasicStruct -> IO ())
  -> BasicSym -> BasicSym
Severity
Category
Status
Source
Language