fraggle_laptop has quit [Ping timeout: 252 seconds]
fraggle_laptop has joined #ocaml
beckerb has quit [Quit: Konversation terminated!]
beckerb has joined #ocaml
breakds has quit [Quit: Konversation terminated!]
beckerb has quit [Ping timeout: 245 seconds]
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
UncleVasya has quit [Read error: Connection reset by peer]
mcclurmc has quit [Ping timeout: 252 seconds]
ulfdoz has joined #ocaml
ousia has joined #ocaml
ontologiae has quit [Ping timeout: 252 seconds]
Kakadu has joined #ocaml
ttamttam has quit [Quit: ttamttam]
<flux>
ocamlbrew failed, last lines: OPAM has already been initialized. 'opam init --no-setup' failed.
RagingDave has joined #ocaml
<josch_>
hi, I have a module which one after another has functions A, B and C defined in that order. C uses A and B and B uses A so this order in the source works out. Unfortunately A and C logically belong together so it would make more sense to have A and C just one after another in the source - for the sake of easier documentation and readability.
UncleVasya has joined #ocaml
<josch_>
but I can't put B before or after A,C because C uses B (so it can't be after A,C) and B uses A (so it can't be before A,C)
UncleVasya has quit [Read error: Connection reset by peer]
<josch_>
is there an easy way to solve this dilemma?
<rks_>
josch_: there's an ugly way
<adrien>
let rec
<rks_>
declare your three functions as mutually recursives
<rks_>
let rec b = ...
<adrien>
even though I don't like it that much
<rks_>
and c = ...
<rks_>
and a = ...
<rks_>
(yep, me neither adrien)
<adrien>
tbh it's not bad
<adrien>
but don't abuse it
<adrien>
use it when needed (your case) but not always
<adrien>
another way is that some of your functions take a function as argument
<rks_>
josch_: the other option is to use a tool dedicated to that problem (I'd guess any existing literate programming tool)
<rks_>
but that's not as easy.
<adrien>
making the function a parameter of another function can work quite well too ;-)
<rks_>
(I'm not sure that would improve readability :))
<thizanne>
using an additional fioctional parameter is certainly cleaner than a let rec :p
<josch_>
yes, passing the functions around as parameters also works fine (I did that so far) but has the disadvantage of the extra (useless) parameter :)
<josch_>
the let rec .. and .. in solution wouldnt work well because A, B and C are not really connected much by topic
<adrien>
rks_: depends, depends
<josch_>
I can also split stuff into their own modules
<adrien>
josch_: it's not useless if it makes sense ;-)
<josch_>
then everybody knows of the others existance beforehand
fraggle_laptop has quit [Quit: Quitte]
zpe has joined #ocaml
anderse has joined #ocaml
<pippijn>
I prioritise avoiding let rec higher than logical order of functions in the source code
zpe has quit [Ping timeout: 245 seconds]
ulfdoz has quit [Ping timeout: 245 seconds]
djcoin has quit [Quit: WeeChat 0.3.9.2]
<thelema_>
josch_: put them together and document together in the .mli file
dsheets has quit [Ping timeout: 246 seconds]
ulfdoz has joined #ocaml
Yoric has joined #ocaml
Neros_ has joined #ocaml
Neros has quit [Ping timeout: 240 seconds]
mcclurmc has joined #ocaml
ttamttam has joined #ocaml
ontologiae has joined #ocaml
ttamttam has left #ocaml []
Neros_ has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 264 seconds]
dsheets has joined #ocaml
ollehar has joined #ocaml
ollehar1 has joined #ocaml
yezariaely has quit [Quit: changing servers]
_yezariaely has joined #ocaml
Neros has joined #ocaml
weie has joined #ocaml
ollehar has quit [Ping timeout: 245 seconds]
Tobu has joined #ocaml
_andre has quit [Quit: leaving]
pkrnj has joined #ocaml
awm22 has joined #ocaml
answer_42 has quit [Ping timeout: 276 seconds]
anderse has quit [Quit: anderse]
Nahra has joined #ocaml
darkf has joined #ocaml
RagingDave has quit [Quit: Ex-Chat]
thomasga has quit [Quit: Leaving.]
olaf_ has quit [Ping timeout: 248 seconds]
Snark has quit [Quit: leaving]
groovy2shoes has joined #ocaml
awm22 has quit [Quit: Leaving.]
emmanuelux has joined #ocaml
<SuperNoeMan>
how can I create an empty list of a specific type?
<SuperNoeMan>
like, I want a list of ityp's
<SuperNoeMan>
I've defined ityp, but I want the list the I create of ityp to be empty initialiy
<companion_cube>
SuperNoeMan: the empty list is 'a list
<companion_cube>
but you can do let (l : int list) = [] in .... I think
<SuperNoeMan>
ok
<Cypi>
indeed
<SuperNoeMan>
my bad
<companion_cube>
(not that I see what it could be used for)
<SuperNoeMan>
how dumb... I'm new to ocaml
<companion_cube>
that's ok :)
<companion_cube>
so, [] is 'a list, but when you build bigger lists they can have a more specific type
<SuperNoeMan>
anybody install this?
<SuperNoeMan>
I get a lot of errors with pathogen...
<SuperNoeMan>
I'm wondering if they just left something broke in their repo or if I can't use it with pathogen
<companion_cube>
hm, reminds me that I don't have the new opam shell completion files :/
<rks_>
(it will be loaded through pathogen)
<SuperNoeMan>
rks_: opam will install to my ~/.vim directory?
<rks_>
SuperNoeMan: I think so, let me check
<SuperNoeMan>
well I prefer pathogen...
<SuperNoeMan>
is there anything that I'm missing if I use pathogen? it sounded like you said the github repo located here: https://github.com/def-lkb/merlin
<SuperNoeMan>
wasn't as up to date...
<rks_>
SuperNoeMan: opam will let you ocamlmerlin/vim iin the share dir of your switch
groovy3shoes has quit [Client Quit]
<rks_>
which you can then copy in your .vim/bundle (and load with pathogen)
groovy2shoes has quit [Ping timeout: 264 seconds]
<SuperNoeMan>
I didn't know "let you ocamlmerlin/vim iin the share dir of your switch" was an action...
<rks_>
let you an*
<SuperNoeMan>
I still don't know what you mean
<SuperNoeMan>
is english your first language? it sounds like you're saying that opam will leverage pathogen
<rks_>
well SuperNoeMan, if you do « opam install merlin » in your .opam/your-switch/share
<rks_>
you will find a directory called "ocamlmerlin" with a subdirectory called "vim" which can be used as a pathogen bundle
pkrnj has quit [Quit: Computer has gone to sleep.]
<SuperNoeMan>
oh
ousado has quit [Ping timeout: 245 seconds]
<SuperNoeMan>
rks_: yeah, sorry I guess I was kinda playing around with a lot of different ocaml plugins, I was reading the info on most, but lost track
<SuperNoeMan>
man alive
<SuperNoeMan>
why does literally every ocaml plugin have an annoying bug where whenever doing a match statement, it gets the placement of the | wrong
<SuperNoeMan>
unless one has already been placed. It doesn't probably decide which set of | to line up with
ousado has joined #ocaml
<rks_>
SuperNoeMan: ocp-indent does that well
<rks_>
(unfortunately, ocp-indent doesn't do "on the fly" indenting in vim at the moment... i think)