ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
ygrek has joined #ocaml
AltGr has joined #ocaml
jeffmo has quit [Quit: jeffmo]
ncthom91 has joined #ocaml
seanmcl has joined #ocaml
pkrnj has joined #ocaml
JuggleTux has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
asQuirreL has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
seanmcl has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
Hannibal_Smith has quit [Quit: Leaving]
pyon has quit [Ping timeout: 244 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
thomasga has quit [Quit: Leaving.]
seanmcl has joined #ocaml
ygrek has quit [Remote host closed the connection]
pyon has joined #ocaml
ygrek has joined #ocaml
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
badkins has quit []
seanmcl has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
seanmcl has quit [Quit: Textual IRC Client: www.textualapp.com]
nojb has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
manizzle has quit [Ping timeout: 256 seconds]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
nojb` has joined #ocaml
palomer has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Quit: jeffmo]
ncthom91 has joined #ocaml
osa1 has quit [Ping timeout: 265 seconds]
enitiz_ has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
Intensity has quit [Ping timeout: 258 seconds]
olibjerd_ has joined #ocaml
nojb- has joined #ocaml
<nullcat_> let a = ref -1 will give me warning. I have to do "let a = ref (-1)" ...
palomer has quit [Quit: palomer]
<cmtptr> because it can't disambiguate unary minus from subtraction
<cmtptr> that's unfortunately a weirdness that comes with a lot of functional languages from what I've seen
darkf has joined #ocaml
<nullcat_> what are the other fp lang that don't handle this ?
<cmtptr> haskell
<cmtptr> and that pretty much sums up all of the functional languages I know
jabesed has quit [Ping timeout: 252 seconds]
swgillespie has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
beachjf777 has joined #ocaml
<beachjf777> If anyone wants to make real easy money, take a look of profit25. http://mymodule25.com/beachjf
keen____ has joined #ocaml
keen___ has quit [Read error: Connection reset by peer]
beachjf777 has left #ocaml [#ocaml]
Denommus has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ncthom91 has joined #ocaml
nullcat_ has quit [Ping timeout: 258 seconds]
ncthom91 has quit [Client Quit]
badkins has joined #ocaml
rwmjones has quit [Ping timeout: 246 seconds]
nullcat has joined #ocaml
rwmjones has joined #ocaml
idegen has quit [Quit: Leaving.]
olibjerd_ has quit [Ping timeout: 265 seconds]
<nullcat> ... there is spam bot even on IRC!?
badkins has quit []
olibjerd_ has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
palomer has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nojb has quit [Quit: nojb]
swgillespie has joined #ocaml
nojb` has quit [Ping timeout: 256 seconds]
nojb- has quit [Ping timeout: 252 seconds]
ncthom91 has joined #ocaml
palomer has quit [Quit: palomer]
olibjerd_ has quit [Ping timeout: 265 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BitPuffin|osx has quit [Ping timeout: 256 seconds]
matason has joined #ocaml
badkins has joined #ocaml
swgillespie has joined #ocaml
<struktured> List.iter (fun chan -> spam chan) (Channels.read "irc.freenode.net")
palomer has joined #ocaml
<swgillespie> has anybody in here tried using merlin with spacemacs?
<struktured> nullcat: you can also do let a = ref @@ -1
<nullcat> ..
<nullcat> wat...
<struktured> external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply"
<nullcat> struktured: why that works...
<nullcat> ....
JuggleTux has quit [Ping timeout: 250 seconds]
<struktured> the association on apply operator is not the same as named function application
<struktured> (it the forces the entire thing on the left of @@ to be the function and the entire thing on the right to be the argument to it in this case)
sdothum- has quit [Quit: ZNC - 1.6.0 - http://znc.in]
contempt has quit [Ping timeout: 256 seconds]
badkins has quit []
olibjerd_ has joined #ocaml
contempt has joined #ocaml
palomer has quit [Quit: palomer]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
yaewa has joined #ocaml
moei has quit [Ping timeout: 240 seconds]
mal``` has quit [Ping timeout: 248 seconds]
mal`` has joined #ocaml
MercurialAlchemi has joined #ocaml
nullcat has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
slash^ has joined #ocaml
<flux> companion_square, why is CCList.find_map called CCList.find?-( or is there some function for turning ('a -> bool) into ('a -> 'a option)?
palomer has joined #ocaml
<ilia> I have a question for compound types pattern matching. Suppose there is a type type_1 and type_2 = {t:type_1;i:int;} and type_3 = {t:type_1;d:float;}. how to implement a function which returns type_1 value for both values of both type_2 and type_3?
<adrien> cannot
<adrien> for your example however, 'a type_n = { t : type_1; v : 'a }; would work
<ilia> toplevel thinks that let type_1_v = function |{type_1;} -> type_1 works only for type_2 and not type_3
<ilia> thanks, I'll try it
matason has quit []
ygrek has joined #ocaml
Gama11 has joined #ocaml
ontologiae has joined #ocaml
enitiz_ has quit [Ping timeout: 272 seconds]
hilquias has joined #ocaml
Cyanure has joined #ocaml
matason has joined #ocaml
Simn has joined #ocaml
MercurialAlchemi has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
<nullcat> if I use Lwt_unix, will my code still be able to compiled to run on mirage?
<nullcat> seems i can
ontologiae has quit [Ping timeout: 256 seconds]
oscar_toro has quit [Ping timeout: 264 seconds]
cdidd has quit [Ping timeout: 256 seconds]
freling has joined #ocaml
manizzle has joined #ocaml
cdidd has joined #ocaml
kushal has joined #ocaml
<reynir> struktured: let me know if you have any luck with opam on solaris! :)
olibjerd_ has quit [Ping timeout: 265 seconds]
TheLemonMan has joined #ocaml
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
nojb has joined #ocaml
oscar_toro has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
octachron has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ggole has joined #ocaml
ingsoc has joined #ocaml
djellemah has joined #ocaml
* xificurC is sad opam doesn't work on windows
Haudegen has joined #ocaml
asQuirreL has joined #ocaml
nojb has quit [Quit: nojb]
nojb has joined #ocaml
hilquias has quit [Ping timeout: 258 seconds]
mort___ has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
nojb has quit [Quit: nojb]
Unhammer has joined #ocaml
bombastus has joined #ocaml
<Unhammer> how do I use deriving show to install a utop printer?
badon has quit [Ping timeout: 258 seconds]
<Unhammer> oh it's because it's a GADT?
bombastus is now known as b0mbastus
nojb has joined #ocaml
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
palomer has quit [Quit: palomer]
psy_ has quit [Ping timeout: 256 seconds]
b0mbastus has quit [Client Quit]
bombastus has joined #ocaml
bombastus has quit [Remote host closed the connection]
b0mbastus has joined #ocaml
<Unhammer> nvm, seems I have to create one printer per 'a like "type myint = int [@@deriving show];;let pp = X.pp pp_myint;; #install_printer pp;;"
Submarine has joined #ocaml
Submarine has joined #ocaml
<Unhammer> (btw, is pp_int defined somewhere in Pervasives?)
<nojb> Format
rand000 has joined #ocaml
ingsoc has quit [Quit: Leaving.]
<Unhammer> I just found print_int
<Unhammer> or maybe I should just let pp_int f i = Format.fprintf f "%d" i;;
<nojb> yes, sorry it is called pp_print_int
<Unhammer> ooh
<Unhammer> how did I not see that
<ggole> Cos there's a heap of junk in Format
<Unhammer> heh
nojb has quit [Quit: nojb]
<flux> is there a working ocaml-hoogle yet? one that would find functions fitting a type signature?
mal`` has quit [Ping timeout: 256 seconds]
badon has joined #ocaml
<xificurC> Unhammer: impressive
axiles has quit [Ping timeout: 240 seconds]
dsheets has joined #ocaml
mal`` has joined #ocaml
<flux> should be integrated to merlin!
slash^ has quit [Read error: Connection reset by peer]
<flux> reynir, apparently not quite perfect then
slash^ has joined #ocaml
AltGr has left #ocaml [#ocaml]
thomasga has joined #ocaml
Kakadu has joined #ocaml
psy_ has joined #ocaml
axiles has joined #ocaml
jonludlam has joined #ocaml
rand000 has quit [Ping timeout: 245 seconds]
oscar_toro has quit [Ping timeout: 272 seconds]
oscar_toro has joined #ocaml
yomimono has joined #ocaml
Intensity has joined #ocaml
Anarchos has joined #ocaml
mort___1 has joined #ocaml
psy_ has quit [Read error: No route to host]
mort___ has quit [Ping timeout: 265 seconds]
oscar_toro has quit [Ping timeout: 258 seconds]
mk270_ is now known as mk270
mort___ has joined #ocaml
mort___1 has quit [Read error: Connection reset by peer]
JuggleTux has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
avsm has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
avsm has quit [Quit: Leaving.]
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
avsm has joined #ocaml
milosn has quit [Quit: leaving]
freling has quit [Quit: Leaving.]
olibjerd_ has joined #ocaml
sdothum has joined #ocaml
_andre has joined #ocaml
thomasga has quit [Quit: Leaving.]
logzet has joined #ocaml
mort___ has quit [Quit: Leaving.]
Haudegen has quit [Ping timeout: 255 seconds]
mort___ has joined #ocaml
thomasga has joined #ocaml
yaewa has quit [Quit: Leaving...]
moei has joined #ocaml
clog has quit [Ping timeout: 265 seconds]
mort___ has left #ocaml [#ocaml]
Haudegen has joined #ocaml
olibjerd_ has quit [Ping timeout: 265 seconds]
thomasga has quit [Quit: Leaving.]
olibjerd_ has joined #ocaml
osa1 has joined #ocaml
b0mbastus has quit [Ping timeout: 256 seconds]
oscar_toro has joined #ocaml
Hannibal_Smith has joined #ocaml
hay207 has joined #ocaml
larhat1 has joined #ocaml
b0mbastus has joined #ocaml
avsm has quit [Quit: Leaving.]
larhat1 has quit [Client Quit]
axiles has quit [Ping timeout: 244 seconds]
jabesed has joined #ocaml
ingsoc has joined #ocaml
hay207 has quit [Quit: Leaving]
avsm has joined #ocaml
JuggleTux has quit [Ping timeout: 258 seconds]
yetone has joined #ocaml
yetone has quit [Remote host closed the connection]
axiles has joined #ocaml
<xificurC> I guess ocaml isn't much used on windows right. The support seems to be there but not quite enough - ocaml.org links to 4 versions and opam doesn't run under windows
avsm has quit [Quit: Leaving.]
<adrien_znc> what are you after?
<xificurC> develop ocaml on windows with ease?
<adrien_znc> use it from cygwin's shell
<pippijn> I thought the very reason for opam's existence was to support windows
<adrien_znc> ?
<xificurC> cygwin-free native code that can use the packages that opam has
<adrien_znc> you got me by surprise there
<adrien_znc> ocaml from cygwin is typically not linked to cygwin
b0mbastus has quit [Ping timeout: 265 seconds]
osa1 has quit [Ping timeout: 256 seconds]
<xificurC> adrien_znc: it's ok to work under cygwin if the final compiled file doesn't depend on it
<Drup> pippijn: why would you think that ? Isn't a package manager useful enough ?
<pippijn> Drup: there are so many package managers
olibjerd_ has quit [Quit: Ex-Chat]
<pippijn> when opam started happening, I discussed this with people
<pippijn> and their argument was "windows doesn't have one"
<xificurC> adrien_znc: are you saying you can buid ocaml and opam under cygwin and create win32/64 builds that don't rely on/link cygwin?
<flux> well, as opam doesn't work on Windows, it seems that it has then failed completely :-)
<Drup> that would be weird, because it was wrong
<pippijn> why does every language need their own package manager?
<flux> but opam seems to be very useful on other platforms.
<adrien_znc> xificurC: I didn't mention opam
<pippijn> notably one that doesn't integrate with any other package manager
<Drup> there was WODI at the time
<pippijn> I still don't know of a good way to build debian packages from opam packages
<flux> what kind of package manager would really do what opam does?
<pippijn> flux: what does it do?
<dmbaturin> xificurC: Yes, the compiler needs cygwin to work, but executables it produces don't. One of the reasons is that it uses the assembler from cygwin.
<flux> opam switch, opam pin?
<MercurialAlchemi> opam lets you install ocaml stuff non-system-wide
<pippijn> flux: nix?
<MercurialAlchemi> and can sandbox your installations
<flux> nix might be an option but I haven't used it
<pippijn> MercurialAlchemi: nix?
<dmbaturin> Technically it can be made to use the mingw assembler I guess.
<flux> so nix works on Windows?
<pippijn> flux: does opam?
<adrien_znc> there's no such thing as a "mingw" or "cygwin" assembler
<adrien_znc> it's binutils
<Drup> pippijn: was nix even usable when opam started ? (I'm not convinced it is currently ...)
<flux> I don't know, but why nix instead of opam? it's not like almost anyone uses nix either.
<pippijn> Drup: why start a new one when there is a conceptually good one that just needs some more work?
<pippijn> flux: nobody used opam when opam didn't exist
<flux> and there is certain elegance in having an ocaml package manager written in ocaml ;-)
<Drup> that's another question, I don't have an answer, I don't know nix much
<pippijn> see
<pippijn> flux: that's exactly my point
<MercurialAlchemi> pippijn: nix could work, I suppose, but I don't know if it can deal gracefully with system-wide dependencies which are not in Nix
<dmbaturin> If I said "binutils shipped with cygwin" and "binutils shipped with mingw", it would be way longer. :)
<pippijn> flux: NIH
<pippijn> every language needs its own package manager written in it
<adrien_znc> dmbaturin: but much more precise :)
<flux> for example interacting with other ocaml packages becomes simpler
<MercurialAlchemi> we are the knights who say NIH
<adrien_znc> you might think I'm nitpicking but there are too many small misunderstandings around these topics and in the end you arrive at something that's quite far from the reality
<flux> for example how opam uses cmdliner to producing an usage that's similar to other ocaml apps using cmdliner
<dmbaturin> adrien_znc: Well, good point.
<Drup> pippijn: I would tend to agree with you on that one, assuming nix does (or could be easily modify to) fulfill the ocaml constraints
<pippijn> Drup: I don't know, it would require some research
<pippijn> but surely nobody did their research and just masturbated to the idea of having an ocaml package manager in ocaml
<Drup> err
<xificurC> when I tried installing nix it took me 1 full day :) I might just be very stupid, but the installation was quite non-trivial
<Drup> sorry pippijn, but you are very wrong on that one, and you clearly never looked at the discussions about opam if you think that
<dmbaturin> Nix works best with its own distro (NixOS).
<pippijn> Drup: I don't think that
idegen has joined #ocaml
jonludlam has quit [Quit: Leaving]
<pippijn> Drup: I'm just being cynical with the intention to get people to tell me I'm wrong
<Drup> you just claimed it.
freling has joined #ocaml
<Drup> proof that this is certainly not the mindset of opam people: the constraint solver that most people use is not written in OCaml.
<pippijn> yes, I actually like that a lot
<pippijn> that's the best part of opam
<flux> though I wouldn't mind if it was a hard dependency, or that the builtin solver would be better :)
<xificurC> so ocaml can run under cygwin and produce executables that don't require it. But if one wants to use a package one has to take care of it manually as opam is not present
<pippijn> flux: I would prefer the former
<pippijn> just get rid of the broken internal one
<flux> actually it should just incorporate the same solver (ie. bundle sources) and keep the ability to use an external one
<Drup> the issue is that opam is used on plateforms where aspcud is not available
<pippijn> not available?
<pippijn> as in, it doesn't work?
<pippijn> which platforms are those?
<Drup> or not ported, or not packaged, whatever
<Drup> some BSD
<adrien_znc> xificurC: roughly that, yes
<Drup> (probably windows too)
<flux> I would imagine it would be simple regarding system dependencies..
<adrien_znc> xificurC: but for most cases, it's easy to do
<adrien_znc> I have to say I don't understand either how a constraint solver can have system-specific dependencies
<flux> magic of C!
<Drup> ^
<adrien_znc> seriously
jonludlam has joined #ocaml
<Drup> the author mostly didn't make the effort of making it portable, and that's all
<xificurC> I wish every pc ran at least something that is compatible with each other
<adrien_znc> I do enough C on both Linux and Windows to believe that's still wrong
<Drup> authors*
<adrien_znc> Drup: ok, I just wanted to be sure I could freely blame the authors
<adrien_znc> xificurC: you have the C standards for that
<adrien_znc> it already provides quite a lot of stuff
matason_ has joined #ocaml
<Drup> adrien_znc: you certainly can
<adrien_znc> wooo \o/
<xificurC> no standards please, people have to follow them to make that work. Just *be* compatible
<adrien_znc> well
<Drup> as much as aspcud is theoretically and technically very impressive, the packaging and engineering side is a bit sub-par.
<adrien_znc> you at least need to get the same words :)
<adrien_znc> Drup: are they at least _actually_ willing to incorporate patches and take care not to break these
<Drup> (typical research software :D)
matason has quit [Ping timeout: 272 seconds]
<Drup> adrien: integrate, yes. Not breaking, I'm not sure they are actively testing for it.
<xificurC> windows/linux/bsd/osx , that's already 4 targets, mind you even those have incompatible siblings
<pippijn> Drup: I like opam, it's great, and it can become a lot greater, and there are a lot of resources being put into making it better
<pippijn> but every time someone reinvents a thing that was invented hundreds of times, I feel a little bad
<adrien_znc> Drup: ok, I won't even think about spending time on that then
<Drup> pippijn: yeah, I agree
<adrien_znc> so... companion_square has made the whole channel bad hundreds of times already?
<flux> let's talk about build systems next?
<pippijn> flux: yeah
<pippijn> that's the same thing
<Drup> pippijn: there was an article about the "invented there" syndrom :D
<flux> they should have never build ocambuild, instead enhanced gnu make
<pippijn> I'm not sure about gnu make
<pippijn> but omake, yes
<Drup> ahah
<Drup> aaaand we're gone.
<pippijn> omake gets a lot of things right
<pippijn> that no other build system gets right
<adrien_znc> including the ability to bind GTK+
<pippijn> but omake has issues, as well
<adrien_znc> from its own language
<pippijn> taking omake as a basis might be good
<pippijn> I didn't spend a lot of time with jenga, but it might be good, too
<dmbaturin> Is omake still alive and used by people?
<pippijn> yes
<pippijn> also, I think there shouldn't be a difference between build system and package manager
<adrien_znc> I definitely disagree
<pippijn> but that would require an ideal world
<mk270> phew
<adrien_znc> unless your definition of package manager stops at "ocamlfind"
<pippijn> so it's not realistic in the open source world
<dmbaturin> Only if by ideal world you mean a world with just one OS. :)
<pippijn> dmbaturin: no
<pippijn> a world in which every piece of software is actually being maintained
<pippijn> if I had half a year of full time availability, I'd make a build system that works on linux, freebsd, netbsd, openbsd, mac os x, and windows, and a linux distribution based on it
<adrien_znc> year?
<pippijn> 6 months
<adrien_znc> a build system that works on all these already exist
<adrien_znc> but it's not enough
<pippijn> a good build system
<adrien_znc> in 6 months?
osa1 has joined #ocaml
<flux> pippijn, surely you're not saying you would make a new build system?
<pippijn> yes
<pippijn> flux: no
<flux> you would pick one and port packages to it?
<pippijn> yes
hay207 has joined #ocaml
<pippijn> I would need about 2-4 weeks to properly evaluate jenga
<pippijn> I think jenga can be used as a basis for what I would build
ingsoc has quit [Quit: Leaving.]
<pippijn> if that is true, then I'd need the 5 remaining months to actually do it
<xificurC> go open a kickstarter :)
<pippijn> xificurC: I like my job
<pippijn> maybe someday
<pippijn> I don't see anybody even coming close to getting this right, so I have time
<xificurC> a quite high opinion of yourself you have, me say
<pippijn> no
JuggleTux has joined #ocaml
<pippijn> people just don't really care about build systems
<pippijn> everybody settles for good-enough or good-for-my-use-case
<pippijn> because nobody really wants to deal with infrastructure
jabesed has quit [Ping timeout: 252 seconds]
matason_ has quit []
<pippijn> xificurC: jenga *seems* to be getting a very important part (almost) right, but I didn't have enough time to really evaluate it, yet
<mk270> pippijn: some of us DO care about build systems and would love to fix this
<mk270> i am maybe one notch below the level of tech skill needed write one of these really well, but certainly up for trying
<pippijn> Drup: interesting
<mk270> it really alarms me that new features are being added to ocaml's syntax and compiler and so on, whilst the toolchain (broadly conceived) is in an unusable state
matason has joined #ocaml
<Drup> pippijn: tell me when you read and digested everything
<mk270> </whinge>
badkins has joined #ocaml
<Drup> pippijn: done ? :p
<pippijn> yes
<Drup> :]
<pippijn> Drup: I think the idea itself is not bad
<Drup> that is rather worrying.
<pippijn> whether opam is the right platform to build it on, I don't know
<pippijn> src2opam is probably a bad idea
<pippijn> shipping bytecode is probably a bad idea
<pippijn> Drup: the base of the idea is good, the entire execution is ridiculous
<Drup> except the main problem in build system was never the base idea
<pippijn> I still have some jenga tabs open on my laptop at home
<pippijn> I didn't entirely drop the idea
Algebr has joined #ocaml
BitPuffin|osx has joined #ocaml
hay207 has quit [Ping timeout: 256 seconds]
<apache2> this might be a silly question, but if I have a type like (type 'a bar = 'a * int) and a (type foo = str and crowded = int32), can I write a "polymorphic" function that only operates on the int?
<apache2> and pass it both "foo bar" and "crowded bar"s?
<flux> so you have types str bar and int32 bar?
<apache2> yes
<flux> ah yes :)
<flux> yes you can
<flux> example of such a function: snd
<apache2> and I want to write a function that only deals with the int
<apache2> ah, perfect. /me looks up the source of snd
<flux> well, I'll make it a bit easier and given you one possible implementation: let snd (_, a) = a
<ia0> let on_snd : ('a -> 'b) -> 'a bar -> 'b bar = fun f (x, y) -> (x, f y)
<ia0> some example of polymorphic function
<apache2> thank you!
<apache2> say I have three types of bar, int, int32 and str. is it possible to do the same, but only for int and int32? or should I make a second type for the latter?
<apache2> right now I'm using [< `A | `B] in the function definition
<apache2> but that requires matching to get rid of the `A and `B inside the function
<apache2> (I'd like to return the snd int, but only if the fst value is either int or int32)
jeffmo has joined #ocaml
<flux> well, any time you are limiting a function to two on a limited number of types >1, you probably need to use sum types or separate functions
uris77 has joined #ocaml
<flux> hmm, "to a limited number of types > 1"
Denommus has quit [Ping timeout: 265 seconds]
tanguy` has joined #ocaml
dkreuter has joined #ocaml
<dkreuter> hello
<dkreuter> I was following these instructions: https://ocaml.org/learn/tutorials/structure_of_ocaml_programs.html
<dkreuter> for a gtk interface (concatenated the three pieces of source at the end of the page)
agarwal1975 has joined #ocaml
<dkreuter> and compile it with "ocamlfind ocamlc -g -package lablgtk2 -linkpkg gtktest.ml -o gtktest"
<dkreuter> it gives me an error on "new editor"
<dkreuter> Anyone know why?
<dkreuter> Error is "Unbound class editor"
<dkreuter> source line is "let editor = new editor ~packing:hbox#add ()"
<flux> sounds to me you are missing some 'open' from top of the file
<dkreuter> I open StdLabels, GMain and GdkKeysyms
<adrien_znc> crap
<adrien_znc> that page still doesn't include the init stuff
<flux> hmm, so I guess 'editor' is something the example itself makes
<adrien_znc> there's not "editor" class in lablgtk
<adrien_znc> afaik
<flux> it looks a lot like this, except misses the class from the top: https://github.com/knuton/lablgtk/blob/master/examples/editor.ml
thomasga has joined #ocaml
<dkreuter> flux, thanks
<adrien_znc> and when it segfaults it's because of the missing init
<flux> :-)
<flux> great user experience(TM)
<flux> isn't there some line you can add to the ocamlfind command to make it work
<adrien_znc> Drup has been trying to make me improve the gtk-related pages but I haven't had time to do so
<adrien_znc> no, don't re-use the ocamlfind stuff to init
<flux> :)
<adrien_znc> it'll make
<adrien_znc> ./a.out --help
<adrien_znc> require X
<adrien_znc> GtkInit
<dkreuter> apparently I can also use "ocamlc -g -I +lablgtk2 lablgtk2.cma" instead of ocamlfind
<dkreuter> ><flux> great user experience(TM)
<dkreuter> indeed
<adrien_znc> use ocamlfind
<flux> when you want to use multiple libraries using ocamlfind will pay itself back
<dkreuter> okay
<dkreuter> One more thing
<dkreuter> (ctrl+f for grtest2)
<dkreuter> which draws points
<dkreuter> and it's reeeealy slow
<dkreuter> considering it's drawing pixels in a tight loop
<flux> well, the Graphivs module is reaaaaly slow
<flux> at least that's what I imagine
<dkreuter> okay
<adrien_znc> it's not that slow
<flux> Graphics module is perhaps suitable for learning and some debug visualizations
<dkreuter> takes multiple seconds to iterate from 0 to 600
avsm has joined #ocaml
<adrien_znc> the code itself looks quite slow
<adrien_znc> and it draws only one point with each call
<flux> Graphics can draw multiple points per call?
<adrien_znc> I think so
<flux> but rule of thumb: libraries that actually draw one pixel at a time to the screen are going to be slow :-)
<adrien_znc> at least two :P
<dkreuter> oh great, the gtkdemo segfaults
<dkreuter> >the type system will catch these mistakes
<flux> I believe that would be the missing GtkInit.init () ?
<adrien_znc> val draw_poly_line : (int * int) array -> unit
<adrien_znc> (** [draw_poly_line points] draws the line that joins the points given by the array argument.
<adrien_znc> flux: yes
<adrien_znc> it would be really good to have it added to ocaml.org
<adrien_znc> (I'm at work, I don't have my emails nor my keys)
<flux> dkreuter, well, the type system doesn't help when you call C :-). though I think lablgtk2 would be quite safe after that particular init call is made
<adrien_znc> dkreuter: definitely call GtkInit.init ()
<dkreuter> >Error: Unbound value GtkInit.init
<dkreuter> I started using these languages a few hours ago, I'm probably making the most obvious mistakes now
<dkreuter> *this lang
<orbitz> Is tehre an existing tool to print a string out as hex?
<adrien_znc> sorry
<adrien_znc> 119 let locale = GtkMain.Main.init ()
<adrien_znc> you can ignore the return value
<flux> orbitz, hd is perhaps the simplest?
<flux> orbitz, then od -tx1
<dkreuter> works
<flux> then.. perl?
<flux> dkreuter, may your future forays be segmentation fault free!
<dkreuter> haha
<dkreuter> Can I get tab-completion in the ocaml repl?
<adrien_znc> this one is really common
<flux> dkreuter, install utop
<dkreuter> opam install utop?
<flux> yes
<flux> dkreuter, btw, which editor do you use?
<dkreuter> do I need to do this eval `opam …` stuff?
<dkreuter> (eval `opam config env`)
<dkreuter> flux, sublime text
* dkreuter starts utop
* dkreuter feels like in a cockpit
thomasga has quit [Quit: Leaving.]
<flux> dkreuter, then you should install merlin and https://github.com/cynddl/sublime-text-merlin (disclaimer: I haven't tried sublimie)
<flux> merlin gives you type-aware tab expansion to your editor
<dkreuter> will it also load gtk, etc.?
<dkreuter> how would I give the tab completer the flags I'd give to ocamlfind?
<flux> you need to tell it to load gtk, so put PKG lablgtk2 into file .merlin
<dkreuter> hm, okay
<flux> but hey, good call that it needs to be done :-)
milosn has joined #ocaml
<Unhammer> <dkreuter> do I need to do this eval `opam …` stuff?
<Unhammer> yes
<Unhammer> put it in your ~/.bashrc
<dkreuter> What if I do stuff without it?
<dkreuter> Like installing stuff
thomasga has joined #ocaml
<flux> well, for one, the binaries it may install don't end up in your path
<Unhammer> I think opam itself will be fine … but compiling might not find the opam installed stuff
<Unhammer> and binaries like merlin won't be in path so your editor will complain
<flux> you can do the command without the 'eval' part to see what it does
<dkreuter> I see.
<Unhammer> (or even worse, your editor will silently fail because it doesn't find merlin)
<Drup> hi Unhammer, did you finished your ocsigen website thingy ? :]
darkf has quit [Quit: Leaving]
<dkreuter> what's that ounit, lwt stuff that merlin asks me to pick?
JuggleTux has quit [Ping timeout: 252 seconds]
<flux> unit testing
<flux> lwt is light weight threading, a node.js-kind concurrency library
<flux> probably some things in the dependency chain use that (or perhaps merlin itselF)
<dkreuter> ah, I was in the "enable extension" menu
<dkreuter> okay, it seems to work
<dkreuter> nice
freling has quit [Quit: Leaving.]
<flux> so what can it do? just wondering, as I've never used with sublime.
<dkreuter> well, there a few weird aspects
<dkreuter> firstly it breaks the normal autocomplete
<dkreuter> which uses fuzzy matches to existing words
<dkreuter> then it suggests a few point less things
<dkreuter> like "false" when I've only typed 'f' so far
<dkreuter> it suggests stuff after "let"
<dkreuter> and then sometimes it inserts the tab instead of completeing
<dkreuter> then displays my completion options
<dkreuter> resulting in
<dkreuter> >file_sele file_selection
<dkreuter> well, whatever
JuggleTux has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
waneck has quit [Quit: Leaving]
englishm has quit [Quit: ZNC - http://znc.in]
shinnya has joined #ocaml
hilquias has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat has quit [Client Quit]
<dkreuter> what's the difference between a val mutable and a reference?
larhat has joined #ocaml
<dkreuter> one gets assigned to with <-
<dkreuter> the other one with :=
larhat has quit [Client Quit]
larhat has joined #ocaml
<ggole> A reference is basically a record with a mutable field
jeffmo has quit [Quit: jeffmo]
<ggole> := is simply a function which does that: <- is the underlying operation
<dkreuter> ggole, thanks
<ggole> dkreuter: you can mutate references with <-, if you like: the field is called 'contents'
<ggole> let test r x = r.contents <- x
Haudegen has quit [Ping timeout: 255 seconds]
axiles has quit [Quit: Quitte]
MercurialAlchemi has quit [Quit: Lost terminal]
MercurialAlchemi has joined #ocaml
A1977494 has joined #ocaml
wraithm has joined #ocaml
Denommus has joined #ocaml
A1977494 has left #ocaml [#ocaml]
badkins has quit []
<dkreuter> is there a good comparison betwee rust and ocaml somewhere?
<adrien_znc> probably not
<adrien_znc> too new
<adrien_znc> and rust's exact goals have changed over time
jabesed has joined #ocaml
<Denommus> dkreuter: I think Rust is more comparable to C++ than to OCaml
<Drup> adrien_znc is quite right, but you can still give a useful distinction: GC and not GC :)
<Denommus> there are no functors (though you may emulate them with traits with associated types)
jeffmo has joined #ocaml
<Drup> yeah, traits and associated types are quite equivalent to functors both in usage and expressivity
<dkreuter> functor as in callable value?
<adrien_znc> C++ with features actually backed by theory and with strong compile-time guarantees?
<Drup> no, functors as in "function over modules"
nojb has joined #ocaml
<Denommus> adrien_znc: also, no templates. Generics and macros instead
<dkreuter> well what are modules?
<dkreuter> mappings from string → value?
<Drup> not really. :D
<ggole> O_o
<Drup> strings as variables, huhu, that's cute n_n
<Denommus> dkreuter: hm, are you coming from Rust?
<dkreuter> Denommus, I'm coming from c++ and python
<dkreuter> And want to do something related to code analysis (graph stuff)
<dkreuter> And found that people use OCaml for this.
<Drup> indeed
<dkreuter> So I thought I should check it out.
<dkreuter> And the other language I am considering is Rust.
<Drup> ocaml is very good for code analysis
<ggole> Modules are very roughly "units of code"
<dkreuter> ><Drup> no, functors as in "function over modules"
<dkreuter> so basically templates
<Drup> very roughly, yes
<Denommus> dkreuter: hm. Modules are structures where you put associated types and values
<Drup> but with proper compile time garanty and with a sane execution model
<ggole> You can use them for organising, hiding, abstracting etc values
<Denommus> dkreuter: and can be used as compilation units
<dkreuter> o_O okay
<ggole> Or parameterise them
Haudegen has joined #ocaml
b0mbastus has joined #ocaml
<Drup> dkreuter: for the domain you are interested in OCaml is better than Rust
<dkreuter> It seems to me that pattern matching is the most helpful aspect for me in this area. Something that Rust and OCaml share apparently.
<Drup> for two reasons: 1) libraries exists already for that in OCaml, not so much in Rust 2) Rust main selling point is control over memory/allocation and you don't care about that
<Drup> (on the contrary, fighting with the ownership system when doing graph stuff is going to be a pain)
<Denommus> dkreuter: you probably don't need Rust's static guarantees over your resource's lifetimes
<Denommus> dkreuter: but that would be more annoying than helpful in your domain
<dkreuter> The nodes would just be owned by the graph
<dkreuter> And everyone else borrows
<dkreuter> Seems simple enough
<dkreuter> How else could OCaml help me?
<Drup> dkreuter: there is a gc and you don't have to care about it ?
<Drup> at all.
<Denommus> dkreuter: I know nearly nothing about this domain, but is lexing and parsing useful for that?
<dkreuter> I think not so much. I already get the data preparsed.
pleiosaur has joined #ocaml
<Drup> dkreuter: what kind of static analysis are you interested in ?
<dkreuter> Drup, the stuff compilers do too
<ggole> dkreuter: Hmm, how do you delete from such lifetime managed graphs?
<dkreuter> Constant folding
<dkreuter> Dead code elimination
<Drup> dkreuter: for which language ?
<dkreuter> Drup, a custom assembly level intermediate language.
<dkreuter> LLVM IR level
A19774941 has joined #ocaml
<dkreuter> ggole, I don't know yet. I'm a beginner in rust too.
<Denommus> dkreuter: is it really a graph?
<dkreuter> Denommus, it's an SSA graph.
<Denommus> dkreuter: I mean, does it have cycles?
Hannibal_Smith has joined #ocaml
<dkreuter> Denommus, the nodes creating the cycles are specially marked. I could break the graph at these points
<ggole> SSA IRs almost always have cycles
<ggole> (At two levels.)
<dkreuter> ggole, what's the second (other than phi nodes)
<dkreuter> (you mean for flow?)
<ggole> The CFG
<ggole> Right
<Denommus> dkreuter: well, then I'd use OCaml. Dealing with cycles in Rust is annoying (as much as I like Rust)
<adrien_znc> I want OCaml for high-level code and Rust for low-level libraries :)
<dkreuter> I see.
<ggole> Does Rust have a toplevel?
<dkreuter> what's that?
<dkreuter> a top level scope?
<ggole> Another term for REPL
<dkreuter> ^ an inofficial one it seems
<Denommus> yup
<ggole> Denommus: hmm, thanks
<Denommus> it's a systems language, after all
<Drup> dkreuter: the static analysis community in OCaml is rather large, so you should find a lot of like-minded folks to look at your thing
paddymahoney has joined #ocaml
larhat has quit [Quit: Leaving.]
<Drup> the Rust community is rather oriented in different directions
larhat has joined #ocaml
<Drup> (low level stuff, a bit of web stuff, graphic engines, games)
<dkreuter> Drup, I only know BAP at the moment.
<dkreuter> What other projects are there?
<Denommus> Drup: not even the compiler does that much analysis (besides the type checking, of course). Most of optimizations they leave to LLVM to handle
<ggole> FramaC
larhat has quit [Client Quit]
<ggole> Various compilers, if that counts
<Drup> FramaC, cil, Aspic
larhat has joined #ocaml
<Drup> I guess pfff count as well
ncthom91 has joined #ocaml
<Drup> that's the big released one, there is also the little ones done by french researchers :D
larhat has quit [Client Quit]
larhat has joined #ocaml
<Drup> I just discovered sawja too
A19774941 has left #ocaml [#ocaml]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
<Drup> oh, I almost forgot http://www.astree.ens.fr/
larhat has joined #ocaml
<Drup> which is rather a big thing, even if not foss :(
nojb- has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
freling has joined #ocaml
<adrien_znc> which is really surprising considering their website
larhat has quit [Client Quit]
larhat has joined #ocaml
wraithm has quit [Quit: leaving]
hilquias` has joined #ocaml
hilquias has quit [Ping timeout: 272 seconds]
<octachron> a non-foss software from ens? quite disappointing
nojb has quit [Quit: nojb]
b0mbastus has quit [Read error: Connection reset by peer]
palomer has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nojb- has quit [Ping timeout: 265 seconds]
badkins has joined #ocaml
freling has left #ocaml [#ocaml]
ncthom91 has joined #ocaml
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
jonludlam has quit [Ping timeout: 264 seconds]
larhat has quit [Client Quit]
dsheets has quit [Ping timeout: 246 seconds]
larhat has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
jwatzman|work has joined #ocaml
larhat has joined #ocaml
thomasga has quit [Ping timeout: 256 seconds]
<Drup> octachron: exactly like compcert, really
larhat has quit [Client Quit]
larhat has joined #ocaml
jabesed has quit [Ping timeout: 255 seconds]
larhat has quit [Client Quit]
palomer has quit [Quit: palomer]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
palomer has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
jabesed has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
nojb has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
nullcat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
palomer has quit [Quit: palomer]
larhat has quit [Client Quit]
larhat has joined #ocaml
octachron has quit [Quit: Leaving]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
MrScout has joined #ocaml
yomimono has quit [Ping timeout: 244 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
MrScout_ has joined #ocaml
MrScout has quit [Remote host closed the connection]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
avsm has quit [Quit: Leaving.]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Haudegen has quit [Ping timeout: 272 seconds]
larhat has joined #ocaml
larhat has quit [Client Quit]
nojb has quit [Quit: nojb]
larhat has joined #ocaml
psy_ has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
tane has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
seako has joined #ocaml
larhat has joined #ocaml
rand000 has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
Haudegen has joined #ocaml
nullcat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
jonludlam has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<flux> hmm, so I guess it appears that 'fibers' in ocaml-multicore are a form of co-operative multitasking?
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
ygrek has joined #ocaml
larhat has quit [Client Quit]
JuggleTux has quit [Ping timeout: 256 seconds]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has quit [Client Quit]
larhat has joined #ocaml
dubosec has quit [Ping timeout: 272 seconds]
Kakadu has quit [Quit: Page closed]
larhat has quit [Client Quit]
larhat has joined #ocaml
dubosec has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
hilquias` has quit [Remote host closed the connection]
larhat has joined #ocaml
jonludlam has quit [Ping timeout: 272 seconds]
pii4 has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
clog has joined #ocaml
larhat has joined #ocaml
uris77 has quit [Ping timeout: 245 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
avsm has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<Drup> yes
alkoma has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
avsm has quit [Quit: Leaving.]
alkoma has quit [Remote host closed the connection]
alkoma has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
nullcat has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
pyon has quit [Quit: I have irrefutable proof that D < 0. It follows trivially from 2D > 3D, which is obviously true.]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
pyon has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
JuggleTux has joined #ocaml
wraithm has joined #ocaml
wraithm has quit [Client Quit]
larhat has quit [Client Quit]
larhat has joined #ocaml
paddymahoney has quit [Ping timeout: 272 seconds]
larhat has quit [Client Quit]
Gama11 has quit [Ping timeout: 265 seconds]
nojb has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
robink has quit [Ping timeout: 255 seconds]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has quit [Client Quit]
larhat has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
larhat has quit [Client Quit]
robink_ has joined #ocaml
7GHAAHE33 has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
Haudegen has quit [Ping timeout: 245 seconds]
Gama11 has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
jonludlam has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<7GHAAHE33> is core_kernel.std os-independent now?
larhat has quit [Client Quit]
7GHAAHE33 has quit [Quit: gone...]
larhat has joined #ocaml
nullcat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
jabesed has quit [Ping timeout: 256 seconds]
shinnya has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<dubosec> silly question, but I am learning ocaml and maybe hoping to put a resume together in a couple of years as a functional programmer. Unfortunately, I do not have any formal or academic background in computer science or programming, but I might take an online course through the local community college soon and get an associates in supply chain management. In the future, should I list an unrelated degree or would it be better to state my
<dubosec> learning resources (such as books read)?
larhat has quit [Client Quit]
larhat has joined #ocaml
Sim_n has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
Simn has quit [Ping timeout: 276 seconds]
larhat has quit [Client Quit]
<nullcat> I can only give your some suggestion on learning resources: "Real World OCaml" (https://realworldocaml.org/) or official reference manual (http://caml.inria.fr/pub/docs/manual-ocaml/)
larhat has joined #ocaml
larhat has quit [Client Quit]
Haudegen has joined #ocaml
larhat has joined #ocaml
Kakadu has joined #ocaml
ygrek has quit [Remote host closed the connection]
larhat has quit [Client Quit]
<dubosec> thanks! Real World OCaml has been very helpful. I like that it incorporates utop and opam in the text
slash^ has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
ygrek has joined #ocaml
ggole has quit []
larhat has quit [Client Quit]
larhat has joined #ocaml
<Algebr> dubosec: to be honest the community college thing sounds quite useless and a waste, unless you're taking like intro to computer science or something like that.
Sim_n has quit [Ping timeout: 252 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
jabesed has joined #ocaml
larhat has quit [Client Quit]
<dubosec> yeah. That's mostly based off of liking the logistics aspects of some jobs I've had, and I don't have the time to take non-online classes (I'm a full-time baker), but in case the programming doesn't work out I feel like I should have a backup or something. But I am not 100% sold on the idea of going back to college.
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
nullcat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
Gama11 has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
Gama11 has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
kushal has quit [Quit: Leaving]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
seako has quit [Quit: Connection closed for inactivity]
`\_o-` has joined #ocaml
larhat has joined #ocaml
tanguy` has quit [Ping timeout: 272 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
robink_ is now known as robink
larhat has quit [Client Quit]
larhat has joined #ocaml
matason has quit []
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
ncthom91 has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<apache2> flux: alright, thanks
<apache2> I forgot about sumtypes
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
matason has joined #ocaml
hay207 has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<apache2> er, not sumtypes. I had something different in mind
larhat has quit [Client Quit]
larhat has joined #ocaml
struk|work has joined #ocaml
larhat has quit [Client Quit]
<apache2> http://ocaml.org/learn/faq.html this guide here has a 'FIXME' in the sectio nabout polymorphic functions :(
larhat has joined #ocaml
<struk|work> does anyone know of a ocaml module that allows you run a shell command and get stdout back as a string return value? I found one solution but want something with less boiler plate: http://rosettacode.org/wiki/Execute_a_system_command#OCaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<dmbaturin> apache2: ocaml.org maintainers are responsive to pull requests, I've had a few merged.
larhat has quit [Client Quit]
larhat has joined #ocaml
<nullcat> struk|work: there may help https://ocaml.github.io/ocamlunix/ocamlunix.html, but I think it's still complicated
<apache2> dmbaturin: In this case I'm looking for the solution myself; I'm not in a position to help them :)
<dmbaturin> struk|work: I believe I've seen it in some OS library under development, but not anywhere in libs that are in opam. I'm making it up when I need it. :)
Anarchos has joined #ocaml
larhat has quit [Client Quit]
<dmbaturin> apache2: Ah. Well, you can create an issue too, but I think issues are lowed priority than pull requests. :)
<struk|work> dmbaturin: got it. I could have sworn I saw a lib that makes interacting w/shell less annoying but I can't find it again.
<dmbaturin> I'm not sure what direct way the FIXME author meant.
larhat has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apache2> no, me neither
<dmbaturin> struk|work: I've been thinking about making one yesterday. Guess I should search for that one again, if nothing found, maybe we should make one.
larhat has quit [Client Quit]
<apache2> nullcat: that is a bit excessive
larhat has joined #ocaml
<apache2> oh wait I'm looking at Batteries documentation
<Algebr> apache2: isn't it just Unix.open_process?
<Algebr> and then collect the result
hay207 has quit [Ping timeout: 256 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
<apache2> Algebr:
<dmbaturin> Algebr: Well, it's quite far from let out = output_of_process "rm -rf /*". :)
<apache2> yes, but http://batteries.forge.ocamlcore.org/doc.preview:batteries-beta1/html/api/Unix.html Batteries has some helpers for automatically closing stuff down after EOF is read
larhat has quit [Client Quit]
hay207 has joined #ocaml
larhat has joined #ocaml
<apache2> Algebr: ah, in this case Core has the helpers in In_channel.input_lines and Unix.close_process I guess
<apache2> neat :)
larhat has quit [Client Quit]
larhat has joined #ocaml
`\_o-` has quit [Read error: Connection reset by peer]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
<apache2> http://ocsigen.org/lwt/2.4.8/api/Lwt_process this may be something if you're using lwt
larhat has joined #ocaml
<smondet> struk|work: you can copy-paste from there also: http://mjambon.com/toolbox.html
dav has joined #ocaml
dav has quit [Changing host]
dav has joined #ocaml
badkins has quit []
larhat1 has joined #ocaml
larhat has quit [Client Quit]
<struk|work> thanks...i'll need a shared module eventually otherwise the pythonistas around here will murder me
larhat has joined #ocaml
larhat1 has quit [Client Quit]
hay207 has quit [Quit: Leaving]
<apache2> :( what an unjustifiably harsh workplace you have there. capital murder seems a bit over the top :)
larhat1 has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
TheLemonMan has joined #ocaml
Algebr has quit [Ping timeout: 276 seconds]
larhat has quit [Client Quit]
<struk|work> :) my boss actually is giving me some wiggle room to force ocaml into the team, so I'm trying to make things as gentle as possible
<dmbaturin> Sometimes I'm surprised this kind of operations are not in widely available libraries, taking into account how common they are.
larhat has joined #ocaml
larhat has quit [Client Quit]
_andre has quit [Quit: leaving]
larhat has joined #ocaml
nullcat has joined #ocaml
ygrek has quit [Ping timeout: 265 seconds]
larhat has quit [Client Quit]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<dmbaturin> Looking at the FAQ, I like how general questions such as compiled vs interpreted are after heavy technical stuff. :)
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
ncthom91 has joined #ocaml
larhat has joined #ocaml
ncthom91 has quit [Client Quit]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
NSA_Agent has joined #ocaml
larhat has quit [Client Quit]
swgillespie has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<apache2> is there something magical about values ending in ' ? do they not get exported by default in .mli ?
larhat has quit [Client Quit]
<NSA_Agent> Hello, World!, is there a way to execute code that is linked before retrieving values? e.g.
<NSA_Agent> Printf.printf "Choose a card: ";
<NSA_Agent> let card = input_line stdin in
<NSA_Agent> Printf.printf "Choose player: ";
<NSA_Agent> let plyr = input_line stdin in
<NSA_Agent> Printf.printf "You typed: %s & %s" card plyr;;
<NSA_Agent> Because this does not print, for examlpe "Choose player: " before reading user value.
Hannibal_Smith has quit [Quit: Leaving]
larhat has joined #ocaml
<apache2> what happens is that the output is buffered by gnu libc (which is what whoever made the unix ocaml build seemed to love, so it was used for everything behind the scenes, resulting in a lot of weird and stupid behavior)
larhat has quit [Client Quit]
<apache2> usually you can force flushing using %! in printf
badkins has joined #ocaml
larhat has joined #ocaml
<apache2> print_endline and print_newline from Pervasives automatically flush
<apache2> there's also Pervasives.flush and .flush_all (if ending hte printf with %! doesn't work)
<dmbaturin> apache2: No, it's just another character allowed in identifiers.
<apache2> dmbaturin: alright :)
larhat has quit [Client Quit]
larhat has joined #ocaml
<dmbaturin> module Foo : sig val foo' : unit -> unit end = struct let foo' () = print_endline "foo" end ;; :)
<apache2> what's the common way to denote "private" functions in a module? (to make it clear to casual readers that this isn't exported in the interface) ?
larhat has quit [Client Quit]
<apache2> is there an ocaml custom for something like that, or should I just go with a _prefix ?
larhat has joined #ocaml
tane has quit [Quit: Verlassend]
<dmbaturin> Hhm, I don't think there's a widely used convention.
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
mengu has joined #ocaml
mengu has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
<NSA_Agent> apache2: Thanks a lot, print_endline worked very well!
Submarine has quit [Quit: Leaving]
larhat has joined #ocaml
larhat has quit [Client Quit]
ncthom91 has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<apache2> cool @ both of you! :)
larhat has quit [Client Quit]
larhat has joined #ocaml
dav has quit [Ping timeout: 240 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
nojb has quit [Ping timeout: 264 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
hilquias has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
larhat has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
<apache2> I'm struggling to understand how to read this curried function definition:
<apache2> let bar: type x. x s -> x s = ...
swgillespie has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
<apache2> (looking to write a function that only accepts "s" of the B variant
<apache2> ((but don't care which type b it is))
larhat has quit [Client Quit]
<apache2> (((in my case the `a` and `b` types can be the same, but the A / B variants carry significance)
larhat has joined #ocaml
larhat has quit [Client Quit]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
<dmbaturin> apache2: Polymorphic variants are probably the easiest option.
larhat1 has quit [Quit: Leaving.]
larhat has joined #ocaml
badon_ is now known as badon
larhat has quit [Client Quit]
matason has quit []
larhat has joined #ocaml
<apache2> yeah, they solve the problem. the lack of scope (for better lack of words) seems a bit unstable though
<apache2> I was hoping there'd be a way to solve this within the regular type system
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
Denommus has quit [Quit: going home]
agarwal1975 has quit [Quit: agarwal1975]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has quit [Client Quit]
rand000 has quit [Quit: leaving]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
MrScout_ has quit [Remote host closed the connection]
larhat has quit [Client Quit]
larhat has joined #ocaml
aaron482 has joined #ocaml
larhat has quit [Client Quit]
aaron482 has quit []
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
Gama11 has quit [Read error: Connection reset by peer]
Cyanure has quit [Remote host closed the connection]
larhat has quit [Client Quit]
osa1 has quit [Ping timeout: 276 seconds]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat1 has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
osa1 has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
Kakadu has quit [Remote host closed the connection]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
milosn has quit [Ping timeout: 265 seconds]
agarwal1975 has joined #ocaml
larhat has quit [Client Quit]
nullcat has joined #ocaml
milosn has joined #ocaml
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
osa1_ has joined #ocaml
larhat has joined #ocaml
osa1 has quit [Ping timeout: 265 seconds]
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
ygrek has joined #ocaml
larhat has quit [Client Quit]
oscar_toro has quit [Ping timeout: 276 seconds]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
madroach has quit [Ping timeout: 264 seconds]
larhat has joined #ocaml
b0mbastus has joined #ocaml
madroach has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
JuggleTux has quit [Ping timeout: 272 seconds]
larhat has joined #ocaml
<dkreuter> can I have coroutines in ocaml?
larhat has quit [Client Quit]
nullcat has joined #ocaml
larhat has joined #ocaml
mengu has quit [Remote host closed the connection]
larhat has quit [Client Quit]
<dkreuter> and how can I let the compiler check if a class fulfills an interface?
<dkreuter> (check if it has certain methods with the correct types)
larhat has joined #ocaml
badkins_ has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
larhat has quit [Client Quit]
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has joined #ocaml
badkins has quit [Ping timeout: 258 seconds]
logzet has quit [Ping timeout: 252 seconds]
larhat has quit [Client Quit]
<adrien> dkreuter: it's the other way round: the compiler does all the checks by default
<adrien> actually not by default but all the time
larhat has joined #ocaml
<apache2> dkreuter: "coroutines": light-weight threads are available through "lwt" library
larhat has quit [Client Quit]
<dkreuter> apache2, is lwt pure ocaml, could I copy the relevant code in theory?
<dkreuter> adrien, how do I specify which interface to check against in the object … end syntax?
larhat has joined #ocaml
BiDOrD has quit []
<adrien> dkreuter: can you explain a bit more what you're trying to achieve?
<apache2> I actually don't know, but I strongly suspect there's some preprocessing magic going on behind the scenes
<adrien> not just this specific thing
<dkreuter> adrien, to practice I'm trying to port a piece of code from python
<dkreuter> basically, just
<dkreuter> class A: def method1(self): return "foo"
<dkreuter> class B: def method1(self): return "bar"
jonludlam has quit [Ping timeout: 252 seconds]
larhat has quit [Client Quit]
<dmbaturin> dkreuter: You may find this useful: http://roscidus.com/blog/blog/2013/11/28/asynchronous-python-vs-ocaml/
<dkreuter> I want to specify the signature of method1 once, and specify that A and B need to fulfill this.
<adrien> also I think lwt has some C
<adrien> we typically don't use objects much
larhat has joined #ocaml
BiDOrD has joined #ocaml
<dmbaturin> That gentleman ported a whole big application from python to ocaml.
<adrien> mostly because the ocaml type system without object is already very powerful
<adrien> this/self is something that requires objects however
<adrien> (roughly)
<adrien> in you case, you can make a "class type" if I remember correctly
<adrien> and then
<adrien> class foo : <yourclasstype> = ...
<adrien> I think that's the syntax
<dkreuter> nice
<adrien> a bit late and alcoholed here but that should be right
larhat has quit [Client Quit]
<dmbaturin> The unusual part is that class names don't matter much. The object system, like the rest of the type system, is structural rather than nominal.
larhat has joined #ocaml
larhat has quit [Client Quit]
<apache2> I think you can also have objects without classes