adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
solrize has joined #ocaml
solrize has quit [Changing host]
solrize has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
iZsh has quit [Ping timeout: 240 seconds]
mengu has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
jimt_ is now known as jimt
infinity0 has quit [Ping timeout: 264 seconds]
infinity0 has joined #ocaml
malina has quit [Quit: Throwing apples of Montserrat]
ziyourenxiang has joined #ocaml
pierpa has quit [Quit: Page closed]
Haudegen has quit [Read error: Connection reset by peer]
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
sh0t has quit [Remote host closed the connection]
spew has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
silver has quit [Quit: rakede]
marsam has joined #ocaml
jp_ has joined #ocaml
nomicflux has joined #ocaml
KeyJoo has quit [Quit: Good luck! Have a nice Day!]
mengu has quit [Quit: Leaving...]
iZsh has joined #ocaml
spew has quit [Read error: Connection reset by peer]
shinnya has joined #ocaml
jp_ has quit []
whoman has quit [Read error: Connection reset by peer]
kerrhau_ has joined #ocaml
kerrhau_ has quit [Client Quit]
marsam has quit [Ping timeout: 272 seconds]
mfp has quit [Ping timeout: 265 seconds]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
whoman has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
ygrek has quit [Ping timeout: 256 seconds]
solrize has quit [Remote host closed the connection]
solrize has joined #ocaml
solrize has joined #ocaml
solrize has quit [Changing host]
ahf has quit [Ping timeout: 264 seconds]
ahf has joined #ocaml
spew has joined #ocaml
spew has quit [Read error: Connection reset by peer]
orbitz has quit [Ping timeout: 248 seconds]
kerrhau_ has joined #ocaml
orbitz has joined #ocaml
jimmyrcom_ has quit [Read error: Connection reset by peer]
jimmyrcom_ has joined #ocaml
ziyourenxiang has quit [Ping timeout: 265 seconds]
sapristi has quit [Remote host closed the connection]
spew has joined #ocaml
sapristi has joined #ocaml
kerrhau_ is now known as kerrhau
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
andreas__ has quit [Quit: Connection closed for inactivity]
spew has quit [Read error: Connection reset by peer]
shinnya has joined #ocaml
ousado has quit [Remote host closed the connection]
ousado has joined #ocaml
raphaelss has joined #ocaml
nomicflux has quit [Quit: nomicflux]
enterprisey has joined #ocaml
KeyJoo has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
slash^ has joined #ocaml
rostero has quit [Quit: Connection closed for inactivity]
ziyourenxiang has joined #ocaml
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
madroach has quit [Quit: leaving]
madroach has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
madroach has joined #ocaml
cbot has quit [Quit: Leaving]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
donflopez has joined #ocaml
aubian has quit [Ping timeout: 264 seconds]
aubian has joined #ocaml
Fardale has quit [Quit: Fardale]
tobiasBora has quit [Quit: WeeChat 1.6]
aubian has quit [Client Quit]
argent_smith has joined #ocaml
<companion_cube> SpaceSheep: the context contains parameters
<companion_cube> like, verbosity, etc.
<companion_cube> you can also create your own parameters for the CLI interface to parse
enterprisey has quit [Remote host closed the connection]
heisenberg has joined #ocaml
<heisenberg> Good Morning
<companion_cube> o/
jnavila has joined #ocaml
enterprisey has joined #ocaml
donflopez has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mfp has joined #ocaml
Fardale has joined #ocaml
<heisenberg> anyone may tell me what's wrong here ? https://pastebin.com/QMHLGWEZ
<Drup> heisenberg: there is no else in your last if
Anarchos has joined #ocaml
andreas__ has joined #ocaml
argent_smith1 has joined #ocaml
argent_smith has quit [Ping timeout: 264 seconds]
silver has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
<heisenberg> Drup I'm a genius
Anarchos has quit [Quit: Vision[0.10.2]: i've been blurred!]
_whitelogger has joined #ocaml
Fardale has quit [Ping timeout: 240 seconds]
enterprisey has quit [Remote host closed the connection]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
igarnier has joined #ocaml
<igarnier> Hi everyone!
moei has joined #ocaml
Haudegen has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
mengu has joined #ocaml
nullifidian__ has quit [Read error: Connection reset by peer]
nullifidian_ has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
kerrhau has quit [Ping timeout: 265 seconds]
Fardale has joined #ocaml
marsam has joined #ocaml
igarnier has quit [Quit: Page closed]
marsam has quit [Ping timeout: 240 seconds]
mengu has quit [Remote host closed the connection]
Haudegen has quit [Remote host closed the connection]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
jnavila has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
kerrhau has joined #ocaml
zmt00 has quit [Quit: Leaving]
marsam has joined #ocaml
andreas__ has quit [Quit: Connection closed for inactivity]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
spew has joined #ocaml
nomicflux has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
mengu has joined #ocaml
mengu has quit [Ping timeout: 264 seconds]
nomicflux has quit [Quit: nomicflux]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
spew has quit [Ping timeout: 248 seconds]
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
marsam has quit [Ping timeout: 240 seconds]
sapristi has quit [Ping timeout: 256 seconds]
kakadu has joined #ocaml
<heisenberg> anyone can help me with n-trees ?
heisenberg has quit [Quit: Lost terminal]
spew has joined #ocaml
jnavila has quit [Ping timeout: 272 seconds]
malc_ has joined #ocaml
tsani has joined #ocaml
sapristi has joined #ocaml
Anarchos has joined #ocaml
heisenberg has joined #ocaml
<heisenberg> Hi, it's anybody there?
<companion_cube> hi
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
<heisenberg> companion_cube hi
<heisenberg> do you know if there's a good source to learn how to deal with n-trees ?
<companion_cube> what do you want to do with n-trees?
<heisenberg> companion_cube nothing special, I'm learning.
<companion_cube> (you mean `type 'a tree = Leaf of 'a | Node of 'a tree list`?)
<heisenberg> type 'a ntree = Tr of 'a * 'a ntree list
<heisenberg> it's a leaf when the list is empty ofc
<companion_cube> right
<companion_cube> that works too
<heisenberg> I'm trying some exercises but looks difficult for me
<companion_cube> I won't solve your exercise for you, but I can try to help ;)
<heisenberg> is there any source to learn how to work on that structure, expecially using mutual recursion ?
<companion_cube> not particularly, it's "normal" recursion
<companion_cube> what are you trying to do?
<companion_cube> (you'd have to mutually recurse on trees and on lists of trees, indeed)
<heisenberg> nothing in particular actually, since I'm not able to do anything yet
<heisenberg> yeah exactly, that should be the easiest way.
<companion_cube> well, try to find if an element is in the tree, or try to mirror the tree
<companion_cube> these are relatively easy :)
<heisenberg> what does mirror mean?
<companion_cube> like a vertical symmetry :)
<companion_cube> look the tree in the mirror, somehow
<heisenberg> you mean if 'a is an int, to put the elements in a list following a certain order?
<heisenberg> actually for me is a nightmare even to count nodes in that kind of struct
<heisenberg> may you redirect me to a good source where it's explained ? (even a yt video would be ok for me I guess)
<companion_cube> I can show you a simple example
<companion_cube> to count nodes, e.g.
<heisenberg> companion_cube there's no need to
<companion_cube> let rec count (t:_ tree) : int = match t with Tr (_, l) -> 1 + count_list l and count_list = function [] -> 0 | t :: tail -> count t + count_list tail
<heisenberg> I already have some examples like this one, but I need to understand really where how mutual recursion works somehow
<companion_cube> you can try to #trace count;; #trace count_list;; count (Tr (1, [Tr (2, []); Tr (3,[])]));;
<companion_cube> (or bigger trees)
<heisenberg> tell me if is correct to think in that way:
<companion_cube> to see what's going on and understand these functions
<heisenberg> uhm, is not easy to explain what I'm thinking, give me a sec
<heisenberg> I mean, the first function should do smthg on the element, and call the function (2nd one) for the list
<heisenberg> while, the 2nd one should call the 1st function on each element, and call itself on the next element of the list
<companion_cube> yep
<companion_cube> that's what the functions I wrote above do
<companion_cube> (except the element is ignored)
<companion_cube> you can try to adapt it to compute the sum of the elements of an `int tree`
<heisenberg> it's that ALWAYS correct ? (of course if I need to find smth I would stop once found, if that happens... I mean generally if that way of thinking should work)
kakadu has quit [Ping timeout: 240 seconds]
kakadu_ has joined #ocaml
<companion_cube> sometimes you can avoid recursing on the list's tail
<companion_cube> if you're looking for an element, and you found it in the head of the list (the first tree), no need to continue
nullifidian__ has joined #ocaml
nullifidian_ has quit [Ping timeout: 248 seconds]
<heisenberg> that gives me a syntax error... https://pastebin.com/yimk834t
<malc_> heisenberg: "and count_lst" (i.e. not without let rec)
<companion_cube> the second `let rec` is wrong
<malc_> -not
<companion_cube> also, you miss the `[]` case
<companion_cube> [] -> … | el::rest -> …
<heisenberg> that one "compiles"
<heisenberg> but does it work ?
<heisenberg> what if I put "1 + .." after el::rest, and just count_lst after Tr case ?
kerrhau has quit [Ping timeout: 264 seconds]
kerrhau has joined #ocaml
kerrhau has quit [Changing host]
kerrhau has joined #ocaml
<companion_cube> well it should work
<companion_cube> try it out
sh0t has joined #ocaml
<heisenberg> in both cases ?
<companion_cube> depends on what you want to count
mk9 has joined #ocaml
solrize has quit [Ping timeout: 265 seconds]
<heisenberg> the total number of nodes
<heisenberg> in both cases...
<companion_cube> you should probably have only one `1+…`
<companion_cube> really, try to run this on some examples in utop
<companion_cube> (possibly with `#trace count;;` and `#trace count_list;;` first)
<heisenberg> I'm about to try but I never used trace
<heisenberg> yeah ofc the 1+ is only in one place
<companion_cube> I'm off to dinner, good luck
<heisenberg> I wanted to know if there's a difference between putting it in one function or the other
<heisenberg> thanks :)
<companion_cube> but try it out in utop, you'll see
<heisenberg> oki!
<companion_cube> not much of a difference in this case
<heisenberg> cya
heisenberg has quit [Quit: leaving]
zolk3ri has quit [Remote host closed the connection]
zolk3ri has joined #ocaml
solrize has joined #ocaml
solrize has quit [Changing host]
solrize has joined #ocaml
sapristi_ has joined #ocaml
iCharlie has joined #ocaml
sapristi has quit [Read error: Connection reset by peer]
andreas__ has joined #ocaml
Jesin has joined #ocaml
heisenberg has joined #ocaml
<heisenberg> Hi, is anybody there ?
<octachron> Probably
<heisenberg> anyone may help me with trees? :\
spew has quit [Ping timeout: 240 seconds]
<Leonidas> heisenberg: that's rather unconcrete?
<Leonidas> have you tried /r/trees on reddit?
<reynir> Dunno if you get this Danish joke: "ingen cykler i træet"
<Leonidas> reynir: yep, a beautiful example of a b-tree, thanks.
<reynir> heh
<Leonidas> (bicycle-tree)
jnavila has joined #ocaml
<heisenberg> Leonidas not binary, the follwing struct ---> type 'a ntree = Tr of 'a * 'a ntree list
mk9 has quit [Quit: mk9]
heisenberg has quit [Quit: leaving]
mk9 has joined #ocaml
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
raphaelss has quit [Ping timeout: 256 seconds]
sapristi has joined #ocaml
sapristi_ has quit [Ping timeout: 248 seconds]
kakadu_ has quit [Remote host closed the connection]
slash^ has quit [Read error: Connection reset by peer]
jnavila has quit [Ping timeout: 264 seconds]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
pierpa has joined #ocaml
spew has joined #ocaml
spew has quit [Ping timeout: 240 seconds]
cbot has joined #ocaml
spew has joined #ocaml
Anarchos has quit [Quit: Vision[0.10.2]: i've been blurred!]
argent_smith1 has quit [Quit: Leaving.]
sapristi has quit [Remote host closed the connection]
sapristi_ has joined #ocaml
andreas__ has quit [Quit: Connection closed for inactivity]
zolk3ri has quit [Quit: leaving]
Jesin has quit [Ping timeout: 248 seconds]
sh0t has quit [Ping timeout: 256 seconds]
pmetzger has joined #ocaml