Skip to content

Comments

Add some operator for Binary#302

Merged
emqplus merged 5 commits intohamler-lang:masterfrom
niltok:master
Jul 24, 2020
Merged

Add some operator for Binary#302
emqplus merged 5 commits intohamler-lang:masterfrom
niltok:master

Conversation

@niltok
Copy link
Contributor

@niltok niltok commented Jul 22, 2020

No description provided.


-- | Get Byte from Binary
at :: Integer -> Binary -> Integer -- TODO: exception?
at pos bin = ffi2 :binary :at bin pos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The args are unnecessary for FFI functions. Pls change to at = ffi2 :binary :at.

-- | Get Bytes from Binary
binToList :: Integer -> Integer -> Binary -> [Integer]
binToList start end bin = ffi3 :binary :bin_to_list bin start end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

binToList = ffi3 :binary :bin_to_list

binToList start end bin = ffi3 :binary :bin_to_list bin start end

duplicate :: Integer -> Binary -> Binary
duplicate n bin = ffi2 :binary :copy bin n
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplicate = ffi2 :binary :copy

@emqplus emqplus added this to the 0.2 - OTP Behaviours milestone Jul 24, 2020
@emqplus emqplus added the enhancement New feature or request label Jul 24, 2020
@emqplus emqplus self-assigned this Jul 24, 2020
@emqplus emqplus merged commit 600b6e9 into hamler-lang:master Jul 24, 2020
niltok added a commit to niltok/hamler that referenced this pull request Aug 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants