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
32eed1ae
Commit
32eed1ae
authored
Jun 20, 2014
by
Pietro Abate
Browse files
Add common printing functions
parent
0aab8a5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
misc/utils.ml
0 → 100644
View file @
32eed1ae
let
string_of_formatter
pp
t
=
Format
.
fprintf
Format
.
str_formatter
"%a"
pp
t
;
Format
.
flush_str_formatter
()
let
pp_list
?
(
delim
=
(
"["
,
"]"
))
?
(
sep
=
","
)
f
ppf
l
=
let
rec
aux
ppf
=
function
|
[]
->
Format
.
fprintf
ppf
""
|
[
h
]
->
Format
.
fprintf
ppf
"%a"
f
h
|
h
::
t
->
Format
.
fprintf
ppf
"%a%s%a"
f
h
sep
aux
t
in
match
l
with
|
[]
->
Format
.
fprintf
ppf
"%s%s"
(
fst
delim
)
(
snd
delim
)
|_
->
Format
.
fprintf
ppf
"%s%a%s"
(
fst
delim
)
aux
l
(
snd
delim
)
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