adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
ziyourenxiang has joined #ocaml
AtumT has quit [Quit: AtumT]
kvda has joined #ocaml
Haudegen has quit [Remote host closed the connection]
<xuib> ocaml makes no sense
<xuib> the syntax isn't explained anywhere
<xuib> even the official tutorials just gloss over everything
<xuib> all forum posts just seem to have solutions, with no explanation
<xuib> is there some kind of initiation right i have to go through? can the high level priests of teh ocaml church share some of the esoteric knowledge with a lowly imperitive pleb like me?
<xuib> ocaml in one sentence: `let a a = if a > a then a else a -> a or a if a is a then a List.iter a funcname a else b`
<xuib> what does it mean? who knows. looks like it's summoning some kind of demon
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
silver has quit [Quit: rakede]
AnAverageHuman has joined #ocaml
unyu has quit [Quit: ERC (IRC client for Emacs 26.1)]
unyu has joined #ocaml
<Drup> xuib: that's not valid ocaml. :)
mfp has quit [Ping timeout: 244 seconds]
<Drup> Do you have concrete questions that are not pure rants ? The syntax is explained both in the manual, and in many ocaml tutorials and books available online.
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ygrek has joined #ocaml
kvda has joined #ocaml
<xuib> Drup: can you recommend one for someone with zero fp experience?
<Khady> http://ocaml-book.com/ ocaml from the very beginning
<Drup> that one, or if you have previous programming (non fp) experience, "Real World OCaml"
<xuib> Drup: okay, thanks Khady Drup lol
xuib has quit [Quit: xuib]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kvda has joined #ocaml
ziyourenxiang has quit [Ping timeout: 244 seconds]
caltelt_ has joined #ocaml
sonologico has joined #ocaml
spew has quit [Quit: Connection closed for inactivity]
gravicappa has joined #ocaml
kvda has quit [Ping timeout: 272 seconds]
AnAverageHuman has quit [Ping timeout: 256 seconds]
AnAverageHuman has joined #ocaml
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 245 seconds]
caltelt_ has quit [Ping timeout: 272 seconds]
ygrek has quit [Ping timeout: 245 seconds]
AnAverageHuman has quit [Ping timeout: 256 seconds]
adi_______ has quit [Ping timeout: 250 seconds]
adi_______ has joined #ocaml
mattg__ has quit [Ping timeout: 240 seconds]
hfjvjffju has quit [Ping timeout: 268 seconds]
mattg__ has joined #ocaml
quarters has quit [Ping timeout: 250 seconds]
andreypopp has quit [Ping timeout: 250 seconds]
rfv has quit [Ping timeout: 240 seconds]
wildsebastian has quit [Ping timeout: 240 seconds]
metadave_ has quit [Ping timeout: 268 seconds]
sspi has quit [Ping timeout: 240 seconds]
stephe has quit [Ping timeout: 250 seconds]
lopex has quit [Ping timeout: 240 seconds]
robmyers has quit [Ping timeout: 240 seconds]
jyc has quit [Ping timeout: 250 seconds]
sspi has joined #ocaml
rfv has joined #ocaml
wildsebastian has joined #ocaml
hfjvjffju has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
lopex has joined #ocaml
tizoc has joined #ocaml
jyc has joined #ocaml
robmyers has joined #ocaml
stephe has joined #ocaml
quarters has joined #ocaml
metadave_ has joined #ocaml
andreypopp has joined #ocaml
_whitelogger has joined #ocaml
lokydor has quit [Quit: WeeChat 2.4]
amiloradovsky has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
Birdface has joined #ocaml
ggole has joined #ocaml
freyr69 has joined #ocaml
ziyourenxiang has joined #ocaml
ziyourenxiang has quit [Ping timeout: 244 seconds]
barockobamo has joined #ocaml
Haudegen has joined #ocaml
<AxiomaticEspress> sorry if this is a really stupid question, but I was checking out this Mirage example https://github.com/mirage/mirage-skeleton/tree/master/device-usage/conduit_server. It compiles and everything but it needs root access to run the binary, is there any straightforward way you can change that?
freyr69 has quit [Ping timeout: 272 seconds]
<Drup> AxiomaticEspress: depends on how it's configured. Socket on port 8080 should probably not require root access
barockobamo2 has joined #ocaml
barockobamo has quit [Remote host closed the connection]
<AxiomaticEspress> Drup: cheers :)
<AxiomaticEspress> Drup: it worked
jaar has joined #ocaml
<AxiomaticEspress> any idea where I can find the function that is hashing the polymorphic variants?
<AxiomaticEspress> def`: cheers; In utop I'm trying to use it but even if I do #require "compiler-libs" and Utop offers autocompletion for Btype, utop says the Btype module is unbound
<Armael> I think you have to use utop-full (the binary) to use utop with compiler-libs
<AxiomaticEspress> Armael: tried it and it worked, thanks!
freyr69 has joined #ocaml
zolk3ri has joined #ocaml
notnotdan` is now known as notnotdan
mfp has joined #ocaml
<dinosaure> companion_cube: dune-release?
<dinosaure> focus fail dsl
omarramo has joined #ocaml
robmyers has quit [Ping timeout: 252 seconds]
lopex has quit [Ping timeout: 252 seconds]
sspi has quit [Ping timeout: 252 seconds]
metadave_ has quit [Ping timeout: 252 seconds]
lopex has joined #ocaml
sspi has joined #ocaml
robmyers has joined #ocaml
metadave_ has joined #ocaml
pie___ has joined #ocaml
pie___ has quit [Read error: Connection reset by peer]
gareppa has joined #ocaml
pie___ has joined #ocaml
omarramo has quit [Ping timeout: 272 seconds]
gareppa has quit [Quit: Leaving]
<AxiomaticEspress> any idea why doing #require "cohttp-mirage";; in utop gives "Error: The external function `mirage_alloc_pages' is not available"?
<AxiomaticEspress> same thing happens with #require "io-page";;
ziyourenxiang has joined #ocaml
<Drup> it might be a packaging issue, but those libraries are not intended to run in a toplevel
<Drup> they aren't even intended to run on Unix....
silver has joined #ocaml
amiloradovsky has quit [Ping timeout: 244 seconds]
discord4 has joined #ocaml
mrallen1_ has joined #ocaml
strmpnk_ has joined #ocaml
cemerick_ has joined #ocaml
breitenj- has joined #ocaml
pippijn_ has joined #ocaml
Ulrar_ has joined #ocaml
rpcope- has joined #ocaml
strmpnk has quit [*.net *.split]
nojb[m] has quit [*.net *.split]
Virgile[m] has quit [*.net *.split]
aecepoglu[m] has quit [*.net *.split]
copy` has quit [*.net *.split]
peddie has quit [*.net *.split]
rpcope has quit [*.net *.split]
breitenj has quit [*.net *.split]
cemerick has quit [*.net *.split]
discord3 has quit [*.net *.split]
mrallen1 has quit [*.net *.split]
pippijn has quit [*.net *.split]
nullifidian has quit [*.net *.split]
Ulrar has quit [*.net *.split]
jack5638 has quit [*.net *.split]
mrallen1_ is now known as mrallen1
strmpnk_ is now known as strmpnk
cemerick_ is now known as cemerick
jack5638 has joined #ocaml
spew has joined #ocaml
dimitarvp has joined #ocaml
nojb[m] has joined #ocaml
Virgile[m] has joined #ocaml
copy` has joined #ocaml
nullifidian has joined #ocaml
gahr has joined #ocaml
aecepoglu[m] has joined #ocaml
peddie has joined #ocaml
jaar has quit [Ping timeout: 252 seconds]
Haudegen has quit [Remote host closed the connection]
omarramo has joined #ocaml
jaar has joined #ocaml
pie___ has quit [Ping timeout: 268 seconds]
AnAverageHuman has joined #ocaml
AnAverageHuman has quit [Ping timeout: 256 seconds]
omarramo has quit [Quit: Konversation terminated!]
AtumT has joined #ocaml
Haudegen has joined #ocaml
amiloradovsky has joined #ocaml
pie___ has joined #ocaml
<cemerick> how can I cleanly refer to a same-named type in an outer module? i.e. the first example here is a cyclic reference; the second example works, but there must be a better way: https://gist.github.com/cemerick/97abe4cf4cdb9d61a72c0bd9615c8ca2
<octachron> You can use `type nonrec t` for defining `t` or define a more explicit type name `type foo = t` for `Foo.t` like in your second example
unyu has quit [Quit: brb]
unyu has joined #ocaml
sz0 has joined #ocaml
barockobamo2 has quit [Ping timeout: 252 seconds]
freyr69 has quit [Remote host closed the connection]
barockobamo2 has joined #ocaml
barockobamo2 has quit [Remote host closed the connection]
Redfoxmoon has quit [Ping timeout: 245 seconds]
metadave_ has left #ocaml [#ocaml]
pie___ has quit [Ping timeout: 252 seconds]
okuu has joined #ocaml
AnAverageHuman has joined #ocaml
mildtaste has quit [Remote host closed the connection]
ygrek has joined #ocaml
pie___ has joined #ocaml
Redfoxmoon has joined #ocaml
Redfoxmoon has quit [Changing host]
Redfoxmoon has joined #ocaml
ziyourenxiang has quit [Ping timeout: 245 seconds]
AnAverageHuman has quit [Ping timeout: 256 seconds]
Haudegen has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
gareppa has joined #ocaml
amiloradovsky has quit [Ping timeout: 268 seconds]
gareppa has quit [Remote host closed the connection]
pie___ has quit [Ping timeout: 250 seconds]
okuu has quit [Ping timeout: 250 seconds]
SpiceGuid has joined #ocaml
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ocaml
zmt01 has quit [Ping timeout: 264 seconds]
jack5638 has quit [Ping timeout: 268 seconds]
KeyJoo has joined #ocaml
<cemerick> octachron: thanks, `nonrec` is perfect; both modules need a `t` to conform to key signatures, so it's nice to be able to avoid the additional alias.
jaar has quit [Quit: Leaving]
<cemerick> huh, `nonrec` is pretty new, since 4.02
<companion_cube> 4.02 is not very new anymore
dimitarvp has quit [Quit: Bye]
<octachron> cemerick, if you want a shiny new workaround, in 4.08, you can use "open struct type foo = t end" and the alias will not appear in the inferred signature.
jack5638 has joined #ocaml
xuib has joined #ocaml
<cemerick> companion_cube: these things are relative, I guess :-)
<xuib> hey. noob here. what's wrong with this syntax? (probably everything) Note: i have to use 'match case' for this exercise: https://bpaste.net/show/a4b4861f6a6a
<xuib> don't make me rant
<xuib> the words are beginning to spill out the top of my head like a boiling pot
<cemerick> xuib: also noob-ish here, but I think you prob need to wrap the inner match in parens
<xuib> ahh
<xuib> cemerick: starting where, sum?
<xuib> oh well, i'm stumped
<octachron> xuib, you are missing an `in rest` after the definition of sum, it would be simpler to move the `sum` function outside of the `match`.
<xuib> octachron: what do you mean by `in rest`?
<xuib> (i started learning yesterday)
<xuib> i understand 'in'
<octachron> `let f x = x * x in f 2`
<xuib> hmm i see what you mean
<xuib> let me work on it
Haudegen has joined #ocaml
<xuib> okaym i skip that example for now, the syntax is a little out of my grasp yet
<xuib> oh nvm, done it.
<xuib> thanks!
okuu has joined #ocaml
<SpiceGuid> xuib : i think there is an idiomatic way (the OCaml way of doing things), and in your case this way is https://pastebin.com/8uXMGRg6
kakadu_ has quit [Quit: Konversation terminated!]
<xuib> SpiceGuid: that's how i'd typically do it, but i'm doing some exercises in a book
<xuib> SpiceGuid: specifically they said to use the match statement
<xuib> SpiceGuid: plus, it's only supposed to sum up positive numbers, hence the nested statements
<xuib> up to a positive number*
<xuib> 1-n, where n is positive
<xuib> silly really, the next question asked me to write a function to compute n raise to the power of m, with match statements. i noped out of that one.
<_y> just to be sure: if you start ranting, that would be our fault?
<xuib> _y: probably not, but i might blame you anyway
<xuib> from now on, you're the reason for all my syntax error _y :)
SpiceGuid has quit [Quit: ChatZilla 0.9.93 [SeaMonkey 2.49.4/20180713174829]]
kakadu has joined #ocaml
<xuib> okay, i might have missed SpiceGrid's point
<xuib> lol
KeyJoo has quit [Quit: KeyJoo]
ggole has quit [Quit: Leaving]
sz0 has quit [Quit: Connection closed for inactivity]
okuu has quit [Ping timeout: 250 seconds]
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ocaml
<AxiomaticEspress> how does OCaml deal with the labeled/optional arguments at runtime? The "Real World OCaml" book says that in the case of optionals, the compiler adds Nones (which then become zeroes) or the default values at their positions. So, if I wanted to call a function in some intermediate representation of OCaml like Lambda, that means I should add these manually, also at this point there are no more labels; should
<AxiomaticEspress> the arguments be provided in the left to right order?
<companion_cube> I think the labels are just erased in the same order as their occurrence in the definition
<companion_cube> (why would you call a function in lambda‽‽)
<AxiomaticEspress> companion_cube: well, not lambda but Malfunction - https://github.com/stedolan/malfunction
<companion_cube> ah, that
<companion_cube> I'd say, don't mix your language with OCaml functions ;)
<AxiomaticEspress> companion_cube: why not :)?
<AxiomaticEspress> companion_cube: I was trying to run the example server in the README here https://github.com/mirage/ocaml-cohttp
<companion_cube> I mean, if you like this, sure, but it sounds super janky and fragile
<AxiomaticEspress> trying to write* (in Malfunction)
Haudegen has quit [Remote host closed the connection]
<AxiomaticEspress> and I don't know whether to provide the optional args for Server.create, Server.make etc. or not
<companion_cube> try and see what happens? :p
<AxiomaticEspress> should probably check if they normally had defaults..
<AxiomaticEspress> tried and is segfaulting, but yeah, it's untyped and fragile - could be anything
<companion_cube> 😅
<AxiomaticEspress> it's a pain to write this by hand and you shouldn't haha
gravicappa has quit [Ping timeout: 272 seconds]
AtumT has quit [Read error: Connection reset by peer]
AtumT has joined #ocaml
Haudegen has joined #ocaml
nullifidian has quit [Ping timeout: 268 seconds]
nullifidian has joined #ocaml
jnavila has joined #ocaml
<cemerick> what is the syntax error in this recursive module signature? https://gist.github.com/cemerick/6b6f7b97eab104786e40cf6416e3dea5
<cemerick> I can use those signatures without a problem inline
Birdface has quit [Ping timeout: 272 seconds]
<def`> is this in an implementation or an interface?
xuib has quit [Ping timeout: 246 seconds]
xuib has joined #ocaml
jnavila has quit [Remote host closed the connection]
karan has joined #ocaml
Serpent7776 has quit [Quit: leaving]
karan[m] has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 255 seconds]
karan has quit [Remote host closed the connection]
caltelt_ has joined #ocaml
zmt01 has joined #ocaml
kakadu has quit [Remote host closed the connection]
zmt01 has quit [Ping timeout: 250 seconds]
sonologico has quit [Ping timeout: 252 seconds]
assemblyman has joined #ocaml