Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.13.0 released: https://ocaml.org/releases/4.13.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
ccx has quit [Ping timeout: 272 seconds]
TheRuralJuror has quit [Ping timeout: 260 seconds]
Tuplanolla has quit [Quit: Leaving.]
ccx has joined #ocaml
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
spip has joined #ocaml
bobo has quit [Ping timeout: 240 seconds]
vicfred has quit [Quit: Leaving]
quartz has joined #ocaml
<quartz> Hi. Can someone tell me why I'm getting this syntax error in my OCaml code? https://godbolt.org/z/3jn486a8P
<quartz> I'm trying to have multiple helper functions in one function.
<quartz> Oh I forgot to include the record: https://godbolt.org/z/Pjbre5Kqe
<d_bot_> <NULL> You're missing an `in` in the second definition, at the bottom
<quartz> NULL: what line?
<quartz> I have two ins
<d_bot_> <NULL> The definition of `longestRun`
<quartz> I put an 'in' on line 20 but it still gives me an error :( https://godbolt.org/z/bnG6faa5T
<quartz> I'm so close lol
<d_bot_> <NULL> `let f : int = function () -> 0` is wrong, you're having basically the same problem
<sleepydog> put another way, the trailing `: int` on line 16 shouldn't be there
<d_bot_> <NULL> Not so much that it shouldn't be there : it can, but in this case the annotation is wrong
<sleepydog> i wonder, couldn't the compiler tell you that it has the expression `int list -> int` instead of just saying `'a -> 'b`
<sleepydog> s/has the expression/has the type/
<quartz> sleepydog: yes, my VS Code is telling me that
<quartz> But godbolt does not
<quartz> Weird.
<sleepydog> oh, nice
<quartz> This expression has type 'a -> 'b but an expression was expected of type intocamllsp
<quartz> I'm not sure what that means
<sleepydog> heh
<quartz> yeah it is suppose to return an int
<sleepydog> neither am i
<quartz> Not a generic
<d_bot_> <NULL> Without the type annotation, the compiler understands that it will have that type and the LSP can even tell you that
<d_bot_> <NULL> With the annotation, it takes over and makes the code "non-conformant" so it reports that
<quartz> NULL: I'm not sure what you mean
<d_bot_> <NULL> `'a -> 'b` is just a generic function type, when you don't know (or care to elaborate) on the specific types of the argument and return value
<quartz> VS COde tells me something is wrong, godbolt says it's right :P
<quartz> Right, even I know that much
<sleepydog> quartz: so do you have it working now?
<d_bot_> <NULL> At what point does godbolt tell you the code is right ? Or what is the difference ?
<quartz> sleepydog: Yeah I just tested it with godbolt: https://godbolt.org/z/x7hz13Y55
<quartz> Passes teh test case
<sleepydog> excellent
<sleepydog> i'm curious, does your course prohibit use of the ocaml standard library?
<quartz> sleepydog: no
<sleepydog> for example, your function, `allPositive`, is trivialized with `List.filter`: `let allPositive = List.filter ((>=) 0)`
<sleepydog> err, `List.filter ((<=) 0)`, sorry
<d_bot_> <NULL> It's not a filter; it's `List.map abs`
<sleepydog> oh, hah, i didn't read the whole thing
<quartz> Yeah it's the same thing basically
<quartz> Still trying to learn this stuff
<sleepydog> it's probably good to do the recursion "by hand" until you get it, but higher order functions like map & fold end up being really useful
<quartz> True
<quartz> Thanks for your help guys.
<sleepydog> i hope it's getting less frustrating :)
bobo has joined #ocaml
spip has quit [Ping timeout: 256 seconds]
quartz has quit [Quit: WeeChat 3.4]
gravicappa has joined #ocaml
Techcable has quit [Ping timeout: 252 seconds]
waleee has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
mbuf has joined #ocaml
mbuf has quit [Ping timeout: 272 seconds]
zebrag has quit [Quit: Konversation terminated!]
mbuf has joined #ocaml
Haudegen has joined #ocaml
adanwan has quit [Read error: Connection reset by peer]
azimut has quit [Write error: Connection reset by peer]
wyrd has quit [Read error: Connection reset by peer]
adanwan has joined #ocaml
azimut has joined #ocaml
wyrd has joined #ocaml
motherfsck has joined #ocaml
wyrd has quit [Remote host closed the connection]
adanwan has quit [Read error: Connection reset by peer]
azimut has quit [Write error: Connection reset by peer]
wyrd has joined #ocaml
adanwan has joined #ocaml
azimut has joined #ocaml
Serpent7776 has joined #ocaml
dwt_ has quit [Ping timeout: 240 seconds]
dwt__ has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
motherfsck has quit [Quit: quit]
motherfsck has joined #ocaml
gravicappa has quit [Ping timeout: 256 seconds]
JosEduardo[m] has quit [Quit: You have been kicked for being idle]
bobo has quit [Quit: Konversation terminated!]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
waleee has joined #ocaml
mro has quit [Remote host closed the connection]
olle has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
mro has joined #ocaml
bartholin has joined #ocaml
olle has quit [Ping timeout: 240 seconds]
mro has quit [Remote host closed the connection]
gravicappa has joined #ocaml
dextaa_ has joined #ocaml
dextaa_ has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
Anarchos has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
olle has joined #ocaml
waleee has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
Techcable has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
kaph has joined #ocaml
bartholin has quit [Ping timeout: 245 seconds]
bartholin has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
bartholin has quit [Ping timeout: 256 seconds]
bartholin has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 256 seconds]
waleee has joined #ocaml
gravicappa has quit [Ping timeout: 272 seconds]
epony has quit [Ping timeout: 240 seconds]
mro has joined #ocaml
mmalter has joined #ocaml
gravicappa has joined #ocaml
zebrag has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
bgs has quit [Read error: Connection reset by peer]
bgs has joined #ocaml
tomku has quit [Ping timeout: 268 seconds]
tomku has joined #ocaml
epony has joined #ocaml
bartholin has quit [Quit: Leaving]
mro has quit [Remote host closed the connection]
mbuf has quit [Quit: Leaving]
rgrinberg has joined #ocaml
mro has joined #ocaml
olle has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
szkl has quit [Quit: Connection closed for inactivity]
rgrinberg has joined #ocaml
mro has quit [Remote host closed the connection]
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
mro has joined #ocaml
mro has quit [Remote host closed the connection]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
oriba has joined #ocaml
olle has joined #ocaml
Exa has quit [Quit: see ya!]
Exa has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro_ has joined #ocaml
mro_ has quit [Remote host closed the connection]
mro has joined #ocaml
rgrinberg has joined #ocaml
gravicappa has quit [Ping timeout: 256 seconds]
mro_ has joined #ocaml
mro__ has joined #ocaml
mro has quit [Ping timeout: 240 seconds]
mro__ has quit [Read error: Connection reset by peer]
mro_ has quit [Ping timeout: 250 seconds]
motherfsck has quit [Ping timeout: 250 seconds]
vicfred has joined #ocaml
Tuplanolla has joined #ocaml
wyrd has quit [Ping timeout: 240 seconds]
rish has joined #ocaml
wyrd has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Serpent7776 has quit [Quit: leaving]
waleee has quit [Ping timeout: 256 seconds]
olle has quit [Ping timeout: 272 seconds]
waleee has joined #ocaml
benthumb2000 has joined #ocaml
kurfen_ has quit [Ping timeout: 256 seconds]
kurfen has joined #ocaml
cross has quit [Ping timeout: 256 seconds]
afrosenpai has quit [Ping timeout: 256 seconds]
afrosenpai has joined #ocaml
cross has joined #ocaml
kaph has quit [Read error: Connection reset by peer]
rish has quit [Quit: WeeChat 3.0]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
benthumb2000 has quit [Quit: WeeChat 3.3]
azimut has quit [Ping timeout: 240 seconds]
azimut_ has joined #ocaml
kaph has joined #ocaml
motherfsck has joined #ocaml
rish has joined #ocaml
Techcable has quit [Ping timeout: 256 seconds]
motherfsck has quit [Quit: quit]
Haudegen has quit [Ping timeout: 256 seconds]