<keep_learning>
I have cloned it in my directory (/home/users/u5935541/Mukesh/Code/EncryptionSchulze/code/Binding) and added the Java's DateFormat class example in same directory (/home/users/u5935541/Mukesh/Code/EncryptionSchulze/code/Binding)
iAmDecim has quit [Ping timeout: 268 seconds]
<keep_learning>
with change in path of jar file (let () = Java.init [| "-Djava.class.path=ocaml-java/_build/default/srcs/java_stubs/ocaml-java.jar" |])
<keep_learning>
When I am running jbuilder build test.exe then I am getting error Error: Library "ocamljava.camljava" not found.
<keep_learning>
Any idea how to resolve this ?
iAmDecim has joined #ocaml
sonologico has quit [Ping timeout: 245 seconds]
iAmDecim has quit [Ping timeout: 268 seconds]
iAmDecim has joined #ocaml
sonologico has joined #ocaml
<keep_learning>
Nevermind, I got it running using makefile.
<Ou42>
they probably did and I"m just reverting back to pure noobieness
<Ou42>
but if a "Function" using the let blah x y = ... format doesn't include the "z" argument, is it easier to rewrite the sig as: let blah x y = funcion | z -> ? or to return a function from this function?
<Leonidas>
Ou42: usually it is easier to just add a z argument
<Leonidas>
but it depends on your code
<Ou42>
if I can do that, then I wouldn't have to return a function! :D
<Ou42>
so far, I haven't added or subtracted args, but the grader does allow adding keyword "function" after the =
<Ou42>
patern matching on the un-named arg has been demo'd before.
<Fardale>
Do you know what can be the type a function that return a function ?
<Ou42>
I thank you all. apologies for the cryptic Q's. I'm trying not to have you do the HW for me. ;o)
<Ou42>
and it's also 4am.
<Ou42>
I was able to typecheck before coming to #ocaml, but then it didn't match what they wanted. so I wrote a function, but not the function they wanted.
<Ou42>
here is the HW: function iter_rel: 'e rel -> int -> 'e rel
<Ou42>
where: type 'e rel = 'e -> 'e list
<Ou42>
if I can use the "= function" trick, then I have access to the ... int(?) the 'e, right? and then I'd only have to return a List of 'e, right?
<Ou42>
for clarity, HW == homework.
<Fardale>
I don't understand your question
<Ou42>
The assignment gives the function signature and we cannot change it AFAIK.
<Ou42>
They gave: let rec iter_rel rel n = "put your code here";;
<Ou42>
but in previous tasks I've been able to add "function" after the =
<Ou42>
and it pass the grader.
<Fardale>
With the let binding you can define a function in an other function
<Fardale>
So I can write let f x y = let g z = x + y + z in g
<Ou42>
one would assume, but my FP skills are very lacking!
<Ou42>
yeah, that's rather confusing for me. but TYVM
<Ou42>
the other flag is that they put in the "rec" in the function sig.
<Ou42>
so they are suggting to recursively call the outside function
<Ou42>
suggesting*
<Ou42>
I thank you all for you time & help! Definitely will check out the book. Gotta catch some Z's.
<Ou42>
TTFN
Ou42 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
sagotch has joined #ocaml
waleee has joined #ocaml
Haudegen has joined #ocaml
sagotch has quit [Ping timeout: 268 seconds]
sagotch has joined #ocaml
jao has joined #ocaml
troydm has quit [Ping timeout: 268 seconds]
troydm has joined #ocaml
ggole has joined #ocaml
gravicappa has quit [Remote host closed the connection]
jaar has quit [Ping timeout: 246 seconds]
keep_learning has quit [Remote host closed the connection]
jao has quit [Ping timeout: 246 seconds]
sammie has quit [Ping timeout: 250 seconds]
slamzy12345 has joined #ocaml
spew has joined #ocaml
slamzy1234 has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
jaar has joined #ocaml
marvin2 has joined #ocaml
waleee has quit [Quit: WeeChat 2.3]
slamzy12345 has quit [Remote host closed the connection]
ziyourenxiang_ has joined #ocaml
ziyourenxiang_ has quit [Remote host closed the connection]
ziyourenxiang has joined #ocaml
bjs29 has joined #ocaml
bjs29 has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
sagotch has quit [Quit: Leaving.]
Haudegen has quit [Remote host closed the connection]
marvin2 has quit [Ping timeout: 244 seconds]
jao has joined #ocaml
ggole has quit [Quit: ggole]
FreeBirdLjj has quit [Remote host closed the connection]
slamzy12345 has joined #ocaml
fraxamo has joined #ocaml
ziyourenxiang has quit [Ping timeout: 268 seconds]
jnavila has joined #ocaml
al-damiri has joined #ocaml
marvin2 has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
jnavila has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
jnavila has joined #ocaml
pbodev1 has joined #ocaml
bartholin has joined #ocaml
ygrek__ has joined #ocaml
regnat[m] has quit [Remote host closed the connection]
yetanotherion[m] has quit [Remote host closed the connection]
peddie has quit [Remote host closed the connection]
smondet[m] has quit [Remote host closed the connection]
equalunique[m] has quit [Remote host closed the connection]
drsmkl[m] has quit [Remote host closed the connection]
Haudegen[m] has quit [Remote host closed the connection]
Bluddy[m] has quit [Remote host closed the connection]
spectrumgomas[m] has quit [Read error: Connection reset by peer]
rgr[m] has quit [Remote host closed the connection]
Walter[m] has quit [Remote host closed the connection]
bglm[m] has quit [Read error: Connection reset by peer]
remix2000[m] has quit [Read error: Connection reset by peer]
copy` has quit [Read error: Connection reset by peer]
hdurer[m] has quit [Remote host closed the connection]
gideonsmeding[m] has quit [Remote host closed the connection]
srenatus[m] has quit [Remote host closed the connection]
cgenie[m] has quit [Remote host closed the connection]
magic_gum[m] has quit [Read error: Connection reset by peer]
jimt[m] has quit [Write error: Connection reset by peer]
dl3br[m] has quit [Remote host closed the connection]
aspiwack[m] has quit [Read error: Connection reset by peer]
Multiocracy[m] has quit [Remote host closed the connection]
juxt[m] has quit [Remote host closed the connection]
ttt123[m] has quit [Remote host closed the connection]
isaachodes[m] has quit [Read error: Connection reset by peer]
flux[m] has quit [Read error: Connection reset by peer]
jnavila has quit [Ping timeout: 246 seconds]
aspiwack[m] has joined #ocaml
iAmDecim has joined #ocaml
iAmDecim_ has quit [Ping timeout: 260 seconds]
iAmDecim has quit [Ping timeout: 250 seconds]
asymptotically has quit [Remote host closed the connection]
asymptotically has joined #ocaml
kakadu_ has joined #ocaml
drsmkl[m] has joined #ocaml
dl3br[m] has joined #ocaml
bglm[m] has joined #ocaml
equalunique[m] has joined #ocaml
Haudegen[m] has joined #ocaml
copy` has joined #ocaml
flux[m] has joined #ocaml
srenatus[m] has joined #ocaml
smondet[m] has joined #ocaml
peddie has joined #ocaml
hdurer[m] has joined #ocaml
Multiocracy[m] has joined #ocaml
remix2000[m] has joined #ocaml
spectrumgomas[m] has joined #ocaml
yetanotherion[m] has joined #ocaml
jimt[m] has joined #ocaml
Bluddy[m] has joined #ocaml
cgenie[m] has joined #ocaml
isaachodes[m] has joined #ocaml
rgr[m] has joined #ocaml
juxt[m] has joined #ocaml
magic_gum[m] has joined #ocaml
gideonsmeding[m] has joined #ocaml
ttt123[m] has joined #ocaml
Walter[m] has joined #ocaml
regnat[m] has joined #ocaml
jnavila has joined #ocaml
iAmDecim has joined #ocaml
iAmDecim has quit [Ping timeout: 250 seconds]
Cypi has quit [Ping timeout: 244 seconds]
yetanotherion[m] has quit [Remote host closed the connection]
smondet[m] has quit [Read error: Connection reset by peer]
drsmkl[m] has quit [Remote host closed the connection]
dl3br[m] has quit [Read error: Connection reset by peer]
bglm[m] has quit [Read error: Connection reset by peer]
regnat[m] has quit [Read error: Connection reset by peer]
remix2000[m] has quit [Remote host closed the connection]
Bluddy[m] has quit [Remote host closed the connection]
Multiocracy[m] has quit [Remote host closed the connection]
peddie has quit [Write error: Connection reset by peer]
jimt[m] has quit [Remote host closed the connection]
gideonsmeding[m] has quit [Remote host closed the connection]
juxt[m] has quit [Remote host closed the connection]
magic_gum[m] has quit [Remote host closed the connection]
isaachodes[m] has quit [Remote host closed the connection]
Walter[m] has quit [Remote host closed the connection]
cgenie[m] has quit [Remote host closed the connection]
spectrumgomas[m] has quit [Remote host closed the connection]
aspiwack[m] has quit [Remote host closed the connection]
equalunique[m] has quit [Read error: Connection reset by peer]
flux[m] has quit [Read error: Connection reset by peer]
Haudegen[m] has quit [Remote host closed the connection]
copy` has quit [Read error: Connection reset by peer]
srenatus[m] has quit [Remote host closed the connection]
hdurer[m] has quit [Read error: Connection reset by peer]
rgr[m] has quit [Read error: Connection reset by peer]
ttt123[m] has quit [Read error: Connection reset by peer]
jnavila has quit [Ping timeout: 246 seconds]
aspiwack[m] has joined #ocaml
Cypi has joined #ocaml
loli has joined #ocaml
<loli>
I have a question about how this piece of CPS code interacts with ocaml https://pastebin.com/mmdeje7J . it seems the proper cps version (splitting) keeps growing in memory as the numerator goes up (splitting 39 40, eats all memory), however the previous version I made, which is not in proper CPS format, does not have this issue, and the amount allocated stays rather stable. Does anyone have an insight as to
<loli>
why?
<loli>
(by rather stable I mean the repl does not start to eat through my memory and stays stable from my monitor, core_bench shows that it does allocate more when the numerator increases.))
jnavila has joined #ocaml
Haudegen[m] has joined #ocaml
equalunique[m] has joined #ocaml
drsmkl[m] has joined #ocaml
copy` has joined #ocaml
bglm[m] has joined #ocaml
flux[m] has joined #ocaml
dl3br[m] has joined #ocaml
srenatus[m] has joined #ocaml
smondet[m] has joined #ocaml
hdurer[m] has joined #ocaml
peddie has joined #ocaml
spectrumgomas[m] has joined #ocaml
Multiocracy[m] has joined #ocaml
remix2000[m] has joined #ocaml
jimt[m] has joined #ocaml
yetanotherion[m] has joined #ocaml
Bluddy[m] has joined #ocaml
cgenie[m] has joined #ocaml
isaachodes[m] has joined #ocaml
rgr[m] has joined #ocaml
regnat[m] has joined #ocaml
ttt123[m] has joined #ocaml
juxt[m] has joined #ocaml
gideonsmeding[m] has joined #ocaml
Walter[m] has joined #ocaml
magic_gum[m] has joined #ocaml
<loli>
nevermind I understand why it's behaving so poorly now, it seems I need to state (fun final -> loop (pred mult) (succ ratio) new_cps final), instead of letting it curry as if I don't it'll do some computation
<loli>
it's quite interesting how currying can work against you
fraxamo has quit [Quit: Leaving]
<lyxia>
loli: which one is the "proper" cps version
<loli>
proper cps form doesn't really save us much memory, sadly
iAmDecim has joined #ocaml
<lyxia>
the latter takes a while to compute (loop numerator denominator ident) before it can apply it to []
<lyxia>
all that to build a huge continuation
<loli>
yeah after thinking about it for a while, I realized, I've gotten too used to Haskell's lazy sematnics
<loli>
I'm just a bit surprised after fixing that issue, the allocation isn't much lower than the one that should be creating stack frames
<loli>
because with the old version, as soon as the lambda with final as it's argument gets sent an arg, we should be creating a lot of stack frames, or so I think
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
Cheaterman9 has joined #ocaml
Haudegen has quit [Remote host closed the connection]
Cheaterman9 has quit [Ping timeout: 246 seconds]
bartholin has quit [Remote host closed the connection]
slamzy12345 has quit [Ping timeout: 256 seconds]
Algebr` has joined #ocaml
slamzy12345 has joined #ocaml
Bronsa` has joined #ocaml
Haudegen has joined #ocaml
malina has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
slamzy12345 has quit [Ping timeout: 256 seconds]
asymptotically has quit [Quit: Leaving]
AvalancheCat has joined #ocaml
Jesin has quit [Quit: Leaving]
Bronsa` has quit [Ping timeout: 252 seconds]
TheRuralJuror has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
kakadu_ has quit [Remote host closed the connection]
jaar has quit [Ping timeout: 252 seconds]
slamzy12345 has joined #ocaml
<AvalancheCat>
hi. a new ocamlr here. i'm just learning fp/ocaml and I stumbled upon a case i'd like to ask you about. https://imgur.com/GJH070L <- the error is marked on the arguments to the "string list -> unit" func, but I naively would have hoped it to be in the func itself, or on the format string, because the format string is essentially declaring the type, although the function allows 'a so i would
<AvalancheCat>
expect the callers not to be blamed. is this a rule of some kind I should keep an eye out or...?
<companion_cube>
`(args : 'a list)` is unified with `string list` (the actual inferred type)
<companion_cube>
but it's not a failure, you're allowed to write types that are too general
<AvalancheCat>
by "you're allowed" I assume you mean the compiler allows me to do that? because it doesn't. since I declared the format string as %s it doesn't compile with int args
<companion_cube>
well I mean t he definition of the function is accepted, even though its actual type is `string list -> unit` and not `'a list -> unit`
<companion_cube>
then at the calling point you have a problem because you try to apply it to int list
Algebr` has quit [Remote host closed the connection]
Algebr` has joined #ocaml
slamzy12345 has quit [Ping timeout: 256 seconds]
demonimin has quit [Quit: bye]
<AvalancheCat>
that is what I am seeing yes. I assume then that this is something that happens often when writing new code? I was just really hoping it would point out that the format string was limiting my declared generic type and I'd have to fix that.
<AvalancheCat>
is this by chance documented somewhere?
demonimin has joined #ocaml
TheRuralJuror has quit [Remote host closed the connection]
<AvalancheCat>
because I see myself creating a whole lot of 'a functions and I would like to understand what are the cases that redefine the function arguments type, since getting the error in the caller is a pain. but knowing the fact that I am allowed to constrict the arg types in the body of a function is already helpful information in itself
<AvalancheCat>
or if any typed function call in the body can restrict the arg types of the parent then it is just something I have to learn to look out for
keep_learning has joined #ocaml
orbifx3 has joined #ocaml
Boniche0 has joined #ocaml
Boniche0 has quit [Remote host closed the connection]