Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cduce
cduce
Commits
1b09a292
Commit
1b09a292
authored
Aug 19, 2014
by
Pietro Abate
Browse files
Add mem function to SortedList.Map
parent
1c8eaf3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
types/sortedList.ml
View file @
1b09a292
...
...
@@ -243,6 +243,12 @@ module Make(X : Custom.T) = struct
let
add
x
v
=
union_disj
[(
x
,
v
)]
let
rec
mem
x
l
=
match
l
with
|
[]
->
false
|
(
t
,_
)
::
q
->
let
c
=
X
.
compare
x
t
in
(
c
=
0
)
||
((
c
>
0
)
&&
(
mem
x
q
))
let
rec
diff
l1
l2
=
match
(
l1
,
l2
)
with
...
...
types/sortedList.mli
View file @
1b09a292
...
...
@@ -33,6 +33,7 @@ sig
type
'
a
map
external
get
:
'
a
map
->
(
X
.
t
*
'
a
)
list
=
"%identity"
val
add
:
X
.
t
->
'
a
->
'
a
map
->
'
a
map
val
mem
:
X
.
t
->
'
a
map
->
bool
val
length
:
'
a
map
->
int
val
domain
:
'
a
map
->
t
val
restrict
:
'
a
map
->
t
->
'
a
map
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment