<ddosia>
could anyone suggest me good project to start with, to see how ocaml code is organized, how to manage dependencies etc
Simn has joined #ocaml
maattdd has joined #ocaml
<whitequark>
I wonder what is the point of OLabl
<adrien>
check the author and the date
<whitequark>
date, sure. what about the author?
maattdd has quit [Ping timeout: 268 seconds]
<adrien>
garrigues, 2002
kakadu_ has joined #ocaml
divyanshu has joined #ocaml
Kakadu has quit [Ping timeout: 240 seconds]
ulfdoz has left #ocaml []
nikki93 has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
pminten has joined #ocaml
robink has quit [Quit: No Ping reply in 180 seconds.]
vbmithr has quit [Ping timeout: 265 seconds]
robink has joined #ocaml
vbmithr has joined #ocaml
nikki93 has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
nikki93 has quit [Ping timeout: 240 seconds]
q66 has joined #ocaml
rand000 has joined #ocaml
divyanshu has joined #ocaml
whitequa1k has joined #ocaml
nk0_ has joined #ocaml
mfp_ has joined #ocaml
shalicke_ has joined #ocaml
maattdd has joined #ocaml
robink has quit [Quit: No Ping reply in 180 seconds.]
nk0 has quit [Ping timeout: 265 seconds]
whitequark has quit [Ping timeout: 265 seconds]
shalicke has quit [Ping timeout: 265 seconds]
robink has joined #ocaml
robink has quit [Changing host]
robink has joined #ocaml
shalicke_ is now known as shalicke
mfp has quit [Read error: Connection reset by peer]
WraithM has quit [Ping timeout: 265 seconds]
WraithM has joined #ocaml
zpe has joined #ocaml
<ddosia>
I wrote a module, how I can use it in utop?
<kakadu_>
#load "asdf.cmo"
<rks2>
#use "foo.ml"
<ddosia>
thanks, #use is convinient just to test things
<ddosia>
if I will need to update this module, could I just write #use again?
<def-lkb>
or #mod_use "...ml"
<adrien>
with a recent ocaml (or is that a utop extension?)
<def-lkb>
using again will introduce a new module in env: type declarations will be incompatible, etc. otherwise it'a common workflow with repl
<def-lkb>
adrien: introduced in 4.01 afaict
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
<ddosia>
if I do `man List` i can see List docs. How could I do same for Core.Std.List ?
<ddosia>
How do you usually read the docs?
cross_ has joined #ocaml
adrien_ has joined #ocaml
saarin_ has joined #ocaml
chris2_ has joined #ocaml
darkf has quit [*.net *.split]
WraithM has quit [*.net *.split]
robink has quit [*.net *.split]
Anarchos has quit [*.net *.split]
talzeus has quit [*.net *.split]
araujo has quit [*.net *.split]
iZsh has quit [*.net *.split]
saarin has quit [*.net *.split]
cross has quit [*.net *.split]
NaCl has quit [*.net *.split]
willb1 has quit [*.net *.split]
adrien_oww has quit [*.net *.split]
the-gibson has quit [*.net *.split]
chris2 has quit [*.net *.split]
adrien has quit [*.net *.split]
bitbckt has quit [*.net *.split]
gereedy has quit [*.net *.split]
_habnabit has quit [*.net *.split]
saarin_ is now known as saarin
the-gibson has joined #ocaml
the-gibson has quit [Changing host]
the-gibson has joined #ocaml
NaCl has joined #ocaml
robink has joined #ocaml
araujo has joined #ocaml
willb1 has joined #ocaml
adrien_oww has joined #ocaml
talzeus has joined #ocaml
iZsh has joined #ocaml
tane has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
WraithM has joined #ocaml
bitbckt has joined #ocaml
gereedy has joined #ocaml
_habnabit has joined #ocaml
Anarchos has joined #ocaml
xavierm02 has joined #ocaml
<xavierm02>
Hi. I was trying to memoize a recursive function but I can't make the recursive calls call the memoized version of the function. How should that be done?
avsm has joined #ocaml
<xavierm02>
Note that I know how to do it if I have my array and everything inside the function I want to memoize. But I'm trying to do it with a memoize function that can memoize any function.
xavierm02 has quit [Quit: Page closed]
<ggole>
Look up the args in a table, if they are there, return them, else make the recursive call and remember it in the table.
xavierm02-- has joined #ocaml
<ggole>
s/them/the value/
<ggole>
If you do it "from the outside", that will work but won't catch the internal recursive call
<Drup>
ddosia: I usually read ocamldoc html generated documentation
<Drup>
but for Core, it's a bit fucked up
<Drup>
I think most people just read the .mli
lordkryss_ has joined #ocaml
<xavierm02-->
ggole : I didn't explaine properly. I know that I need something inside to make it work but I want most of it outside. Something like that: http://pastebin.com/SHFBjuGu
<xavierm02-->
The point is to avoid duplicating code
<xavierm02-->
"I'd want to cache fib_mem's result" -> "I'd want to cache memoize's result"
ikaros has joined #ocaml
<ggole>
Oh, I see.
<elfring>
ddosia: In which kind of "projects" are you interested in? Have you got any imaginations for tasks that you would like to tackle with OCaml software?
BiDOrD has quit [Remote host closed the connection]
<ggole>
xavierm02--: I think you can just remove the argument
<ggole>
ie, let fib_mem = memoize fib 100
<xavierm02-->
That's how I oroginally wrote it but it gives and error:
<xavierm02-->
and fib_mem = memoize fib 100;;
<ddosia>
elfring: yes, I would prefer some simple projects just to understand how should I put my code, write Makefiles and whatnot. As for task types, I will use it for some simple modules, mostly data crunching
<ddosia>
elfring: data crunching, data parsing etc
<xavierm02-->
Error: this kind of expression is not allowed as a right-hand side of 'let rec'
<ggole>
Ah, right. You can't mutually recurse in that way.
<ggole>
You can construct a memoising fib entirely "from the outside", though
<elfring>
ddosia: Did you eventually follow my recent data analysis experiments here? Is a bit text processing interesting enough for you?
<ddosia>
elfring: yes
<elfring>
How do you think about to extend text length analysis in various ways for learning purposes?
<ddosia>
elfring: I think if I will have enough time for that, why not
<elfring>
ddosia: Would you like to look at extension and improvement possibilities for a discussed function like "map_count" once more?
<ddosia>
elfring: btw "yes" was answer to your second question. I haven't seen your data analysis experiments
<Drup>
ddosia: for _oasis examples, lwt is very good
<Drup>
the library is a bit complex for the code
<Drup>
batteries' code is nice, and well documented and tested
<Drup>
well, except Enum, don't read that
<Drup>
I must say I don't really read code for the sake of learning. A better way, imho, is to *contribute* code. If your code is bad, people will tell you how to improve it.
<Drup>
(and you will have to read it, but since you are going to modify it, you will understand it better)
q66 has quit [Ping timeout: 252 seconds]
<elfring>
ddosia: Do you find one of my feature requests interesting? Would you like to fiddle with any corresponding software development challenges?
<ddosia>
Drup: I want to write small utility and merely dont know ow to organize my code, what folders to create, how to handle dependencies, how properly write Makefiles
<Drup>
ddosia: don't write makefiles, use _oasis.
<ddosia>
Drup: that I am talking about, I even dont know what is it oasis
Anarchos has quit [Quit: Vision[0.9.7-H-20131020]: i've been blurred!]
q66 has joined #ocaml
<Drup>
you can start by looking that up, then :)
<ddosia>
elfring: I am not sure that I am ready for contributing yet, need more practice
<Drup>
baaah
<Drup>
just pick something and do it
<Drup>
you don't need to be ready :)
<Drup>
if you were ready, you would not learn that much, which is precisely the point :p
<elfring>
ddosia: I suggest to start with a single source file for an "interesting" programming task. Another approach would be to take a well-known and complete software "project" and learn through intensive analsis on how this works.
q66 has quit [Ping timeout: 252 seconds]
whitequa1k is now known as whitequark
q66 has joined #ocaml
ggole has quit [Ping timeout: 252 seconds]
xavierm02-- has quit [Quit: Page closed]
Anarchos has joined #ocaml
nikki93 has joined #ocaml
ggole has joined #ocaml
lordkryss__ has joined #ocaml
nikki93 has quit [Ping timeout: 264 seconds]
WraithM_ has joined #ocaml
talzeus has quit [Read error: Connection reset by peer]
talzeus_ has joined #ocaml
avsm has quit [Quit: Leaving.]
divyanshu has quit [Quit: Computer has gone to sleep.]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
q66 has quit [Ping timeout: 252 seconds]
q66 has joined #ocaml
talzeus_ has quit [Remote host closed the connection]
talzeus has joined #ocaml
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 252 seconds]
ygrek has quit [Ping timeout: 240 seconds]
aurynj has joined #ocaml
Secretmapper has quit [Quit: Leaving]
lordkryss_ has quit [Quit: Connection closed for inactivity]
Hannibal_Smith has joined #ocaml
elfring has quit [Quit: Konversation terminated!]
ygrek has joined #ocaml
shinnya has quit [Ping timeout: 268 seconds]
zzing has joined #ocaml
RMacy has joined #ocaml
Anarchos has joined #ocaml
zarul has quit [Quit: Leaving]
Nahra has quit [Quit: Lost terminal]
ygrek has quit [Ping timeout: 240 seconds]
elfring has joined #ocaml
BiDOrD has joined #ocaml
<companion_cube>
hcarty, adrien_, Drup: I removed Exceptionless modules
<pippijn>
why?
<adrien_>
you're breaking compat?
<Drup>
He's breaking EVERYTHING :D
<companion_cube>
\o/
<Drup>
(into pieces, more precisely :p)
<companion_cube>
pippijn: because I feel like it's a lot of duplicated code, I'd rather have suffixes that indicate safe functions
<adrien_>
Drup: oh? he is? I thought he was doing something new
<companion_cube>
well, this might be never merged
<gasche>
I think it would be better to split things while preserving compatibility as much as possible
pradeeproark has joined #ocaml
pradeeproark has quit [Client Quit]
Nahra has joined #ocaml
<companion_cube>
gasche: isn't Exceptionless supposed to be a incubator thing?
<companion_cube>
splitting things has to break some things anyway (some functions that would rely on unix)
<companion_cube>
and I think almost everyone wants Enum dead
<gasche>
the problem isn't changing Exceptionless itself
<gasche>
but rather than integrating the relevant functions in the main modules with "suffixes" is going to be very very hard to do in a *consistent* way
<companion_cube>
(I might move this commit to a separate branch)
<gasche>
I like better error handling, I like consistency *more*
<companion_cube>
yes, it's not that obvious, I agree
<companion_cube>
a possibility would be _safe as a unique suffix
<orbitz>
Core chooses _exn
<gasche>
besides it's not even that obvious that using suffixes is a better choice than a module
<mrvn>
don't suffix safe functions. sufix the unsafe ones.
<companion_cube>
orbitz: _exn would be better, but for the sake of compatibility with stdlib we can't
<gasche>
as you can locally open a module, whereas mass-removing of suffixes is not really an option
<companion_cube>
gasche: Exceptionless is very long
<orbitz>
IMO, compatiblewith stdlib is not a virtue :)
<mrvn>
cantstanya: Optionated isn't better
<companion_cube>
who? :D
<orbitz>
If consistency is important, breaking compatiblity with stdlib is important
<companion_cube>
you mark a point
<companion_cube>
(also, folds, etc.)
<companion_cube>
gasche: in that case I think the Exceptionless/Label modules should be as small as possible
<companion_cube>
meaning, we shouldn't copy functions that don't change between "regular" and "exceptionless"
<orbitz>
that is annoying then
<mrvn>
companion_cube: huh? Then would have to open w modules
<mrvn>
companion_cube: huh? Then would have to open 2 modules
<companion_cube>
I hate "open", I have to admit
<mrvn>
worse if you don't open and have to type different prefix every time
<companion_cube>
well, that's why I'd rather have everything in the same module
<orbitz>
Imagein stdlib compat isn't important, what is the superior alternative to using an _exn suffix?
<mrvn>
First thing I would do is: module M = struct include Foo.Common include Foo.Exceptionles end (or the other)
<companion_cube>
ah, _exn would be great indeed
<companion_cube>
mrvn: that shadows things
<orbitz>
ok
<companion_cube>
shadowing is dangerous
<mrvn>
companion_cube: no. you said they should be as small as possible. So no common functions.
<companion_cube>
mrvn: ideally I'd have no submodule
<companion_cube>
foo and foo_exn (or foo and foo_opt, for compatibility)
<mrvn>
companion_cube: and functions that don't throw an exception just "foo"? What if they later start raising one?
<companion_cube>
the stdlib doesn't break compatibility afaik
Anarchos has quit [Ping timeout: 240 seconds]
zarul has joined #ocaml
<jpdeplaix>
companion_cube: WHAT ?
<jpdeplaix>
no !
<companion_cube>
no what ?
<jpdeplaix>
« I removed Exceptionless modules »
<companion_cube>
that's not merged yet, don't worry :p
<companion_cube>
I didn't remove the functions
<jpdeplaix>
companion_cube: not that BatteriesExceptionless does an extensive use them
<jpdeplaix>
and I also do an extensive use of BatteriesExceptionless
<jpdeplaix>
so if this module is removed and merge I'll switch to core or do my own fork of batteries
<jpdeplaix>
merged*
nikki93 has joined #ocaml
<companion_cube>
well :/
nikki93 has quit [Remote host closed the connection]
nikki93 has joined #ocaml
<companion_cube>
at least those submodules could be renamed "Safe", which is more tractable than "Exceptionless" -_-
<orbitz>
Exceptionless is more accurate though :)
<companion_cube>
(would you like that gasche ?)
<orbitz>
what odes Sade actually mean
<adrien_>
no, Safe is _very_ bad
<adrien_>
because it means there's an "unsafe"
<adrien_>
and that it's by default
<companion_cube>
well, there is, no need to lie
<adrien_>
and you don't always know what makes them unsafe
<adrien_>
see the programming language shootout which refused to use -unsafe for ocaml code because of the name
<orbitz>
I think the biggest problem with Safe is: what does it mean? It's safe against exploits? Security? It is safe against running out of memory?
<ggole>
Could call them Total
<ggole>
(Although that is also a bit of a lie.)
<gasche>
that's also wrong
<gasche>
as they may loop
<orbitz>
Totally_exceptionless
<ggole>
That's not as common as throwing, though
<orbitz>
Exnless
<gasche>
you're wasting your time discussing the length of a name
<companion_cube>
that's important, sometimes
<companion_cube>
otherwise why would people prefer to use "List" rather than "BatList" ?
<orbitz>
Well, anyone that cares can awlays do module Exnless = Foo.Exceptionless
<gasche>
is changing the way Exceptionless work essential to the "split things up" branch?
<gasche>
I think the answer is no and that suggests it should be done independently
<companion_cube>
gasche: no, it's now in a separate branch
<gasche>
you say that the splitting-up "might never get merged"
<companion_cube>
well that depends partly on you
<gasche>
turning it into "companion cube's reinvention of All Things Batteries" is sure to make that as hard as possible
Thooms has quit [Quit: WeeChat 0.3.8]
<gasche>
I want to keep compatibility as much as possible, because that's what most useful to users
<companion_cube>
it did happen for 1 -> 2, didn't it?
<gasche>
not all breaches of compatibility are equal
<gasche>
breaking *some* stuff is not the same as breaking *a lot* of stuff
<companion_cube>
the point is, I'm thinking about batteries3, anyway, so it's worth thinking about what could be improved
<companion_cube>
I agree, not all changed have to be merged together
<companion_cube>
at once*
<gasche>
it's reasonable to sometimes consider breaking compat.
<gasche>
but it's not a 0-or-1 thing
<companion_cube>
no, I just mean that batteries3 is the right time to consider compat-breaking changes
<gasche>
I hope we can merge the splitting thing before that
<companion_cube>
(of course it's not a good idea to break everything just for the sake of breaking it)
<gasche>
even if it's not as satisfying before batteries3
<companion_cube>
gasche: splitting IS an incompatible change
<companion_cube>
necessarily
<gasche>
meh
<companion_cube>
(I had to remove one or two functions because they were in IO, which is used by every module, and depend on unix)
<companion_cube>
(namely: in_channel_of_string)
<companion_cube>
also, BatPervasives must be optional
<gasche>
we can do "optional" without breaking compatibility
<companion_cube>
how?
<companion_cube>
(there's a compatiblity module for those who prefer it, indeeed)
<companion_cube>
(just use "batteries.full" and "open Batteries", it should be almost the same)
ollehar has quit [Read error: Operation timed out]
rks2 has quit [Ping timeout: 240 seconds]
rks2 has joined #ocaml
<tizoc>
has anyone been successful when trying to install ctypes with opam on osx? for some reason it can't find libffi
<tizoc>
ok this is unrelated to libffi, the new clang version is the problem
maattdd has joined #ocaml
yacks has quit [Quit: Leaving]
rand000 has quit [Quit: leaving]
Anarchos has joined #ocaml
saarin has quit [Ping timeout: 240 seconds]
Hannibal_Smith has quit [Read error: No route to host]