adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
sepp2k has quit [Ping timeout: 256 seconds]
mrgrieves has quit [Quit: Lost terminal]
al-damiri has quit [Quit: Connection closed for inactivity]
minn has joined #ocaml
spew has quit [Quit: foobar]
sh0t has quit [Remote host closed the connection]
pilne has joined #ocaml
mfp has quit [Ping timeout: 264 seconds]
silver has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
mengu has quit [Remote host closed the connection]
spew has joined #ocaml
infinity0 is now known as Guest81120
infinity0_ has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ is now known as infinity0
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Changing host]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
copy` has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
tennix has joined #ocaml
tennix has quit [Client Quit]
fluter has quit [Ping timeout: 240 seconds]
fluter has joined #ocaml
marsam has joined #ocaml
marsam has left #ocaml [#ocaml]
wtetzner has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 264 seconds]
tac-tics has joined #ocaml
<tac-tics> I'm trying to figure out a syntax error in a project I'm doing
<tac-tics> Line 28. You can see I tried resolving it with ";;" at the end of the line, but it didn't help
<tac-tics> It is a case of one match statement nested inside another, and I don't know how to properly delimit them
wtetzner has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
bourg_ has joined #ocaml
wtetzner has quit [Remote host closed the connection]
<bourg_> hey tic-tacs you still here?
<tac-tics> kinda. I think we solved it with parens around the statement
<tac-tics> Is there a better way?
<bourg_> yeah there's actually one better way
<bourg_> You can just post it on piazza - Sincerely, the TAs
<tac-tics> lol
<bourg_> Don't post your projects on Pastebin kids
<tac-tics> Thanks, but I was asking for OCaml help
<bourg_> I'm aware, but I'm giving you "not going to the honor council for posting projects online" help
<bourg_> - Austin Bourgerie
<tac-tics> I don't need your lecturing. Thanks
tac-tics has left #ocaml ["Leaving"]
tac-tics has joined #ocaml
pilne has quit [Quit: Quitting!]
<tac-tics> bourg_: I apologize for my rudeness earlier. Do you have a moment? If so, I sent you a PM.
bourg_ has left #ocaml [#ocaml]
shinnya has joined #ocaml
mcspud has quit [Ping timeout: 246 seconds]
blackfry_ghost has quit [Ping timeout: 246 seconds]
blackfry has joined #ocaml
<spew> oh man that was too funny
tac-tics has left #ocaml ["Leaving"]
spew has quit [Quit: foobar]
blackfry has quit [Ping timeout: 246 seconds]
blackfry has joined #ocaml
blackfry has joined #ocaml
blackfry has quit [Changing host]
mcspud has joined #ocaml
tac-tics has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
tac-tics has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
infinity0 has joined #ocaml
tac-tics has joined #ocaml
_whitelogger has joined #ocaml
Simn has joined #ocaml
argent_smith has joined #ocaml
MercurialAlchemi has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
fraggle_ has joined #ocaml
AlexDenisov has joined #ocaml
_whitelogger has joined #ocaml
jnavila has joined #ocaml
tac-tics has quit [Quit: Leaving]
d0nn1e has quit [Ping timeout: 240 seconds]
d0nn1e has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
minn has quit [Ping timeout: 260 seconds]
xmonader has joined #ocaml
ygrek has joined #ocaml
FreeBirdLjj has joined #ocaml
slash^ has joined #ocaml
TarVanim_ has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
tane has joined #ocaml
blackfry has quit [Ping timeout: 246 seconds]
mcspud has quit [Ping timeout: 246 seconds]
ygrek_ has quit [Ping timeout: 264 seconds]
blackfry has joined #ocaml
TarVanim_ has quit [Quit: TarVanim_]
rand__ has joined #ocaml
mcspud has joined #ocaml
p_nathan has quit [Ping timeout: 256 seconds]
silver has joined #ocaml
<infinity0> at the mirageos hackathon someone, i think talex5, mentioned that ocaml had a PR to add iterators/lazylists to the stdlib, anyone got a link to that?
orbifx has joined #ocaml
<infinity0> that sounds like the one, thanks!
<infinity0> ah, guess it won't make it into 4.05
<zozozo> probably not
<zozozo> it would be nice if it makes it at all, ^^
<infinity0> looks like it's blocked on #1010 atm
octachron has joined #ocaml
mfp has joined #ocaml
shinnya has joined #ocaml
orbifx has quit [Ping timeout: 240 seconds]
TarVanim_ has joined #ocaml
g0d355__ has joined #ocaml
larhat has joined #ocaml
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
sunnny has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
octachron has quit [Ping timeout: 260 seconds]
octachron has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xmonader has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
zpe has joined #ocaml
jnavila has joined #ocaml
laserpants has joined #ocaml
TarVanim_ has quit [Quit: TarVanim_]
zpe has quit [Remote host closed the connection]
tane has quit [Quit: Leaving]
average has quit [Quit: leaving]
average has joined #ocaml
mrnugget has joined #ocaml
<hannes> haesbaert: around?
larhat has quit [Quit: Leaving.]
mrnugget has quit [Ping timeout: 256 seconds]
larhat has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
rand__ has quit [Quit: leaving]
TheLemonMan has joined #ocaml
sunnny has left #ocaml ["Ухожу я от вас (xchat 2.4.5 или старше)"]
tane has joined #ocaml
Simn has quit [Ping timeout: 260 seconds]
pilne has joined #ocaml
spew has joined #ocaml
agarwal1975 has joined #ocaml
blackfry has quit [Ping timeout: 258 seconds]
blackfry has joined #ocaml
fold4 has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Leaving]
<TheLemonMan> hm, why does "let f (x : 'a) (y : 'b) : 'a = y" gets typed as 'a -> 'a -> 'a ?
<infinity0> because you have ": 'a" and you have "= y"
<infinity0> so the only way to make that work is to set 'a = 'b
spew has joined #ocaml
<TheLemonMan> oh I see. I'm trying to grasp the polymorphic type annotations and stumbled across this snippet
spew has quit [Quit: foobar]
cross has quit [Remote host closed the connection]
spew has joined #ocaml
tobast has quit [Quit: WeeChat 1.0.1]
tobast has joined #ocaml
spew has quit [Quit: foobar]
Simn has joined #ocaml
wtetzner has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
adnotamentum has joined #ocaml
larhat has quit [Quit: Leaving.]
nicoo has quit [Remote host closed the connection]
laserpants has quit [Quit: Page closed]
spew has joined #ocaml
nicoo has joined #ocaml
spew has quit [Quit: foobar]
spew has joined #ocaml
yomimono has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
TarVanim_ has joined #ocaml
fold4 has joined #ocaml
larhat has joined #ocaml
marsam has joined #ocaml
sh0t has joined #ocaml
<haesbaert> hannes: around now
govg has quit [Ping timeout: 260 seconds]
<adnotamentum> Hey. I have created a datatype of a language (OCamlyacc/Ocamlyexx) which contains the list read on input, its basically a string that looks like "a,a,a,a" how do I do string manipulation on this data type?
govg has joined #ocaml
<octachron> adnotamentum, if you are parsing some language, why are you producing raw string data rather than an AST or other structured data?
<octachron> adnotamentum, otherwise standard library's string functions are here http://caml.inria.fr/pub/docs/manual-ocaml/libref/String.html
<adnotamentum> We are trying to build a AST
mengu has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
tane has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
maxus has joined #ocaml
zpe has quit [Remote host closed the connection]
TheLemonMan has joined #ocaml
<maxus> Hi, is there any standard library function with the following signature that works like Scala's flatMap?
<maxus> 'a option list -> 'a list
<companion_cube> not in the stdlib, but in 3rd party libs, yes
<maxus> thanks. do you happen to know any of those libraries?
<companion_cube> core, batteries, containers, for instance
<maxus> thanks. I'll go have a look at those.
jnavila has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
nomicflux has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
AlexDenisov has joined #ocaml
marsam has quit [Ping timeout: 264 seconds]
jao has joined #ocaml
nomicflux has quit [Quit: nomicflux]
slash^ has quit [Read error: Connection reset by peer]
gk-- has joined #ocaml
gk-- has quit [K-Lined]
spew has quit [Ping timeout: 256 seconds]
zangone has joined #ocaml
<zangone> ciao
<zangone> !list
<ocabot_> did you mean one of [lint;lwt]?
zangone has quit [Client Quit]
jnavila has quit [Ping timeout: 240 seconds]
spew has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
kakadu has joined #ocaml
Mercuria1Alchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
adnotamentum has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<mengu> hi guys. i'd appreciate if someone give me a hand here. i'm trying to think functional but i'm failing.
<mengu> let's say i have linked list: type 'a linked_list = Nil | Node of 'a * 'a linked_list
<mengu> let list = Node (1, Node (2, Node (3, Node(4, Nil)))) and let's say this is my list
<mengu> how should i implement my remove function? what should be my base case?
<tane> remove what exactly?
<mengu> tane: an element from the list.
<tane> mengu, how do you identify said element?
<mengu> tane: based on the value it carries
<mengu> like, remove the node with value 2
<tane> ok, what point of thought are you stuck with now?
<tane> I guess for now it will be sufficient to come up with a recursive solution that's not necessarily as efficient as possible
<mengu> tane: exactly
<mengu> let me show what i have
spew has quit [Ping timeout: 260 seconds]
<tane> it seems you're trying to build a tail recursive version already
p_nathan has joined #ocaml
<mengu> tane: indeed. my reverse function is tail recursive
<mengu> but i fail to come up with reverse
nomicflux has joined #ocaml
<tane> mengu, well, have you yet implemented a non-tail-recursive remove function?
<mengu> nope
<tane> mengu, append elt in the else branch to acc, in the then branch you don't
<tane> in the end return the reversed acc
<mengu> if v = elt then aux acc next else aux (append acc elt) next
<mengu> you mean like this?
<mengu> oh
<mengu> append acc v
<tane> yeah, prepend is what I meant to write :)
<tane> aka cons
<mengu> tane: indeed
<mengu> yup
<mengu> it's working
<mengu> int linked_list = Node (4, Node (3, Node (1, Nil)))
TarVanim_ has quit [Quit: TarVanim_]
<mengu> i should reverse it then
<mengu> or have an actual append version
<mengu> which one would be more expensive tho?
<tane> mengu, reverse is better
<tane> one reverse at the end
<mengu> alright, there's something wrong with my reverse
<mengu> tane: this is working http://pastebin.com/XpWxuBsx when i just call it like reverse list;;
<mengu> but fails when i call it like reverse (aux Nil list)
<mengu> tane: should i have an mli file for that?
<tane> depends
<mengu> so compiler does not infer different types?
<mengu> the error message i get is:
<mengu> This expression has type 'a linked_list/117231
<mengu> but an expression was expected of type 'b linked_list/117174
<tane> mengu, hard to tell what the error is, the code you provided doesn't exhibit that
<octachron> mengu, this is a toplevel error, isn't it?
<mengu> octachron: yes
<mengu> tane: sorry, let me fix that
<octachron> mengu, this just happens because you have defined your type t multiple times in the the same toplevel session
jnavila has joined #ocaml
<mengu> octachron: i'll be damned
<mengu> indeed that was the problem
<mengu> does the order of the functions in a file matter?
<tane> mengu, yes
<mengu> or is it like haskell? you can define a function below and call it in a function at the top?
<mengu> alright
<mengu> thank you very much tane
<mengu> your help made me finish this implementation
<tane> keep up the good work, ocaml's worth it :]
<mengu> i've been a self taught web developer for a long time and now i want to do functional programming, think functional and also know my data structures well
<mengu> here's my whole implementation. http://pastebin.com/9Bwvkpp1
<mengu> let me know if you have any suggestions
<tane> mengu, list_size is not yet tail-recursive
<tane> neither is map etc, for that matter
<tane> and argument order isn't consistent, e.g. sometimes the list is the first parameter, sometimes the last, maybe there's some logic to that :)
<tane> a lot of functions in the stdlib List module take the list as the last parameter, makes it easy to pipe lists through some chain of calls using |>
maxus_ has joined #ocaml
maxus has quit [Read error: Connection reset by peer]
maxus_ has quit [Remote host closed the connection]
spew has joined #ocaml
frefity has quit [Quit: Ex-Chat]
<mengu> tane: yeah, i was bothered with the argument order
<mengu> let's fix that
kolko has joined #ocaml
<mengu> aight done
SpiceGuid has joined #ocaml
<mengu> tane: any better now? http://pastebin.com/yQ77uL5s
<mengu> octachron: thank you by the way
<mengu> i'm now killing my top level in emacs when i make type changes etc.
<mengu> i thought emacs was reloading the toplevel
marsam has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
d0nn1e has joined #ocaml
<tane> mengu, list_length is still not tail-rec :D
<tane> or length, as it is called now
<mengu> tane: oh
<mengu> i get what you mean
<mengu> it should be aux (acc + 1) next
<tane> aye
<mengu> not 1 + aux acc next
<mengu> fixed it
<mengu> thanks :-)
<mengu> and renamed acc to len
<tane> good job, brb
tane has quit [Quit: Leaving]
<mengu> thanks
TarVanim_ has joined #ocaml
octachron has quit [Quit: Leaving]
tane has joined #ocaml
spew has quit [Quit: foobar]
Guest4562 has joined #ocaml
Guest4562 has quit [Remote host closed the connection]
TarVanim_ has quit [Quit: TarVanim_]
argent_smith has quit [Quit: Leaving.]
cross has joined #ocaml
copy` has joined #ocaml
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
fraggle_ has quit [Ping timeout: 264 seconds]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
jnavila has quit [Remote host closed the connection]
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
fraggle_ has joined #ocaml
sh0t has quit [Ping timeout: 240 seconds]
wtetzner has quit [Remote host closed the connection]
charles has joined #ocaml
charles is now known as Guest42042
abeaumont has quit [Remote host closed the connection]
abeaumont has joined #ocaml
Guest42042 has quit [Ping timeout: 246 seconds]
phase_ has joined #ocaml
sh0t has joined #ocaml
p_nathan has quit [Ping timeout: 264 seconds]
larhat has quit [Quit: Leaving.]
rand__ has joined #ocaml
tane has quit [Quit: Leaving]
marsam has left #ocaml ["Killed buffer"]
phase_ has quit [Quit: cya l8r alig8r]
spew has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 256 seconds]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
Simn has quit [Quit: Leaving]
rand__ has quit [Quit: leaving]
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.46/20161213183751]]
sillyotter has joined #ocaml