Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Keystone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Third Party Mirrors
Keystone
Commits
618ce063
Commit
618ce063
authored
8 years ago
by
Nguyen Anh Quynh
Browse files
Options
Downloads
Plain Diff
Merge pull request #184 from adrianherrera/improvement/haskell-fixes
Minor updates
parents
0d95ba5b
74f3916a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bindings/haskell/samples/Sample.hs
+4
-4
4 additions, 4 deletions
bindings/haskell/samples/Sample.hs
bindings/haskell/src/Keystone/Internal/Util.hs
+0
-6
0 additions, 6 deletions
bindings/haskell/src/Keystone/Internal/Util.hs
with
4 additions
and
10 deletions
bindings/haskell/samples/Sample.hs
+
4
−
4
View file @
618ce063
...
...
@@ -15,12 +15,12 @@ testKs :: Architecture
->
String
->
Maybe
OptionValue
->
IO
()
testKs
arch
mode
assembly
s
yntax
=
do
testKs
arch
mode
assembly
maybeS
yntax
=
do
result
<-
runAssembler
$
do
ks
<-
open
arch
mode
case
s
yntax
of
Just
syn
->
option
ks
OptSyntax
syn
Nothing
->
return
()
case
maybeS
yntax
of
Just
syn
tax
->
option
ks
OptSyntax
syn
tax
Nothing
->
return
()
(
encode
,
count
)
<-
assemble
ks
assembly
Nothing
return
(
encode
,
count
)
case
result
of
...
...
This diff is collapsed.
Click to expand it.
bindings/haskell/src/Keystone/Internal/Util.hs
+
0
−
6
View file @
618ce063
...
...
@@ -7,18 +7,12 @@ License : GPL-2
module
Keystone.Internal.Util
where
import
Data.Bits
import
Foreign
-- | Combine a list of Enums by performing a bitwise-OR.
combineEnums
::
(
Enum
a
,
Num
b
,
Bits
b
)
=>
[
a
]
->
b
combineEnums
=
foldr
((
.|.
)
<$>
enumToNum
)
0
-- | Cast a pointer and then peek inside it.
castPtrAndPeek
::
Storable
a
=>
Ptr
b
->
IO
a
castPtrAndPeek
=
peek
.
castPtr
-- | Convert an 'Eum' to a 'Num'.
enumToNum
::
(
Enum
a
,
Num
b
)
=>
a
->
b
enumToNum
=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment