Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
POTTIER Francois
menhir
Commits
cc08be06
Commit
cc08be06
authored
Nov 20, 2020
by
POTTIER Francois
Browse files
Add [Misc.list_make].
parent
1f7802d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/misc.ml
View file @
cc08be06
...
...
@@ -416,3 +416,6 @@ let array_for_all2 p l1 l2 =
else
if
p
(
Array
.
unsafe_get
l1
i
)
(
Array
.
unsafe_get
l2
i
)
then
loop
(
succ
i
)
else
false
in
loop
0
let
rec
list_make
n
x
=
if
n
=
0
then
[]
else
x
::
list_make
(
n
-
1
)
x
src/misc.mli
View file @
cc08be06
...
...
@@ -190,3 +190,7 @@ val nth: int -> string
val
array_for_all
:
(
'
a
->
bool
)
->
'
a
array
->
bool
val
array_for_all2
:
(
'
a
->
'
b
->
bool
)
->
'
a
array
->
'
b
array
->
bool
(* [List.make] *)
val
list_make
:
int
->
'
a
->
'
a
list
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment