boogie has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
nikki93 has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest96493
<darkf>
caseyjames: what about it?
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
ygrek has joined #ocaml
mcclurmc has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 245 seconds]
<caseyjames>
darkf: I'm unable to get it to compile and was wondering if there as anything obviously wrong?
<darkf>
caseyjames: what error are you getting? the only thing i see wrong is that your inner matches should probably be wrapped either in begin/end or parentheses
<caseyjames>
Error: Parse error: [expr] expected after "->" (in [match_case0]) # Characters 3-5: in ^^ Error: Parse error: illegal begin of top_phrase # Characters 12-15: List.rev (aux 0 (0,0) [] list);; ^^^ Error: Unbound value aux # Characters 1-7: encode (<) [60;61;62;50;51;52;80;79;78];; ^^^^^^ Error: This function is applied to too many arguments; maybe you forgot a `;'
mcclurmc has joined #ocaml
boogie has joined #ocaml
<caseyjames>
is it actually running for you?
patojo has joined #ocaml
boogie has quit [Ping timeout: 240 seconds]
dezzy has quit [Read error: Connection reset by peer]
dezzy has joined #ocaml
<darkf>
caseyjames: you have an arm _ -> _
<caseyjames>
is that wrong? I wasn't sure how to extract a tuple - what it would be if it wasn't the tuple
<caseyjames>
I'm very new to this, so this may be as obvious as it seems
<darkf>
caseyjames: _ doesn't bind, so if you want to return it as it is, a -> a or something would work
<darkf>
caseyjames: and I suggest you clean up the indentation a bit, I tried here http://ideone.com/pxQ40y but I didn't modify anything else besides add parens around match
<darkf>
not sure what the convention is between begin/end and parens though
ygrek has joined #ocaml
strmpnk has left #ocaml []
<caseyjames>
Hmm i copied the code from that link and changed _ -> _ to a-> a as well, but its still giving that error... could it be a core/janestreet thing?
<darkf>
caseyjames: you're not using core/janestreet stuff. but you do have type errors.
<darkf>
caseyjames: and i wouldn't shadow fst, it's a builtin to access the first element of a pair
whitequark has joined #ocaml
PM has joined #ocaml
Leonidas has joined #ocaml
<caseyjames>
darkf: Ahh, I didn't know that - I still uncertain about the whole shadowing this and how scoping works, though I'm slowly getting a better idea of it
<caseyjames>
darkf: do you know what the type error means: This expression has type (int * 'a) option but an expression was expected of type int * 'b ?
<darkf>
caseyjames: it means your value is an option type when it doesn't need to be (hint: remove the Some)
<caseyjames>
darkf: Ahh that was an artifact from a previous attempt. Does the _-> acc stuff make sense or is that wrong anyway? The result I'm getting is wrong [(0, 0, 2, 62); (2, 62, 6, 80)] instead of [(0,60,2,62); (3,50,6,80)] . I'm guessing its from the initial aux call
<darkf>
caseyjames: what does the function do?
<caseyjames>
makes intervals in the form (start index, start value, end index, end value) so in this example its ascending values in groups larger than 2
ollehar has quit [Ping timeout: 264 seconds]
tov_ is now known as tov
breakds has quit [Quit: Konversation terminated!]
talzeus has joined #ocaml
<pippijn>
today I had my first experience with SML
<pippijn>
and it's not bad
<pippijn>
but I don't like that so many things are ALL CAPS
<pippijn>
NONE | SOME foo
<pippijn>
STRING INTEGER ...
breakds has joined #ocaml
<whitequark>
REMINDS ME OF FORTRAN AND PUNCHED CARDS
<whitequark>
*cough*
struktured has joined #ocaml
<pippijn>
in fact
<pippijn>
the all caps names were what put me off SML some years ago
<pippijn>
I looked at it, found it repulsive, and didn't look further
shinnya has joined #ocaml
<orbitz>
This type is getting unwedily
cantstanya has quit [Ping timeout: 240 seconds]
Guest60186 has quit [Remote host closed the connection]
cantstanya has joined #ocaml
<caseyjames>
is anyone here stirring that might be willing to assist me with a function
breakds has quit [Remote host closed the connection]
ben_zen has quit [Ping timeout: 245 seconds]
<caseyjames>
two questions... is it well formed? I get a warning about | _ -> acc)... Also the values I'm getting are wrong. Its returning [(0, 0, 2, 62); (2, 62, 6, 80)]
<orbitz>
caseyjames: why don't you split it into more functions so you can test each function independetly?
<caseyjames>
orbitz: yes I have that feeling that it should be much more granular, but I'm just getting started so it's pretty touch and go just getting it to compile
<caseyjames>
orbitz: i installed OUnit and I'm planning on getting acquainted with in tomorrow.
yacks has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
struktured has quit [Ping timeout: 256 seconds]
<darkf>
caseyjames: regardless, you can start splitting those functions up now.
<pippijn>
does anybody know how SML/NJ generally compares to ocaml native code, performance-wise?
<caseyjames>
darkf: yes indeed I'm working with it now
<pippijn>
I did some benchmarking of my code against a similar SML implementation
<pippijn>
and my code was roughly the same speed
<ggole>
I wouldn't expect big differences
<ggole>
MLton might be quite a bit faster on certain kinds of code though
gour has joined #ocaml
<pippijn>
hmm
<pippijn>
I don't know how to use mlton
<pippijn>
Undefined structure TextIO.
<pippijn>
ok, I had to open MLton
<pippijn>
Undefined structure TIO.StreamIO.
<pippijn>
never mind..
<pippijn>
this program was made for sml/nj
<pippijn>
so much for "SML is a standard with multiple implementations"
<pippijn>
I was just randomly reading the MLton structure reference
<pippijn>
and I found it has a really cool feature called "share"
<pippijn>
maximizes sharing in the heap for the object graph reachable from x.
<pippijn>
and shareAll, which does it for the whole heap
<adrien>
blue: the windows builds of ocaml on jenkins are working again :)
<ggole>
"Maximizes sharing"?
ygrek has quit [Ping timeout: 248 seconds]
ttamttam has joined #ocaml
<pippijn>
ggole: "maximizes sharing in the heap by sharing space for equivalent immutable objects. A call to shareAll performs a major garbage collection, and takes time proportional to the size of the heap."
<ggole>
Oh
<ggole>
Right, this is possible because of SML's "no identity for immutable values" thing
<ggole>
Neat.
<pippijn>
what's that?
patojo has quit [Remote host closed the connection]
<ggole>
If you have Foo x in OCaml, you can compare it to another Foo x to see if it is "the same" (as opposed to just equal)
<ggole>
With ==
<ggole>
SML doesn't allow that iirc.
<pippijn>
ah
<pippijn>
mlton has a function for it
<ggole>
It's actually useful in one other circumstance
<pippijn>
MLton.eq compares pointers
<ggole>
if you write match x with Foo y -> Foo y, that can be compiled as just returning the original value.
<pippijn>
yes
<pippijn>
I usually write match some expression here with Foo y as x -> x
<ggole>
You can always rewrite an OCaml term to do the same
<ggole>
But sometimes it is a bit ugly
<ggole>
Right
yacks has joined #ocaml
<ggole>
(Usually turns up when you write foo bar = function ... and then discover that it would be nice to have the name of the second argument.)
<pippijn>
that's particularly useful in match expr here with Something | SomethingElse | Blah _ as x -> x
<adrien>
pippijn: I tried mlton a bit some time ago and I liked ocaml better :)
<ggole>
Oh, that too
<pippijn>
sml/nj seems nice, with a jit compiler
talzeus has quit [Remote host closed the connection]
<adrien_oww>
but iirc there are already zmq bindings
<linux>
adrien_oww: not for the newest version, and none for the czmq, which offers more functionality like authentication
<pippijn>
gour: maybe when my perl bindings mature, they can be used for ocaml+qt :)
<adrien_oww>
ok
<linux>
adrien_oww: do you see some mistake in my _oasis file?
<adrien_oww>
no, not really
<adrien_oww>
only thing I'd try is to put the entries on a single line but that might or might not change anything
<adrien_oww>
what is the error message?
ben_zen has joined #ocaml
ben_zen has quit [Ping timeout: 260 seconds]
Neros has joined #ocaml
<linux>
adrien_oww: i have unbound type errors, have to add the module name to the functions... stupid mistake
zos has joined #ocaml
zos has left #ocaml []
<adrien_oww>
:)
Neros has quit [Ping timeout: 240 seconds]
<linux>
adrien_oww: i fixed these mistakes, but i dont understand why i get this error in the socket.mli file : Error: Unbound type constructor Context.t
<linux>
shouldnt the context file be compiled, when i get to the socket file?
nikki93 has quit [Ping timeout: 245 seconds]
q66 has joined #ocaml
kay has joined #ocaml
kay is now known as Guest595
linux has quit [Quit: Leaving]
Drup has joined #ocaml
cdidd has quit [Remote host closed the connection]
Drup1 has joined #ocaml
Drup has quit [Ping timeout: 260 seconds]
cdidd has joined #ocaml
Drup1 is now known as Drup
Yoric has joined #ocaml
milosn has quit [Ping timeout: 260 seconds]
kizzx2 has quit [Quit: Leaving.]
nikki93 has joined #ocaml
milosn has joined #ocaml
darkf has quit [Quit: Leaving]
nikki93 has quit [Ping timeout: 264 seconds]
ontologiae has joined #ocaml
ontologiae_ has quit [Read error: Connection reset by peer]
ygrek_ has joined #ocaml
ggole has quit [Ping timeout: 240 seconds]
ygrek has quit [Ping timeout: 248 seconds]
andre____ has joined #ocaml
_andre has quit [Remote host closed the connection]
<gour>
pippijn: perl bindings for ocaml+qt?
* gour
is a bit confused
<Kakadu>
wut
ggole has joined #ocaml
ben_zen has joined #ocaml
ttamttam has quit [Quit: ttamttam]
ttamttam has joined #ocaml
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 276 seconds]
<yezariaely>
BatList.take_while is described to take the longest prefix matching the predicate. Shouldn't it be the shortest, because take_while (> 0) [1;2;3;0;1;2;3;0;99] is [1;2;3] and NOT [1;2;3;0;1;2;3;0]
<ggole>
0 is not > 0
<yezariaely>
ggole: well, yes?
<ggole>
So that explains your result.
<yezariaely>
i was confused about the mentioning of shortest/longest prefix.
<yezariaely>
is there a shortest?!
<ggole>
The shortest prefix would always be [], which isn't very useful.
<yezariaely>
ah, that is meant. ok thx.
<gour>
Kakadu: do you understand pippijn's point?
ygrek_ has quit [Ping timeout: 252 seconds]
ben_zen has quit [Quit: leaving]
<Kakadu>
gour: Em
<Kakadu>
pippijn: what point?
<reynir>
Kakadu: I think he means this: pippijn | gour: maybe when my perl bindings mature, they can be used for ocaml+qt :)
asmanur has quit [Ping timeout: 256 seconds]
<Drup>
this is so sad about the state of ocaml qt bindings that someone even imagine going through perl to do it.
<Kakadu>
I think that thay are talking about QtWidgets and not QtQuick
<Drup>
that's not the point =)
asmanur has joined #ocaml
<adrien_oww>
Drup: this has been mentionned for years
<adrien_oww>
except that was python + qt
<adrien_oww>
so not a huge surprise either
ollehar has joined #ocaml
<adrien_oww>
that said it's something we've known for a long time
<adrien_oww>
some things take longer to start in ocaml
<Drup>
adrien_oww: I know, but python, I can understand that the paradigm is more suited, or whatever. But *perl* T_T
<adrien_oww>
the reason we do them is because the reward is much better than the alternatives
<adrien_oww>
Drup: you won't write much perl anyway
<gour>
i'm however told that using lablgtk would be less adventure than ocamlpy
<Drup>
I said this, yes :D
<Kakadu>
I still can't get what is bad with my qtquick appraoch
<Kakadu>
except some codegeneration
<adrien_oww>
it looked fairly good to me
<Kakadu>
but if you don't like it you also should not to like ocamlyacc and menhir because it generated code too
<adrien_oww>
I'm sure there are improvements to be made but the approach is sound
<Drup>
Kakadu: I didn't try, so I can't tell. Don't take anything I'm saying against you ;)
<gour>
Kakadu: i consider that labl{gtk,qt}/wxocaml are better solution than going js_of_ocaml route...and will choose one of them
<Kakadu>
Why are you thinking so?
<Drup>
Kakadu: he needs C bindings
Neros has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
<ggole>
Is there any way to key tables reliably on the address of a value?
gustav___ has quit [Remote host closed the connection]
cdidd has quit [Remote host closed the connection]
<gour>
right, need for 3rd party C lib
ollehar has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
Neros has joined #ocaml
nikki93 has joined #ocaml
ygrek_ has joined #ocaml
Neros_ has joined #ocaml
Neros has quit [Ping timeout: 276 seconds]
nikki93 has quit [Ping timeout: 276 seconds]
Neros_ is now known as Neros
thomasga has joined #ocaml
skchrko has joined #ocaml
<ggole>
Sigh, yet again I waste time working around the fact that modules can't mutually recurse
<rks`>
can't they?
<adrien_oww>
ggole: aren't you making things that are too complicated?
<ggole>
Not at top level
<ggole>
No
<ggole>
Mutually recursive structures are not strange or wrong, they are perfectly natural
<ggole>
Which is why OCaml has and
<adrien_oww>
yes
<adrien_oww>
but if you have issues *again*, I'm wondering if you're not tring to overuse them :)
<ggole>
I'm not trying to use anything, I'm just writing code in a natural way and dealing with the issues that come up.
<ggole>
Unless you think putting one type and all of its operations in one file and another type and all of its operations in another file is "too complicated".
<adrien_oww>
I see; that said, having types in a dedicated module is often not worse
saml has joined #ocaml
<ggole>
That wouldn't actually work in this case. (The types are abstract: one contains instances of the other: I happen to need one of the operations on the containing type in the module of the contained type.)
<whitequark>
that sounds contrived
<ggole>
Great. I'll just inform the compiler that it is not a problem.
<bernardofpc>
is there a "canonical" substitute for Alt-Tab for completion under utop ?
<ggole>
(Sorry, bit annoyed here.)
yacks has joined #ocaml
beckerb has quit [Ping timeout: 245 seconds]
mort___ has quit [Ping timeout: 276 seconds]
cdidd has joined #ocaml
cdidd has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
beckerb has joined #ocaml
ollehar has joined #ocaml
cesar_ has joined #ocaml
cesar_ is now known as Guest86240
Yoric has quit [Ping timeout: 268 seconds]
nikki93 has joined #ocaml
nikki93 has quit [Ping timeout: 264 seconds]
redfire has joined #ocaml
Guest86240 has quit [Remote host closed the connection]
<johnelse>
Another ctypes question - is there any way to pass an OCaml string and have the C modify it in place?
<johnelse>
passing a (char Ctypes.array) works, but converting that into a string is a pain
<flux>
I don't see a trouble modifying the string in C
<flux>
Unix.read basically does this
<flux>
you cannot modify its length, though
<flux>
ah, ctypes
<flux>
never mind :-)
<johnelse>
heh, yeah :)
<flux>
sounds like something it should manage to do, though..
<flux>
or something it could be extended to do :-)
<johnelse>
yeah, I was hoping it would just work...the original string never gets modified though
boogie has joined #ocaml
<ggole>
Presumably there's a copy in there
<johnelse>
ggole: yeah, I think so
boogie has quit [Ping timeout: 264 seconds]
<saml>
is Core good?
tane has joined #ocaml
skchrko has quit [Quit: Leaving]
Yoric has joined #ocaml
talzeus has joined #ocaml
<toolslive>
define 'good'
<Drup>
saml: Core is big, bloated and under documented. The first can be seen as a good point, since you will find almost anything you want to find in a standard library, for the rest ...
<toolslive>
you can see that they have worked on it (stability, performance). But the style is a bit funky, and they do things like manual unrolling etc...
nikki93 has joined #ocaml
<saml>
thanks
nikki93 has quit [Read error: Connection reset by peer]
nikki93 has joined #ocaml
<saml>
should i use batteries instead?
<Drup>
that's your choice ;)
<Drup>
batteries is better documented and is compatible with the regular standard library but it's also quite smaller.
<toolslive>
it all depends on what you need.
<saml>
i'm reading real world ocaml. it does open Core.Std
<toolslive>
if you look at the author, you can see there is a bit of bias ;)
<Drup>
saml: oh, if you're reading rwo, go with core for now, the book is written to be used with Core
Kakadu has quit []
<saml>
maybe i'll read manual instead
<toolslive>
like I said. it depends on what you need. rwo is fine, Core is fine, stdlib is really limited, and for most things you need, there is something in the opam repo.
Kakadu has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
<gour>
what build system you recommend to become familiar with in the long term?
<pippijn>
depends on your requirements
Yoric has quit [Ping timeout: 245 seconds]
Kakadu has quit []
<gour>
bulding whole project: libs + executables and (maybe) included sources for 3rd party C lib as well as documentation (dunno what's recommended within ocaml, maybe python's reST/sphinx)
<Drup>
gour: usually, ocaml documentation is done with just ocamldoc
<gour>
Drup: that's for API docs, right? here i mean end-user docs like user's manual
<adrien_oww>
I'll hate you for bundling other libs in your code
<toolslive>
gour: you can do it with ocamlbuild or oasis, some people use make (or omake)
<Drup>
gour: you can do proper documentation with ocamldoc too.
<gour>
i'd like avoid writing make files and have something which is multi-platform ready
ttamttam has quit [Quit: ttamttam]
<gour>
Drup: ohh, that's new for me...any 'standard' markup?
<Drup>
gour: yeah, ocamldoc's one x)
<gour>
iow, some build system ala cmake/waf/scons, but possibly without extra deps using ocaml tool...
<pippijn>
I use markdown or pod for user docs
<adrien_oww>
I use asciidoc for that
<adrien_oww>
ocamldoc is also good
<Drup>
it's quite limited markup, but it's often enough and well integrated. You can do link in the documentation easily
<gour>
asciidocs is nice, except its docbook-based toolchain, FOP & co,
<adrien_oww>
the code is weird but it works
<gour>
reST/sphinx looks better to me
<Drup>
ocamldoc markup is indead quite weird
<pippijn>
sphinx is nice
* gour
nods
<pippijn>
ocamldoc markup is broken, but I don't remember in what way
<pippijn>
and perhaps it was fixed
<Drup>
pippijn: not very helpful :D
<gour>
i also plan to use python static-site-generator for my sites (writing usign reST)
<pippijn>
gour: good
beckerb has quit [Ping timeout: 264 seconds]
<pippijn>
I have that
<Drup>
gour: ocamldoc generated html too, if that's any help
<pippijn>
except in perl, and with md/pod
<Drup>
and you can "theme" it
<gour>
what do you think about ocp-build?
<gour>
Drup: well, i'd liek to have pdf output as well
<Drup>
yes, you have that
<Drup>
well, latex, but it's the same
<adrien_oww>
(patoline!)
<adrien_oww>
I've never come across ocp-build in practice
<gour>
there is yet another build tool, is it called jenga or something
<pippijn>
right, jenga was recommended to me recently
<pippijn>
I haven't looked into it
<pippijn>
(in detail)
<Drup>
gour: ocaml build system is the subject of lots of agitated debates
<gour>
it looks as (too) many build systems...hopefully not all half-baked :-)
<pippijn>
omake is quite mature
<pippijn>
unfortunately also seems to be unmaintained
<Drup>
I would not say half-baked, but none of them is perfect
<gour>
i believe we deserve something better than *make in 21st century
<pippijn>
omake is very close to being perfect
<pippijn>
gour: omake isn't *make
<gour>
ohh, i thought it's jsut some extended/improved make
<pippijn>
no, it's a purely functional programming language
<pippijn>
with lots of functions for manipulating and querying dependency graphs
<pippijn>
the syntax is a bit similar to make, but its semantics are wildly different
ocp has joined #ocaml
ollehar has quit [Read error: Operation timed out]
<gour>
is oasis 'based' on cabal?
<Drup>
no, and it's not the same goal
<gour>
latest omake three years ago..that does not look good
<Drup>
cabal is a package manager, oasis is not
<pippijn>
gour: yeah, that's a pity
<gour>
i mean - syntax-wise?
<pippijn>
it's mature and works very well, but it has 1 bug which doesn't get fixed
<pippijn>
which you will likely never run into :)
<pippijn>
but still :\
ocp1 has joined #ocaml
ocp has quit [Read error: Connection reset by peer]
<gour>
i was thinking about "OASIS takes most of his ideas from Cabal which is the same kind of tool for Haskell"
<Drup>
it may have been true at some point in the past, maybe.
<gour>
interesting
<gour>
i read that work is going on for 0.4.0 release
<gour>
for ocp-build i'm happy seeing 'ocp-build uninstall' target, but then wonder what about OPAM
redfire has quit [Quit: WeeChat 0.4.1]
zpe has quit [Remote host closed the connection]
<Drup>
those install/uninstall target from buildsystems just install the local builded code with ocamlfind
<Drup>
most of opam work is to handle dependencies, download packages and do noodle knots. It doesn't care about the way to build and leave that to the project's build systems
<gour>
thanks...sounds logical considering that the same folks work on both
<Drup>
ocp-build is not different than any other ocaml build system in this regard.
ocp1 has quit [Ping timeout: 246 seconds]
<gour>
maybe simpler?
yezariaely has quit [Quit: Leaving.]
<Drup>
I don't know, I never used it. just talking about the instalation/uninstall feature.
<mrvn>
Can opam build debian packages instead of installing?
<pippijn>
"The logic of semicolon being a separator and not a terminator is totally incomprehensible for beginners."
<pippijn>
I use it as terminator :)
<ggole>
Except in lists? Or always?
<pippijn>
let foo () = insn1; insn2; insn3; ;;
<mrvn>
pippijn: +()
<Drup>
which is incorrect if you don't use ";;"
<pippijn>
Drup: indeed
<pippijn>
I do that for functions returning unit only
ontologiae has quit [Ping timeout: 245 seconds]
<pippijn>
mrvn: right
ygrek_ has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
Drup has quit [Ping timeout: 245 seconds]
<pippijn>
"A function print of type 'a -> unit"
<companion_cube>
not worse than (=): 'a -> 'a -> bool
<pippijn>
for that to do anything useful, you need runtime type info
<pippijn>
otherwise you just get nested tuples with int leaves
<pippijn>
and some floats
<ggole>
Yep: annoyingly, the toplevel often knows the type, so it seems like it should be possible.
<ggole>
But it isn't.
<companion_cube>
or you need typeclasses
<pippijn>
companion_cube: Show?
<ggole>
Maybe you could do some #install_printer hack
<ggole>
But it wouldn't be solid.
<companion_cube>
pippijn: yep
<companion_cube>
in OCaml I would have a typeclass Show 'a with print : Buffer.t -> 'a -> unit
<companion_cube>
(or out_channel if you prefer)
djcoin has quit [Quit: WeeChat 0.4.1]
<ggole>
(And #install_printer isn't enough for, say, polymorphic containers)
<pippijn>
companion_cube: formatter :)
<companion_cube>
I dislike Format, now
<companion_cube>
it's really too slow and annoying
<pippijn>
yes, it really is slow
<companion_cube>
instead I print in buffers ;)
<pippijn>
if performance matters at all, so do i
<companion_cube>
(because one cannot make a out_channel out of a buffer... And I need sprintf)
boogie has joined #ocaml
<mrvn>
yeah, how does the toplevel know the type and why can't the compiler export those functions for bytecode too?
nikki93 has quit [Remote host closed the connection]
<ggole>
It talks to the compiler, which of course knows about types
<mrvn>
ggole: you mean interpreter
<ggole>
The interpreter operates on bytecode, which is produced by... the compiler.
<mrvn>
so the bytecode must have some type classes and/or pretty printer functions for each type. So why can't I use them too? Why can't I use them with ocamlopt?
<ggole>
There's multiple backends, one of which is the native-code stuff that you are probably thinking about.
<ggole>
I don't think bytecode has any such thing.
<ggole>
IIRC the toplevel keeps a mapping of types to printers
<ggole>
Which you can extend with #install_printer
saml has quit [Quit: Leaving]
<mrvn>
ggole: when I load a module with type t = Foo | Bar it prints out "Foo" or "Bar" for the values 0 and 1. It needs to know the strings from somewhere.
thomasga has quit [Quit: Leaving.]
zpe has joined #ocaml
<ggole>
From the .cmi, I guess?
<ggole>
If you load a module with only type t in the interface, it can't do any more than <abstr>
<mrvn>
likely.
<mrvn>
The point is when I use ocamlopt that pretty printer doesn't exist or is inaccessible.
<ggole>
No different to ocamlc.
zpe has quit [Remote host closed the connection]
<ggole>
As far as I know, that is.
<mrvn>
somehow the toplevel can do PRETTY_PRINTER_OF(t). I want that everywhere.
<ggole>
It would be nice.
Neros has quit [Read error: Operation timed out]
<companion_cube>
mrvn: the proper way to do it would be a Show typeclass, with deriving
<companion_cube>
this way you would have access to it within the language
chrisdotcode has joined #ocaml
Neros has joined #ocaml
AltGr has quit [Quit: Konversation terminated!]
Drup has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
ygrek_ has quit [Ping timeout: 248 seconds]
nikki93 has joined #ocaml
nikki93 has quit [Remote host closed the connection]
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
<wmeyer>
adrien: now all works, thanks
<wmeyer>
I will have some time this week, but it will be a busy week :-)
ng__ has joined #ocaml
saml has joined #ocaml
<toolslive>
@ggole, there is a 'deriving' syntax extension library.
fayden has quit [Quit: Bye]
<adrien>
I won't be there this week-end
<adrien>
so probably better to wait a bit
tianon has quit [Ping timeout: 260 seconds]
<ng__>
this code calcule the factorial of a number. I need to multiply this value(factorial) by a constant and divide. how can i do this? i try |_ -> 1/(number * (exe (number - 1))), but not working
<Kakadu>
it means code is parametrized by two type variables
<Kakadu>
`code` is name of type
<Kakadu>
not code in whole
<saml>
so spine_arr is an array of code (of 'a,float)
<Kakadu>
yep
<ggole>
Isn't it nice how it's backwards?
<saml>
that was real confusing
gour_ is now known as gour
<ggole>
Yeah
<Kakadu>
('a,float) code ==== Code<Float,A> in java-like
<saml>
ah the order of type variables is reversed too
derek_c has joined #ocaml
<Kakadu>
('a*float) code ====== Code<Pair<Float,A>> in Java-like lanquage
<Kakadu>
no, order is spelling mistake
<Kakadu>
:)
<Kakadu>
It doesn't matter beacause there is no strict mapping between two languages
<saml>
so far, he wrote normal code. and keep quoting and unquoting until it comipiles
<Kakadu>
> Putting OCaml in Prison: Compartmentalization for OCaml, Prashanth Mundkur (SRI International, USA) and Anil Madhavapeddy (University of Cambridge, UK)
<Kakadu>
Prison like jail? :)
nikki93 has quit [Remote host closed the connection]
ocp has quit [Ping timeout: 248 seconds]
mcclurmc has joined #ocaml
rwmjones has joined #ocaml
rwmjones has quit [Ping timeout: 248 seconds]
* gour
recalls that tomorrow is ZFS deadlock in 9.1-R, advised to not use ZFS, or upgrade to │ jrkotrla
<Kakadu>
gour: I expect that most interesting talk will be about GADTs
<Kakadu>
gour: and wxWidgets maybe:)
<gour>
:-)
<Kakadu>
So, are you seriously declined Javascript-based desktop applications?
<gour>
well, i'm told that in C primitives have to be rewritten in JS...otoh, i strongly believe that my use-case is still one of those where real desktop app is preferrable over browser version and/or trying to push html5/JS stuff
<gour>
especially considering i have to have normal ffi access to C libs
rwmjones has joined #ocaml
<Kakadu>
Well, integration with many third-party C libs can be untrivial
<gour>
you mean in genaral when called from ocaml or when using JS-based solution?
<Kakadu>
JS
<gour>
good :-)
<gour>
that's pro for real 'desktop' toolkit
<Drup>
gour: but ffi from js is really simple ;)
<gour>
really?
<Kakadu>
gour: really
<Drup>
I will say it again : Really. :]
<gour>
in my case calling C lib involves number crunching
<Kakadu>
me too: REALLY
<Drup>
gour: I said js ffi, not C ;)
<gour>
heh
<Drup>
calling C from js in a client is impossible, there is no point to talk about it
<Kakadu>
what toolkit is next step in your journey, gour?
<Drup>
it's possible with nodejs I think, but meeh.
<Kakadu>
this dynamic typing sucks in general
<gour>
Kakadu: not many choices...i, somehow eliminate Tk, then lablgtk is last resort if everything else fails, so i'll take closer look at lablqt and see what will happen with wxocaml
<Drup>
gour: why do you eliminate tk ? :p
<gour>
i don't like nodejs although i had to install npm to install some web stuff and i've to dive a bit into python/django to put some web sites together
<gour>
Drup: it seems it does not look good in any platform and just in maint. mode
<gour>
wx(ocaml) is not as modern as (labl)qt, but if it's going to be developed further, i could tolerate it
ocp has joined #ocaml
<gour>
i hope ocaml community will get together a bit to produce some decent gui bindings, i'll help and before have to learn some ocaml as well for writing custom libs for the app's back-end
ollehar has quit [Quit: ollehar]
<gour>
Kakadu: do you plan to work further on lablqt or you just provided enough as proof of concept?
tani has joined #ocaml
derek_c has quit [Ping timeout: 240 seconds]
<Kakadu>
I'm going to improve QOcamlBrowser to support "Go to definition" and "History". After that I don't know in what direction should I develop it. Maybe I will try ti write something for sailfish OS or Ubuntu Touch but I don't know what concretly
<Kakadu>
ANy ideas appriciated
<Drup>
Kakadu: I think gour was talking about the library itself
<gour>
right
<Kakadu>
Drup: To understand how to develop library I should know what functionality it lacks => when nobody wants to use it I should write some app myself
<companion_cube>
oh, someone put a bencode package on opam
<companion_cube>
I should have done it before :]
tane has quit [Ping timeout: 276 seconds]
<gour>
i also hope to see some progress with wxocaml cause atm it does not build for me nor for some other user, but no offical comment at github's tracker :-/
<mrvn>
gour: does that use sexplib?
<gour>
mrvn: wxocaml?
<mrvn>
ENICK
<mrvn>
companion_cube: does that use sexplib?
<companion_cube>
mrvn: it's not Sexp, but an alternative format
<companion_cube>
B-encode, a very nice and simple format btw
<mrvn>
companion_cube: I now what it is. But it would be nice if it used the secplib types or an equivalent preprocessor module.
<Drup>
pippijn: Are you the one who did a rogue like game in ocaml ?
<companion_cube>
mrvn: you mean type_conv
<mrvn>
companion_cube: maybe.
<companion_cube>
actually I don't even know how complicated it is to interface with type_conv
<companion_cube>
my code just handles the serialization of B-encode values ^^
<pippijn>
Drup: yes, but it's not finished
<mrvn>
would be nice if you could write type t = int * int and you get a bencode_t and bdecode_t function.
<pippijn>
Drup: I'll work on it more after my graduation
<companion_cube>
it's not obvious, to say the least, how to write a generator for type_conv...
<Drup>
mfp: is your ocaml code for nodejs interfacing and all that opensource yet ?
<mfp>
Drup: nope, wanted to write a small sample application w/ it (was thinking about an autofocus + time tracker app)
<Drup>
anything is fine, I (and other people) are interested in the interfacing part ;)
<mfp>
but I'll probably push some trivial "hello world"-like thing instead then
<Drup>
yeah, it's fine :D
<Drup>
pippijn: you're serious with this contributing agreement thingy ? O_o
<pippijn>
Drup: I have to :\
<Drup>
why ?
<pippijn>
otherwise I can't change the licence later on
derek_c has joined #ocaml
Simn has quit [Ping timeout: 276 seconds]
Sim_n has joined #ocaml
<pippijn>
I don't know what I want with licences, yet
<pippijn>
I put GPL on almost everything, but maybe some things should be BSD or MIT or something
<Drup>
hum, I see
<pippijn>
I can no longer do that once another person contributed code
<Drup>
you should write that more clearly in the contributing file
<pippijn>
ok
nikki93 has joined #ocaml
<technomancy>
licenses that don't have patent protection clauses =(
<technomancy>
have pity on us poor hackers in the US with broken laws
<pippijn>
I don't know enough about licences, yet
<Drup>
pippijn: I suppose the big mess of law text is just to ask me to give up my right on the code I contributing, basically ?
<pippijn>
Drup: nope
<Drup>
I'm*
<pippijn>
Drup: not at all
<pippijn>
the point of the text is to preserve your rights to the code
<pippijn>
but to give me the right to do with it as I please
<pippijn>
which is
* pippijn
checks
<Drup>
but allow you to relicence it ?
<Drup>
you should *really* write that clearly
<mrvn>
Drup: that would be stupid
<pippijn>
"We agree to license the Contribution only under the terms of the license or licenses which We are using on the Submission Date for the Material or any licenses which are approved by the Open Source Initiative"
<pippijn>
Drup: yes, relicence, but only under OSI approved licences
<technomancy>
if you're just trying to defer the decision between copyleft and permissive, why not use the MPL?
<pippijn>
technomancy: because I have no clue what MPL does and doesn't
<mrvn>
pippijn: does that mean I can pick one or I have to follow all of them?
<pippijn>
mrvn: if you contribute to my code?
<mrvn>
pippijn: if whatever
<pippijn>
you can do whatever you want with your code
* technomancy
personally doesn't contribute to projects that require copyright assignment any more
<pippijn>
licence it however you want
<pippijn>
but if my project is under GPL, then the combined work is GPL
derek_c has quit [Quit: leaving]
<pippijn>
technomancy: you don't assign copyright
Sim_n is now known as Simn
<pippijn>
(a) You retain ownership of the Copyright in Your Contribution and have the same rights to use or license the Contribution which You would have had without entering into the Agreement.
<Drup>
tbh, If someone ask me to sign something to participate to an open source without explanations, my first instinctive reaction would just be to gtfo without trying to understand more
<technomancy>
pippijn: it's not about who owns it (to me) but just about barriers to contribution
<mrvn>
pippijn: copyright can belong to your boss. That's why when you want to contribute code to an FSF project they hire you.
<pippijn>
Drup: ok, I'll write a non-legalese document describing it
<pippijn>
technomancy: yes
<technomancy>
I've seen it kill community momentum on a number of existing projects like Emacs and Clojure
<pippijn>
technomancy: that's true, and sad
<mrvn>
technomancy: The reasons for copyright reassignment are so that the project can defend the rights in court or relicense the code later.
<technomancy>
basically pushes innovation out into the surrounding ecosystem, which works but is super annoying
<Drup>
mrvn: in europe, there is case law that said mostly, "only if it's related to the work your boss hired you for"
<technomancy>
mrvn: for Emacs I think it's defensible because GNU is a high-profile target legally speaking
<mrvn>
Drup: doh. they hire you to contribute. so they did hire you to contribute.
<mrvn>
contributing is certainly related to contributing.
<Drup>
mrvn: not the point, I was talking about your *usual* boss
<mrvn>
Drup: well, the usual work arangement has working hours. If you develope in that time or use company resource then things change too
<Drup>
anyway
<mrvn>
Note to self: never git commit during working hours.
<Drup>
pippijn: do you have a procedural map generator in it ?
pkrnj has joined #ocaml
<pippijn>
Drup: map generator?
<pippijn>
Drup: that is just the client
<pippijn>
Drup: map generation happens in the (C++) server
<Drup>
huh, C++ server
Kakadu has quit [Ping timeout: 260 seconds]
gour has quit [Quit: WeeChat 0.4.1]
<kerneis>
also, relicensing later is sometimes possible but a real, real, real pita
<kerneis>
see the example of VLC
<Anarchos>
mrvn or change the timestamps when back at home
<Drup>
pippijn: his the "widget" ncurse part separated ? is it mlwidget ?
<pippijn>
yes
<Drup>
s/his/Is*
<pippijn>
I started working on mlwidget for this client
<pippijn>
but then I got stuck in the design of mlwidget
<pippijn>
and then my master's thesis started
<Drup>
pippijn: you should really put that part into LGPL and get this agreement out of the way
pozzy has joined #ocaml
<Drup>
pippijn: I can understand for the game itselft, but a widget library, there is no point.
<pippijn>
yes, mlwidget
<pippijn>
I'll do that
<Drup>
you're not going to have millions of contributors anyway
<pippijn>
Drup: if I had millions of contributors, I wouldn't have an agreement
<Drup>
pippijn: if you have only two contributors, you can just ask the other one to agree when you want to relicence and it's ok.
<pippijn>
Drup: yes, provided I can still find that person
<Drup>
pippijn: it you have a contributor, you're going to take care of him, aren't you ? :D
<pippijn>
certainly, but I don't know whether he'll still be interested after some years
<pippijn>
maybe after many years, and I haven't touched the thing in ages
<pippijn>
then a new licence comes out and I want to use it
<pippijn>
but can't, because I have to dig out that contributor
<pippijn>
I just want to keep my freedom to do with my code what I want
<pippijn>
if someone makes some small contributions, I don't want to lose that
<technomancy>
"or later version" clauses usually cover you there
<pippijn>
technomancy: then I can't change from GPL to MPL or something
<Drup>
(it sounds to me you're doing a variation of premature optimisation ...)
<pippijn>
or maybe later there will be a better licence than GPL
<pippijn>
if it's a joint project with many contributors, and I'm one of them, then there doesn't have to be an agreement
<pippijn>
it's just a joint effort then
<technomancy>
it's a high price to pay for a hypothetical
<Drup>
(highly hypothetical, if you ask me)
<technomancy>
I was able to relicense a project with ~45 contributors from GPL->EPL, FWIW
<technomancy>
2 people were unreachable, but their contributions were <15 LOC
<technomancy>
under the copyright threshold according to GNU
<reynir>
What are you working on, pippijn ?
Yoric has quit [Ping timeout: 245 seconds]
cdidd has quit [Remote host closed the connection]
<pippijn>
reynir: a lot
<Drup>
pippijn: IMHO, this will just scare contributors away. It's hard enough to find contributors for projects like that, you're putting an extra layer of PITA.
<kerneis>
wait, technomancy, you are the author of Leiningen?
<Drup>
pippijn: anyway, tell me when/if you change that for mlwidgets, I will look at it then.
<pippijn>
Drup: ok
<technomancy>
kerneis: yeah
<Drup>
also, how am I suppose to compile this ?
<kerneis>
omg
<kerneis>
I should google irc nicknames more often
<kerneis>
(and also, note assume that people on #ocaml only write ocaml code)
<Drup>
pippijn: I got "can not find OMakeroot or Root.om" when doing "omake" in the root directory of the project
tani has quit [Quit: Verlassend]
<technomancy>
I'm probably missing something obvious, but what's the difference between these two snippets: http://p.hagelb.org/completion.html
<technomancy>
I would rather use let ... in, but I can't tell why it refuses to compile in this case
<pippijn>
Drup: get pippijn/obuild
<pippijn>
run $obuildpath/script/obuild
<Drup>
seriously ? urk
<Drup>
this is really not reasonable :/
<pippijn>
I'm not quite ready with my ecosystem, yet
arquebus has joined #ocaml
arquebus has quit [Quit: Konversation terminated!]
oriba has joined #ocaml
fayden has quit [Ping timeout: 248 seconds]
<technomancy>
I don't understand precedence rules =( how would I change this into a signature returning a string option? (funptr_opt (string @-> int @-> returning string))
darkf has quit [Read error: Connection reset by peer]
thomasga has quit [Quit: Leaving.]
darkf has joined #ocaml
saml has quit [Quit: Leaving]
fayden has joined #ocaml
Drup has quit [Quit: Leaving.]
Anarchos has quit [Quit: Vision[0.9.7-H-280704]: i've been blurred!]
ben_zen has joined #ocaml
redfire has quit [Quit: WeeChat 0.4.1]
thomasga has joined #ocaml
thomasga has quit [Client Quit]
ollehar has joined #ocaml
<ng__>
ok, one more doubt, i want "push" value of a function, how i do this? i put let function = pow n ;
<ng__>
and return an error
pkrnj has quit [Quit: Computer has gone to sleep.]
tobiasBora has quit [Remote host closed the connection]
tobiasBora has joined #ocaml
<emias>
[A
nikki93 has quit [Remote host closed the connection]