nicoo has quit [Remote host closed the connection]
nicooo has joined #ocaml
pierpa has quit [Read error: Connection reset by peer]
Flerex has joined #ocaml
pierpa has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
orbifx has quit [Ping timeout: 258 seconds]
sh0t has quit [Remote host closed the connection]
P4Titan has joined #ocaml
<P4Titan>
Hi all
<P4Titan>
I have a let statement in the top level that takes no arguments
<P4Titan>
inside, it references a reference that is set in main
<P4Titan>
is there a way to keep this let statement from evaluating before main?
<P4Titan>
as I have it above the "let main" block
wtetzner has joined #ocaml
<theblatte>
P4Titan: you can either move it below "let main", or change it to let foo () = <your value> and call foo () instead of foo, or change it to let foo = lazy ... and use Lazy.force foo
<P4Titan>
hmm, ok
<P4Titan>
I did it the let foo (), but was curious if there were a better way
<P4Titan>
more ocaml-esque
<P4Titan>
Thanks nonetheless!
<P4Titan>
b
silver has quit [Read error: Connection reset by peer]
wtetzner has quit [Remote host closed the connection]
al-damiri has quit [Quit: Connection closed for inactivity]
pierpa has quit [Remote host closed the connection]
rcabaco has joined #ocaml
FreeBirdLjj has joined #ocaml
rcabaco has quit [Ping timeout: 240 seconds]
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jimt_ is now known as jimt
wu_ng has quit [Ping timeout: 248 seconds]
nicooo is now known as nicoo
<mankyKitty>
new to OCaml, do people have a preferred package for creating REST Apis in OCaml?
wu_ng has joined #ocaml
AlfredENeuman has joined #ocaml
obadz has joined #ocaml
smondet has joined #ocaml
obadz has quit [Read error: Connection reset by peer]
omongo has quit [Quit: Leaving]
tmtwd has quit [Ping timeout: 255 seconds]
tmtwd has joined #ocaml
nkhodyunya has joined #ocaml
nkhodyunya has quit [Quit: Leaving.]
nkhodyunya has joined #ocaml
trepta has joined #ocaml
tmtwd has quit [Ping timeout: 258 seconds]
tmtwd has joined #ocaml
snhmib has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ocaml
* mankyKitty
waits the eight to twelve hours for the rest of the OCaml community to be awake... #southernhermisphereproblems >.>
snhmib has joined #ocaml
mfp has quit [Ping timeout: 248 seconds]
<shon>
Hey mankyKitty
<shon>
Unfortunately I have nothing to relevant to say about REST Api packages...
FreeBirdLjj has quit [Remote host closed the connection]
snhmib has quit [Ping timeout: 252 seconds]
tmtwd has quit [Ping timeout: 256 seconds]
ygrek has quit [Ping timeout: 245 seconds]
kamog has joined #ocaml
<mankyKitty>
Hey shon :)
<mankyKitty>
No wukkas, I'm a complete OCaml nubbins, just planning ahead
<shon>
"Australian slang for worries"?
<shon>
I'm quite new to OCaml as well.
tmtwd has joined #ocaml
snhmib has joined #ocaml
<Algebr``>
mankyKitty: I think there was webmachine
<mankyKitty>
Algebr``: that was one I stumbled on in random searchings... just curious if there were any strong opinions about it from people that might have used them in anger
<mankyKitty>
shon: basically, yeah. :)
<Algebr``>
I tried it, felt it was too complicated for me, gave up, but it looks good
<shon>
Algebr``: Did you end up using something else, something simpler, to the same end?
wtetzner has joined #ocaml
<Algebr``>
no
FreeBirdLjj has joined #ocaml
wtetzner has quit [Remote host closed the connection]
jao has quit [Ping timeout: 240 seconds]
jackweirdy has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
snhmib has quit [Ping timeout: 258 seconds]
ryanartecona has joined #ocaml
rcabaco has joined #ocaml
MercurialAlchemi has joined #ocaml
rcabaco has quit [Ping timeout: 258 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
snhmib has joined #ocaml
P4Titan has quit [Remote host closed the connection]
tmtwd has quit [Ping timeout: 245 seconds]
pierpa has joined #ocaml
snhmib has quit [Ping timeout: 255 seconds]
kareeeeem has joined #ocaml
jackweirdy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jackweirdy has joined #ocaml
snhmib has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<Algebr``>
started on this hacky tool to look at the docs in terminal or just opening the browser for you https://github.com/fxfactorial/berber, basically no one installs docs correctly...
pierpa has quit [Ping timeout: 258 seconds]
<Leonidas>
mankyKitty: i liked using ocaml-webmachine
<Leonidas>
since I waa coming from clojure-liberator it was a good fit, quite happy with it. forced me to learn a bit about objects
<mankyKitty>
Leonidas: cool, ta
FreeBirdLjj has quit [Remote host closed the connection]
<beginner>
does the ocaml compiler check that the exceptions caught in a try .. with exc1.. | excN .. are actually possible?
<dmbaturin>
beginner: No.
mrallen1 has quit [Ping timeout: 255 seconds]
yunxing has quit [Ping timeout: 255 seconds]
jyc has quit [Ping timeout: 255 seconds]
dch has quit [Ping timeout: 255 seconds]
<beginner>
dmbaturin: So i could basically match with anything as long as it is an exception?
jackweirdy has quit [Ping timeout: 255 seconds]
edwin has quit [Ping timeout: 255 seconds]
frug72 has quit [Ping timeout: 255 seconds]
vinoski has quit [Ping timeout: 255 seconds]
yminsky has quit [Ping timeout: 255 seconds]
Algebr`` has quit [Ping timeout: 255 seconds]
cyraxjoe has quit [Ping timeout: 255 seconds]
mbrock has quit [Ping timeout: 255 seconds]
cschneid_ has quit [Ping timeout: 255 seconds]
Jaxan has quit [Ping timeout: 255 seconds]
<dmbaturin>
beginner: Yes. Note that it will not warn you about unhandled exceptions anywhere either.
Jaxan has joined #ocaml
cyraxjoe has joined #ocaml
jnavila has joined #ocaml
<dmbaturin>
If you want possible errors impossible to not handle, use option or result type.
<dmbaturin>
Or a custom sum type, for that matter.
yminsky has joined #ocaml
dch has joined #ocaml
yunxing has joined #ocaml
mbrock has joined #ocaml
mrallen1 has joined #ocaml
cschneid has joined #ocaml
edwin has joined #ocaml
frug72 has joined #ocaml
jyc has joined #ocaml
vinoski has joined #ocaml
<beginner>
dmbaturin: Is that impossible for the compiler or whats the reason behind not being able to check for possible exceptions?
<dmbaturin>
Well, it's a rather complex problem. First, you'd need to look quite deep into all functions that will be called to see what's really possible (e.g. you have foo x |> bar |> baz where foo may raise FooExn and BarExn, and bar handles BarExn but not FooExn... you get the idea).
snhmib has quit [Ping timeout: 258 seconds]
<dmbaturin>
There are prototypes of languages that want you to declare effects of functions and can track them, it may be the future.
<dmbaturin>
Search for "algebraic effects".
<beginner>
dmbaturin: i heard of algebraic effects only in the context of ocaml multicore
jackweirdy has joined #ocaml
alfredo has joined #ocaml
cschneid has quit [Ping timeout: 255 seconds]
jnavila_ has joined #ocaml
frug72 has quit [Ping timeout: 255 seconds]
jnavila has quit [Ping timeout: 255 seconds]
snhmib has joined #ocaml
jackweirdy has quit [Ping timeout: 255 seconds]
jyc has quit [Ping timeout: 255 seconds]
kareeeeem has quit [Quit: Connection closed for inactivity]
cschneid has joined #ocaml
frug72 has joined #ocaml
jyc has joined #ocaml
<ocaml717>
let grid = makegrid in match grid with | Some(gridzipper) -> left gridzipper;;
<ocaml717>
Error: This variant pattern is expected to have type cell CCList.t CCList.t The constructor Some does not belong to type list
<ocaml717>
I was thinking CCList is List
<flux>
mankykitty, I've used cohttp, yojson and ppx_deriving_yojson
<flux>
mankykitty, I've actually written one rest client at 2015. it doesn't work anymore because the service doesn't exist, but I was pretty happy how it turned out: https://github.com/eras/telkkarista-dl
<mankyKitty>
flux: is that for a server? How was it?
<flux>
that is a client-side thing, but the same principle I would say would work the same for the server
<flux>
I think cohttp comes with server side as well, but I haven't used it
<flux>
mankykitty, of particular interest there is API.ml, endpoints.mli and endpoints.ml, I think
<flux>
it is perhaps overly tricky making use of GADTs but it was fun.. :)
<ocaml717>
What is the OCaml graphics library to print a list of list of records ? A value in the record is used to change color.
<flux>
you want to make a bitmap, a vector file, a GUI?
<flux>
or a website?
<flux>
I think the easiest is probably just hand-generating HTML :)
<ocaml717>
GUI that updates. Not web.
<ocaml717>
I am used to JavaFX and event listeners. Something similar here.
<flux>
I guess your best bet might be lablgtk.
<flux>
an interesting bet is also lablqt, but I don't know its status. I think it might not be as complete as lablgtk.
<flux>
looking back at that telkkarista-dl I'm sort of amazed how big amount of API it supported with so little code, with a featureful command line support as well. could be one of the best ocaml programs I've written.. :)
larhat has joined #ocaml
<flux>
maybe one day I'll write a telkkarista server clone and I can just use the same API/endpoints definitions for the server!
<flux>
in other news I fixed the memory problems in my matomatikki. I added MemoryLimit=500M to matomatikki.service :)
Mercuria1Alchemi has quit [Ping timeout: 258 seconds]
<ocaml717>
OCaml has no simple graphics package ? lablgtk is 'c' ?
<ocaml717>
Anything similar to show in Haskell ?
snhmib has quit [Ping timeout: 240 seconds]
AltGr has joined #ocaml
ggole has joined #ocaml
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 240 seconds]
snhmib has joined #ocaml
<flux>
ie. Batteries has Std.dump for debugging purposes
<flux>
ppx_deriving gives automatic show function that's probably suitable for your purposes
<flux>
ppx_deriving creates show functions for records
<ocaml717>
Ok
sh0t has joined #ocaml
shepi has joined #ocaml
<shepi>
hi!
FreeBirdLjj has quit [Remote host closed the connection]
snhmib has quit [Ping timeout: 240 seconds]
shepi has left #ocaml [#ocaml]
freusque has quit [Quit: WeeChat 1.6]
ggole__ has joined #ocaml
orbifx-m has joined #ocaml
kakadu has joined #ocaml
Mercuria1Alchemi has joined #ocaml
snhmib has joined #ocaml
orbifx-m has quit [Remote host closed the connection]
freusque has joined #ocaml
ggole_ has quit [Ping timeout: 258 seconds]
ggole_ has joined #ocaml
orbifx-m has joined #ocaml
orbifx-m has quit [Client Quit]
ggole__ has quit [Ping timeout: 248 seconds]
orbifx-m has joined #ocaml
dhil has joined #ocaml
freusque has quit [Quit: WeeChat 1.6]
silver has joined #ocaml
freusque has joined #ocaml
octachron has joined #ocaml
<companion_cube>
ho!
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
ltadeu has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
rcabaco has joined #ocaml
larhat has quit [Quit: Leaving.]
Algebr`` has joined #ocaml
larhat has joined #ocaml
ggole__ has joined #ocaml
ggole_ has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
ggole_ has joined #ocaml
kareeeeem has joined #ocaml
ggole__ has quit [Ping timeout: 255 seconds]
_andre has joined #ocaml
octachron has quit [Ping timeout: 260 seconds]
ggole_ has quit [Ping timeout: 260 seconds]
ggole_ has joined #ocaml
<Algebr``>
no ones actually installs docs to their proper place
<companion_cube>
more people install .cmt{,i} though
<Algebr``>
go to ~/.opam/<switch>
<Algebr``>
find . -name index.html
<companion_cube>
(which are usable from ocp-browser)
<Algebr``>
but it doesn't have the valuable comments
<companion_cube>
it does have the (** *)
<Algebr``>
oh right it does
<companion_cube>
Algebr``: I think the lack of html doc is partly caused by the absence of warnings in `opam lint` when no `build-doc` is defined
<companion_cube>
at least for me
<Algebr``>
companion_cube: ditto, I didn't know about it
alienbot has quit [Remote host closed the connection]
<Algebr``>
opam lint should make it default and it should warn in opam PRs
<companion_cube>
possibly so indeed
sepp2k has joined #ocaml
mfp has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ has joined #ocaml
infinity0 has quit [Killed (orwell.freenode.net (Nickname regained by services))]
ggole has joined #ocaml
ggole_ has quit [Ping timeout: 252 seconds]
infinity0 has joined #ocaml
<Algebr``>
companion_cube: I'm gonna hit up more places to look
<Algebr``>
for docs
<Drup>
Algebr``: isn't your thing completely subsummed by odig ?
infinity0 has quit [Remote host closed the connection]
Mercuria1Alchemi has joined #ocaml
infinity0 has joined #ocaml
<Algebr``>
didn't know about odig
<Algebr``>
:)
<Algebr``>
well puts an end to that
<dmbaturin>
In ocamllex, what's the simplest way to allow both single quoted and double quoted strings (i.e. can I avoid duplicating the whole mutually recursive function for reading a string into lexbuf just for different terminating character?).
infinity0 has quit [Remote host closed the connection]
<Drup>
The value of making a basic state of the art before starting a project ...
<Algebr``>
and now learned about bos
infinity0 has joined #ocaml
<Drup>
and odoc ? :)
ggole has quit [Ping timeout: 240 seconds]
<Algebr``>
odig is amazing
Flerex has joined #ocaml
infinity0 has quit [Remote host closed the connection]
<Algebr``>
Bunzli is an amazing programmer
MercurialAlchemi has quit [Ping timeout: 256 seconds]
infinity0 has joined #ocaml
MercurialAlchemi has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
wu_ng has quit [Remote host closed the connection]
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Flerex has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
<jstolarek>
I am writing opam installation script and I want to copy a bunch of files, so I say:
<jstolarek>
[ "cp" "foo/*.bar" "baz" ]
<jstolarek>
and I'm getting
<jstolarek>
cp: cannot stat 'foo/*.bar': No such file or directory
<jstolarek>
obviously, running the same command in package root succeeds
ocaml717 has quit [Quit: Page closed]
<flux>
well, not really. it's running 'cp' 'foo/*.bar' 'baz' which I expect fails ;)
<flux>
actually that's a guess, not a fact :)
<jstolarek>
hm
<jstolarek>
let me test
<jstolarek>
flux: nope
<jstolarek>
I have other cp commands that work
<jstolarek>
my guess is that the reason is the use of wildcard pattern
<flux>
I was actually trying to say the same thing but differently
<flux>
'*' stops wildcard expansion in shell
FreeBirdLjj has joined #ocaml
<jstolarek>
hm
<jstolarek>
how do I use a wildcard then>
<jstolarek>
?
<flux>
sorry, I don't know if there's a solution.
<flux>
probably by not using them and instead listing the file explicitly
<flux>
alternatively look into opam documentation if it suggests an alternative, or make a github issue to it
<reynir>
jstolarek: I don't think opam does expansion
freusque has quit [Ping timeout: 256 seconds]
<flux>
an opam'ish solution would probably be something like in my imaginary syntax [ "cp" [ "glob" "foo/*.bar" ] "baz" ]
kareeeeem has quit [Quit: Connection closed for inactivity]
dhil has quit [Ping timeout: 255 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
myst|fon has joined #ocaml
_y has quit [Ping timeout: 248 seconds]
tobiasBora has quit [Ping timeout: 248 seconds]
_y has joined #ocaml
tobiasBora has joined #ocaml
smondet has quit [Ping timeout: 255 seconds]
jnavila_ has quit [Ping timeout: 240 seconds]
<jstolarek>
reynir: that works. Thanks!
nicoo has quit [Remote host closed the connection]
<flux>
I actually thought of that, but does that work in Windows?
<flux>
though I guess it doesn't matter for 99% of opam users ;-)
<flux>
but could be mighty annoying for the remaining 1%
dhil has joined #ocaml
<jstolarek>
flux: that's not a problem. Our software doesn't even run on Windows, so I'm not overly concerned about installation being broken on that platform :-)
nicoo has joined #ocaml
jnavila_ has joined #ocaml
ciniglio has joined #ocaml
omongo has joined #ocaml
yomimono has joined #ocaml
freusque has joined #ocaml
jao has joined #ocaml
smondet has joined #ocaml
omongo_ has joined #ocaml
omongo has quit [Read error: Connection reset by peer]
yomimono has quit [Ping timeout: 240 seconds]
copy` has joined #ocaml
yomimono has joined #ocaml
xorpse has joined #ocaml
omongo_ has quit [Quit: Leaving]
beginner has quit [Remote host closed the connection]
lucybun has quit [Read error: Connection reset by peer]
shinnya has joined #ocaml
lucybun has joined #ocaml
Mercuria1Alchemi has joined #ocaml
al-damiri has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]
jao has quit [Ping timeout: 240 seconds]
th5 has joined #ocaml
lucybun has quit [Remote host closed the connection]
lucybun has joined #ocaml
shinnya has quit [Ping timeout: 255 seconds]
lucybun has quit [Remote host closed the connection]
lucybun has joined #ocaml
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<dhil>
does anyone know whether the implementations of 'strings' and 'bytes' differ with '-safe-string' enabled? I am wondering whether I can use the definition of 'String_val' from 'mlvalues.h' to convert a value representing a term of type 'bytes' to a C character array.
larhat has joined #ocaml
<thizanne>
dhil: last time I checked, they did not, but there was plan to implement strings in a different (and immutable) way
<dhil>
thizanne: ok, thanks.
govg has joined #ocaml
tane has joined #ocaml
Algebr`` has quit [Ping timeout: 255 seconds]
orbifx has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
<orbifx>
is it possible to expand a record type, without having to re-write all the fields again?
kakadu has joined #ocaml
<flux>
find location with merlin, copy paste.. ?-)
<cheater>
hey guys
<cheater>
how can i match against a list?
<cheater>
i want to match against a list and if it's empty then return one thing, and if it has something return some other thing
<cheater>
so in haskell i'd do case l of { [] -> []; x:_ -> x }
<cheater>
so if l is empty i return an empty list, and if it's not empty i return the first element which is also going to be a list
<orbifx>
flux: I want it to be dependant
tane has quit [Ping timeout: 260 seconds]
_andre has quit [Quit: leaving]
jnavila has joined #ocaml
polyguy has joined #ocaml
orbifx has quit [Quit: WeeChat 1.6]
<cheater>
also btw, how can i fold over a Hashtbl so that for each key i only get the latest binding? I don't need old bindings
<cheater>
in fact i find it weird that Hashtbl allows me to access old bindings, why is that? is there a hash table that doesn't do that that i should be using?
<flux>
orbitz, you want to use the syntax type a = b = { c : d } without repeating the fields?
<flux>
orbitz, I recall some ppx is able to to that by reading .cmi..
<flux>
cheater, I guess you should use Hashtbl.replace instead of Hashtbl.add
<flux>
cheater, I imagine Hashtbl is written that way for some compiler writing reason..
<cheater>
aha
<orbitz>
wrong orbitz! :)
<cheater>
flux any idea about the list matching syntax?
<cheater>
is this even possible in OCaml?
<flux>
oh :)
<cheater>
orbitz: haha :)
<flux>
cheater, match l with [] -> [] | x::_ -> x ?
<cheater>
ohh
<cheater>
ok
<cheater>
thank you!!
<cheater>
i didn't know where to find this syntax, i searched google fruitlessly.
soupault has joined #ocaml
<soupault>
hello chat
<flux>
cheater, maybe reading some ocaml material in order rather than random access would serve you well ;-)
<cheater>
this will have to happen when i have some time ;-)
<cheater>
which unfortunately probably means never %(
<soupault>
I'm getting `external solver failure` error. With internal-solver everything works great. What should I do to overcome this issue?
<cheater>
maybe i should have a mooc running in the background or something.
<cheater>
:)
ryanartecona has joined #ocaml
<flux>
soupault, I suppose you do have an external resolver such as aspicud?
<flux>
soupault, if aspicud is having issues then there's also the possibility to use cloud resolver..
<flux>
is gringo some alternative to aspcud?-o how is gringo related to this problem?
<flux>
or does opam use both
<flux>
I realize the first link was for opam 2.0 which is likely irrelevant for your case
octachron has joined #ocaml
<octachron>
soupault, are you on archlinux?
<soupault>
octachron: yes, I am
hunteriam has joined #ocaml
<octachron>
soupault, you have an outdated aur package
<soupault>
looking through the issue on GitHub. most likely, something related to versions missmatch
<octachron>
try to replace gringo by clingo
<soupault>
octachron: Thanks! I already had it installed. Reinstalling the package has solved the issue
<soupault>
flux: Thanks to you as well!
yomimono has quit [Quit: Leaving]
NJBS has joined #ocaml
<thizanne>
cheater: you've actually wasted way more time trying to code by randomly writing things than you would have spent learning a proper course :)
ryanartecona has quit [Quit: ryanartecona]
slash^ has quit [Read error: Connection reset by peer]
dhil has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
cyraxjoe has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
cyraxjoe has joined #ocaml
rcabaco_ has quit [Ping timeout: 248 seconds]
breitenj has quit [Ping timeout: 256 seconds]
larhat has quit [Quit: Leaving.]
Flerex has joined #ocaml
larhat has joined #ocaml
th5 has quit []
rgrinberg has quit [Ping timeout: 240 seconds]
average has quit [Ping timeout: 245 seconds]
KV has joined #ocaml
ryanartecona has joined #ocaml
nkhodyunya has quit [Quit: Leaving.]
jnavila has quit [Remote host closed the connection]
hunteriam has quit [Quit: Connection closed for inactivity]
jao has joined #ocaml
myst|fon has quit [Quit: Connection closed for inactivity]