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?
<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!]
<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‽‽)