adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
nightuser has quit [Ping timeout: 244 seconds]
kakadu has quit [Remote host closed the connection]
rand000 has quit [Quit: leaving]
higgs has left #ocaml ["Leaving"]
lobo has quit [Quit: leaving]
abbe has quit [Remote host closed the connection]
govg has joined #ocaml
abbe has joined #ocaml
nicoo has quit [Ping timeout: 255 seconds]
nicoo has joined #ocaml
malc_ has quit [Quit: leaving]
ygrek has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mcc> asking quick in here in case it's something simple and easy...
<mcc> let typeConvert = function Value.AtomValue s -> ( match s with "void" -> void | "int" -> int )
MrScout_ has quit [Remote host closed the connection]
<mcc> I have a string describing a function prototype, and I'm trying to convert it to a ctype function loaded with "foreign".
<mcc> the first thing i try to write immediately blows up complaining that 'int Ctypes_static.typ' is not compatible with 'unit Ctypes_static.typ'
<mcc> any idea how to proceed?
<mcc> the best i can understand right now is that type variables are a thing that exist in ocaml, but they're not polymorphic and their values must be known at compile time?
<mcc> and internally i'm thinking of this as being like c++ templates…?
higgs has joined #ocaml
AltGr has left #ocaml [#ocaml]
govg has quit [Ping timeout: 265 seconds]
AltGr has joined #ocaml
ril is now known as ril[away]
ril[away] is now known as ril
ril is now known as ril[away]
kandu has quit [Quit: leaving]
lordkryss has quit [Quit: Connection closed for inactivity]
ril[away] has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ygrek has quit [Ping timeout: 250 seconds]
sailorswift has joined #ocaml
<dmbaturin> mcc: Well, 'a Ctypes_static.typ is polymorphic, but it indeed should be known at compile time what the concrete type is. With GADTs you can make the return type depend on the argument though.
grouzen has quit [Ping timeout: 260 seconds]
<dmbaturin> If it's known at compile time what kind of a function will be loaded, I think GADTs may work in this case.
ncthom91 has joined #ocaml
swgillespie has joined #ocaml
mrm has quit [Read error: Connection reset by peer]
mrm` has joined #ocaml
mrm` has quit [Remote host closed the connection]
mrm` has joined #ocaml
mrm` has left #ocaml [#ocaml]
uu has joined #ocaml
<uu> hi, is there any fast way to kind of make an ocaml wrpper of a cpp(c++11) project?
<uu> wrapper, typo, sorry
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pippijn_ has quit [Ping timeout: 260 seconds]
swgillespie has joined #ocaml
kandu has joined #ocaml
pippijn has joined #ocaml
kandu has quit [Quit: leaving]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kandu has joined #ocaml
darkf has joined #ocaml
ril has joined #ocaml
riveter has quit [Ping timeout: 246 seconds]
riveter has joined #ocaml
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BhavyaM has joined #ocaml
hefner has joined #ocaml
higgs has quit [Ping timeout: 265 seconds]
KDr2 has joined #ocaml
hefner has quit [Quit: leaving]
MercurialAlchemi has joined #ocaml
sailorswift has joined #ocaml
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
psy_ has quit [Ping timeout: 252 seconds]
psy_ has joined #ocaml
AlexRussia has joined #ocaml
psy_ has quit [Max SendQ exceeded]
contempt has quit [Ping timeout: 260 seconds]
psy_ has joined #ocaml
ggole has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
tmtwd has quit [Read error: Connection reset by peer]
mcc has quit [Quit: This computer has gone to sleep]
swgillespie has joined #ocaml
contempt has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
swgillespie has quit [Ping timeout: 250 seconds]
xificurC_ has joined #ocaml
xificurC_ has quit [Remote host closed the connection]
govg has joined #ocaml
xificurC has joined #ocaml
tmtwd has joined #ocaml
Snark has joined #ocaml
tmtwd has quit [Remote host closed the connection]
jaseemabid has joined #ocaml
<jaseemabid> Hello! I'm learning OCaml and I'm having a whole bunch of issues with the tooling. First of all, do I have to list every package I use in code with a `-package foo` along with ocamlfind? Is there a straight forward way to compile the file?
ncthom91 has joined #ocaml
<jaseemabid> Also, I'm using `List.Assoc` in a script. Tuareg mode is unable to compile the file due to imports. How do I make it import everything required? Pretty much every language I've seen so far did that. Why did OCaml did this very counter intuitive thing of listing every package in the command line?
ely-se has joined #ocaml
antkong_ has quit [Quit: antkong_]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ggole> jaseemabid: you could try a build system such as ocamlbuild
<jaseemabid> ggole: will ocamlbuild support -annot? I'm using tuareg mode too see types inline
Snark has quit [Quit: leaving]
<ggole> Yeah.
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sailorswift has joined #ocaml
sailorswift has quit [Client Quit]
sailorswift has joined #ocaml
Simn has joined #ocaml
<jaseemabid> ggole: Great. Now can I open a utop (I guess the preferred repl) with all the dependencies?
<jaseemabid> I need a repl to check for the types of all the standard library functions. Like Tcp.on_port
zpe has joined #ocaml
matason has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
grouzen has joined #ocaml
<ggole> You have a choice: either load a dependency on the fly with #require, or ask ocamlbuild to build a toplevel containing all the necessary stuff
BitPuffin|osx has quit [Ping timeout: 245 seconds]
<ggole> (The first case can be automated with use of .ocamlinit, you won't have to keep typing it every time.)
<jaseemabid> ggole: Can you please point me to an example please? Or do I have to just add a bunch of open starements into .ocamlinit ?
<ggole> Not open, #require
<ggole> (You might *also* want to open, but that's just a matter of namespacing. It won't load any code.)
Haudegen has joined #ocaml
<ggole> It's very simple, #require "package"
<ggole> Before adding anything to a .ocamlinit, you should try it in utop first.
<jaseemabid> ggole: Ah. That worked. I'll do open as well, so that I dont have to type the whole name everytime.
<jaseemabid> My own module is auto completed fine in utop, but when I try to get the type of a function by typing in the name, utop will error "Reference to undefined global <module name>".
uu has quit [Ping timeout: 244 seconds]
elfring has joined #ocaml
<elfring> The function "Unix.gettimeofday" is provided by an OCaml library.
<elfring> The POSIX specification contains the wording "Applications should use the clock_gettime() function instead of the obsolescent gettimeofday() function.".
<elfring> How is OCaml software evolving around time measurements?
<companion_cube> maybe clock_gettime could be added to Unix
<elfring> companion_cube: Can the clock_gettime() function be reused from any other OCaml library?
<companion_cube> well just depend on unix or extunix (once they support this syscall); then you will have access to the function
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<elfring> How are the chances to measure software execution durations (in OCaml) with higher resolution than microseconds?
dsheets has joined #ocaml
<MasseR> Speaking of, what are my choices for datetime libraries? Batteries seemed to have something in an older version, but no longer
<companion_cube> MasseR: there are several alternatives on opam, but I don't know how good they are
<elfring> How challenging can it be to make missed POSIX functions accessible in a dynamic way?
cschneid has quit [Ping timeout: 244 seconds]
<companion_cube> you could try ctypes with dynamic loading
cschneid has joined #ocaml
<flux> jaseemabid, you should install merlin in addition to the tuareg you're using
uu_ has joined #ocaml
<uu_> hi, is there any fast way to kind of make an ocaml wrapper of a cpp(c++11) project?
<flux> masser, I think Calendar is the best, but it also quiet a big library, so it takes some effort to start using it
<MasseR> flux: ok, thanks
<MasseR> flux: http://calendar.forge.ocamlcore.org/ this one?
<Leonidas> uu_: if you need it fast, you could try using SWIG, it does seem to support OCaml output.
<Leonidas> or maybe there is already a swig-wrapper for your lib, so you could instruct it to generate OCaml sources.
uu_ is now known as uu
<uu> Leonidas: thx, with swig-wrapper, do I have to first warp my c++ interfaces into c?
<uu> Leonidas: maybe I have first to check SWIG a little ;)
<Leonidas> uu: I don't think so, that should be handled by swig. it even has a C target backend
<Leonidas> (although my experience with swig was rather painful, but that was many years ago)
<flux> masser, yes
<MasseR> Thanks
<uu> Leonidas: I am a little worried those c++11 stuff and boost stuff in my code... and template
<uu> they are handy to use, but seems troublesome to wrap
dsheets has quit [Ping timeout: 246 seconds]
<uu> oh!! that's really awesome !!
<Leonidas> just rewrite the lib in OCaml and you should be safe ;)
mort___ has joined #ocaml
<uu> Leonidas: thanks so much, I'll try asap.
<flux> uu, please share your experiences then :)
<Leonidas> uu: Sure! I too, would love to see your experiences with it written down somewhere :-)
<jaseemabid> flux: Okay.
uu has quit [Ping timeout: 256 seconds]
Muzer has quit [Ping timeout: 246 seconds]
dsheets has joined #ocaml
<jaseemabid> flux: Merlin seems to be showing the types better
elfring has quit [Read error: Connection reset by peer]
<flux> jaseemabid, merlin doesn't need to file to be compiled to pick up the types
elfring has joined #ocaml
<flux> ..for that particular file you have opened in the editor, but it does need the binary annotation to see the types from other modules
yenda- has joined #ocaml
<jaseemabid> flux: now merlin adds a unbound module error everywhere.
<flux> jaseemabid, do you use ocamlbuild?
<jaseemabid> flux: I dont mind using any. I'll do
<flux> jaseemabid, the issue is that it doesn't find the .cmi files
<flux> jaseemabid, you need to tell merlin the build directory if it's not . and also the list of packages you're using, ie. putting PKG batteries to .merlin
<flux> as merlin does the job of the compiler for finding out the types, it also needs the same information a compiler would
<jaseemabid> ocamlbuild Is now complaining that it cannot find core. I had to add a whole bunch of `-package foo -package bar` to ocamlfind. `-package` flag is ignored by ocamlbuild
Muzer has joined #ocaml
<jaseemabid> ocamlfind indeed added a .cmi file. Great if I can make merlin pick up that
<flux> jaseemabid, -use-ocamlfind
<flux> perhaps, I just use the _tags file for the rest of the options (in addition to -use-ocamlfind)
jaseemabid_ has joined #ocaml
jaseemabid has quit [Ping timeout: 246 seconds]
BhavyaM has quit [Ping timeout: 264 seconds]
KDr2 has quit [Remote host closed the connection]
adrien_ is now known as adrien
Oghma has joined #ocaml
antkong has joined #ocaml
julienXX has joined #ocaml
<jaseemabid_> how I do I make merlin pick up a cmi file? I got disconnected for a while and lost a couple of messages..
kakadu has joined #ocaml
<Oghma> Hi guys. Anyone can help me? When i execute this file (http://pastebin.com/Ap274EDS ) it return this error "Fatal error: exception Not_found". I think the error is in the function called tag_sentence (start at line 42) and it invoked in line 116. Fatal
ely-se has quit [Quit: leaving]
yomimono has joined #ocaml
<lyxia> Oghma: does the error not come from line 103?
jao has joined #ocaml
kolko has quit [Ping timeout: 255 seconds]
<lyxia> nvm
<Enjolras> jaseemabid_: where is your .merin ? do you have a "src" directory one level down the .merlin ?
<Enjolras> if so, you need to add B _build/src in .merlin
<jaseemabid_> Enjolras: I copy pasted a little boilerplate to .merlin and its workingl.
<Oghma> lyxia: but it print "model loaded" (line 111) and "tagger compiled" (line 113)
<Enjolras> jaseemabid_: that's unrelated, but since you are discovering the tooling, i would advise you to look at oasis. It takes care of a lot of stuffs for you. And it will call ocamlbuild under the hood
<jaseemabid_> too many tools. Multiple emacs modes, compilers, build tools, repls etc etc. This is overwhelming when you get started. thankfully I have some familiarity with ml languages
<jaseemabid_> Enjolras: I will check oasis. thank you :)
<flux> jaseemabid_, I haven't used this but this seems related :-) user-setup -- OPAM User Setup helper to configure various editors and tools for OCaml
<Enjolras> jaseemabid_: yeah, there is a tendency to rewrite tools from scratch in the community. But usually there is one "commonly seen as the best" project for each tool
<jaseemabid_> I'll be happy with a decent emacs mode and a makefile that works. The rest can come later. I'm just experimenting with a little chat server and client.
<Enjolras> oasis will auto-generate a makefile for you. See https://ocaml.org/learn/tutorials/setting_up_with_oasis.html
<Enjolras> doesn't generate a .merlin yet, you still have to keep it upt to date manually
<jaseemabid_> Enjolras: Its slightly sad. Wish someone replaced the standard ocaml repl rather than suggesting ledit. rlwrap or utop. Also all the build tools. As a user I really expect `ocaml foo.ml` to run the file
<jaseemabid_> And a simple `ocaml --repl foo.ml` to load all dependencies, evalutate the file and leave a repl for experimenting. or something like that
<Enjolras> there is some rationale for not implementing the depency handling in the compiler
<Enjolras> but once you get used to it, it's not an issue. Have a look at .mltop files for the repl for instance
<gasche> I agree we have a user-friendliness problem with OCaml tooling
<jaseemabid_> Enjolras: Yes. I understand. Its not an issue for experienced folks, but we need to build tools that help people get started easy, right?
<gasche> but it's really hard to improve the statu quo
<gasche> and basically nobody is paid to do it, so you have volunteer efforts that only go so far
<jaseemabid_> Haskell for eg, I believe have the same problem. Good tools and eco system, but everyone stops when they hear the m word
<Enjolras> gasche: i agree too, but i must say it has improved *a lot* in 3 years
<gasche> possibly, but it can still improve a lot more
<Enjolras> sure
<gasche> and beginners are not able to appreciate this; they just see the usability issues and they are rather brutal
<jaseemabid_> Enjolras: I had to use Ocaml 4 years back for an undergrad course, to write a little lambda calculus evaluator. I don't seem to remember anything though :(. Learned Haskell in the meanwhile, so the language seems mostly familiar. Just the tools
<gasche> this week-end I helped someone get up to speed with OCaml, and I was shocked at the number of tiny problems encountered along the way
<jaseemabid_> gasche: I think I came across about 20 issues before I could get a little tcp server up. I can probably write a tiny blog looking at my zsh_history :)
<jaseemabid_> Its sad when you have a great language and compiler, but the tooling is preventing people from using stuff.
<jaseemabid_> I hope I'll help someday in little ways I can :)
<jaseemabid_> I would have really preferred inline type annotations like Haskell. I don't understand why that never happened.
jaseemabid_ is now known as jaseemabid
<mrvn> like "let a = (1: int)"?
rand000 has joined #ocaml
_andre has joined #ocaml
<gasche> jaseemabid: you should absolutely write this list of issues down
<gasche> when I think of doing it in advance, I keep a list of everything I do precisely for this reason
<jaseemabid> gasche: Yes. I'll make sure of that.
<gasche> (I did this recently when I tried Why3 for the first time)
<gasche> to be honest it's not easy for upstream to act on this list of issues, because it often mixes a lot of different things with unclear responsibility etc., but it is still very helpful
<gasche> (I'm actually doing exactly this right now: https://github.com/Chris00/ocaml-cairo/issues/4 )
grouzen has quit [Ping timeout: 252 seconds]
tmtwd has joined #ocaml
ceryo has joined #ocaml
ely-se has joined #ocaml
<jaseemabid> What is wrong in this 4 line snippet? http://lpaste.net/138411 It says unbound value r
<jaseemabid> Is it because the body of the function needs to be a single expression?
<jaseemabid> Ah. ; vs ;; I guess.
obadz has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
micrypt has joined #ocaml
<ggole> ;; is only at top level, and you don't really need it except in the toplevel.
<ggole> Er, "in the repl" might be a less ambiguous way of stating that.
nightuser has joined #ocaml
<jaseemabid> Any examples of async working with blocking operations, like reading from input? Async lacks documentation pretty badly.
<jaseemabid> Google for `ocaml async input_line` and you get 0 useful results
<jaseemabid> Same with this cryptic message. ` [< `This_is_async__Think_about_blocking ]`
<Enjolras> is it really the name of the variant ? Haha :)
<jaseemabid> Yes. Google gives you 3 results, which point to the source file on github :)
<jaseemabid> That's it! Nothing more, nothing less
<Enjolras> (but i've never used async, only lwt, i have nothing more relevant to say unfortunatly)
<ggole> Jane St seem to be overly fond of that trick
<Enjolras> it's not bad to prefix variants to avoid namespace polution
<jaseemabid> I went though RWO, and got echo server running. Now I was hoping that I could spawn another thread, read from stdin and write back to the peer so that I have a little chat setup.
<jaseemabid> Now it looks like async and blocking reading combined will give me some head ache
<ggole> This isn't prefixing, they're giving an operation a wacky type that is meant to suggest that it shouldn't be used (in that way)
<Enjolras> jaseemabid: just in case you are not aware of this, libraries like tooling is quite fragmented. RWO presents you the "janestreet" version, Core and async. But you can also use Lwt for concurency
Oghma has quit []
<ggole> Just like core's (==)
<Enjolras> not saying you should, but since you are having a tour, i feel like mentionning it. the documentation is slightly better
<jaseemabid> Enjolras: Yeah. I figured that out already. They seem to have replaced a lot of standard functions. Like a tail recursive map etc
<jaseemabid> And something else with List.Assoc
<jaseemabid> there must be a way to read from stdin in a program which uses async, right? I'm looking for that.
AlexRussia_ has joined #ocaml
<jaseemabid> I think this is one area where haskell really shines. Arbitrary random libraries work together just fine. Also one area where python is horrible. `import gevent; gevent.monkey_patch()` and then you have no clue what works and what doesnt
AlexRussia has quit [Ping timeout: 260 seconds]
<jaseemabid> There is some info here about async and input_line http://www.cs.cornell.edu/courses/cs3110/2015sp/lectures/18/lec18.php
_andre has quit [Ping timeout: 244 seconds]
_andre has joined #ocaml
Nahra has quit [Remote host closed the connection]
nightuser has quit [Ping timeout: 245 seconds]
zpe has quit [Ping timeout: 240 seconds]
dhil has joined #ocaml
badkins has joined #ocaml
AltGr has left #ocaml [#ocaml]
govg has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
Jefffrey has joined #ocaml
zpe has joined #ocaml
ely-se has quit [Quit: leaving]
elfring has quit [Quit: Konversation terminated!]
ely-se has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
grouzen has joined #ocaml
lobo has joined #ocaml
ely-se has quit [Quit: leaving]
<jaseemabid> Quick help! How do I convert a `Async.Std.Reader.Read_result.t` into a string ?
yenda- has quit [Remote host closed the connection]
<jaseemabid> Is there a search by type tool for OCaml like hoogle?
<companion_cube> there is https://ocamloscope.herokuapp.com/
<companion_cube> but it doesn't index everything
<ggole> Just match on it
<ggole> type 'a t = [ `Eof | `Ok of 'a ]
<jaseemabid> 500 server error. Crap!
<companion_cube> funny
<jaseemabid> This is sad.
<companion_cube> you should report the bug
<ggole> jaseemabid: I got this from the async docs (which aren't all that nice, but do contain what you want)
<companion_cube> but I'm a bit disappointed too, I never got an answer to my request for supporting more libraries
<jaseemabid> Are you guys familiar with type holes of Agda? Haskell got it with 7.10. That is mind blowing stuff. Exactly what I miss
<companion_cube> you should talk to the authors of merlin :)
larhat has quit [Quit: Leaving.]
<jaseemabid> I can compile something like `function_that_needs_string (_a fancy_type)`. Here `_a` is of type (fancy -> string). The compiler will tell me all the functions that I can put there.
larhat has joined #ocaml
BitPuffin has joined #ocaml
<jaseemabid> I really miss that. The so called type driven programming
<companion_cube> I'd like it too
<def`> how does this differs from merlin?
<def`> tyoe __ and you re done.
<def`> type*
<companion_cube> def`: you really should write blog posts about lesser-known features of merlin
<companion_cube> including MerlinOutline
<def`> companion_cube: da
<jaseemabid> Ideally an experienced ocaml programmer should be able to find the function here, I assume? https://github.com/janestreet/async_unix/blob/f63af3842bc44cbd1d3b640106c164bab61f2e30/src/reader.mli
<def`> I will, projects are going according to the plan, just need time
<companion_cube> :)
* companion_cube imagines def` laughing in an evil way when saying "the plan"
Anarchos has joined #ocaml
<jaseemabid> No offense folks, I'm disappointed :(
<def`> By?
<jaseemabid> Ocaml.
govg has joined #ocaml
<Leonidas> GHC 7.8 didn't have type holes either :p
<companion_cube> def`: still, __ is flagged as an error by merlin for me
<def`> companion_cube: what would you like? this 'hole' to be silenced?
<jaseemabid> Leonidas: I know. But hoogle :)
<jaseemabid> Leonidas: I'm searching for a function with a known type signature since a long time :(
<def`> you get typechecking, completion
govg has quit [Client Quit]
govg has joined #ocaml
larhat has quit [Quit: Leaving.]
<jaseemabid> Leonidas: You remind me of the hero here to save #ocaml aka sparta :D
<Leonidas> jaseemabid: your function will not be of "-> string" type, but rather some async monad string.
larhat has joined #ocaml
<Leonidas> Though I have no idea, I use, as everybody else, Lwt :-)
<def`> jaseemabid: there is branch of merlin for that, 4 months before public release at least
<jaseemabid> Leonidas: http://lpaste.net/138419
<jaseemabid> Leonidas: I started with RWO and RWO suggested core and async.
ely-se has joined #ocaml
<jaseemabid> Leonidas: *IF* you had hoogle or type holes, its solved! :D
<ggole> Hopefully merlin will get to the point where you can put point on an identifier and run a command to bring up the documentation
<ggole> (Like lisp programmers have been doing for forty years, cough.)
<Leonidas> jaseemabid: what is upon?
larhat has quit [Quit: Leaving.]
<jaseemabid> I found it here. Looks like a callback mechanism http://www.cs.cornell.edu/courses/cs3110/2015sp/lectures/18/lec18.php
<Leonidas> oh, that seems to be from Async.
<jaseemabid> Yes. One tiny goddamn cast function and I'm done! :D :D
Haudegen has quit [Ping timeout: 260 seconds]
larhat has joined #ocaml
<Leonidas> but isn't line a string already?
<flux> jaseemabid, what are you writing?
<Leonidas> at least in the example you linked, line is a plain string.
<jaseemabid> Aha! found an example `Reader.read reader buffer` worked :) https://github.com/janestreet/async/blob/41fd13ad6b51c8bc1c6fed462d42b241732a4e67/example/cat.ml#L4
<jaseemabid> Now I can finally send messages b/w 2 terminals :)
<Enjolras> def`: i have a feature whish for merlin btw. Some function to auto add the signature of the function
<Enjolras> def`: it is handy when you want to make a function polymorphic
Haudegen has joined #ocaml
<companion_cube> def`: I heard about the "polarity" stuff in merlin, and am very excited
larhat has quit [Quit: Leaving.]
<Enjolras> what's that ?
<companion_cube> it's going to be a hoogle-like function for merlin
<Enjolras> nice
<companion_cube> give input and ouput types, and obtain a list of identifiers that would fit
<companion_cube> oh yeah
larhat has joined #ocaml
<Enjolras> no need to cycle through the whole list of autocomplete functions to find how companion_cube called this particular function in containers anymore :>
<companion_cube> right
tmtwd has quit [Ping timeout: 260 seconds]
tmtwd has joined #ocaml
Jefffrey has left #ocaml ["Leaving..."]
kolko has joined #ocaml
AlexRussia_ has quit [Read error: Connection reset by peer]
everyonemines has joined #ocaml
AlexRussia has joined #ocaml
samrat has joined #ocaml
zpe_ has joined #ocaml
ygrek has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
zpe has quit [Ping timeout: 252 seconds]
govg has joined #ocaml
MercurialAlchemi has joined #ocaml
marsam has joined #ocaml
everyonemines has left #ocaml [#ocaml]
marsam has quit [Remote host closed the connection]
marsam has joined #ocaml
mcclurmc has joined #ocaml
tane has joined #ocaml
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ely-se has quit [Client Quit]
govg has quit [Ping timeout: 245 seconds]
ely-se has joined #ocaml
dhil has quit [Quit: Leaving]
ollehar has joined #ocaml
tmtwd has quit [Ping timeout: 250 seconds]
ely-se has quit [Quit: leaving]
samrat has quit [Ping timeout: 255 seconds]
ollehar has quit [Ping timeout: 252 seconds]
samrat has joined #ocaml
tmtwd has joined #ocaml
ril has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
uris77 has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
GeorgeHahn has joined #ocaml
Anarchos has joined #ocaml
tane has quit [Quit: Verlassend]
Anarchos has quit [Client Quit]
GeorgeHahn has quit [Read error: Connection reset by peer]
mcclurmc has quit [Read error: Connection reset by peer]
GeorgeHahn has joined #ocaml
mcclurmc has joined #ocaml
uris77 has quit [Quit: leaving]
grouzen has quit [Ping timeout: 265 seconds]
badkins has quit [Read error: Connection reset by peer]
grouzen has joined #ocaml
darkf has quit [Quit: Leaving]
ely-se has joined #ocaml
ril is now known as ril[away]
antkong has quit [Quit: antkong]
zpe_ has quit [Remote host closed the connection]
jwatzman|work has joined #ocaml
ely-se has quit [Quit: Leaving...]
jeffmo has joined #ocaml
ril[away] is now known as ril
badkins has joined #ocaml
ollehar has joined #ocaml
MrScout has joined #ocaml
MrScout has quit [Read error: Connection reset by peer]
MrScout has joined #ocaml
<jaseemabid> Anyone used Command.basic with scheduler? I get no output from the program. Sounds related to `never_returns (Scheduler.go ())`.
samrat has quit [Ping timeout: 250 seconds]
samrat has joined #ocaml
slash^ has joined #ocaml
samrat has quit [Ping timeout: 244 seconds]
ely-se has joined #ocaml
samrat has joined #ocaml
johnf has quit [Read error: Connection reset by peer]
rand000 has quit [Ping timeout: 255 seconds]
johnf has joined #ocaml
psy_ has quit [Ping timeout: 260 seconds]
jao has joined #ocaml
Anarchos has joined #ocaml
kushal has joined #ocaml
<j0sh> i'm having a hard time 'unwrapping' a gadt in a way that ignores the type parameters
<j0sh> hard to explain, here's a short example
Anarchos has quit [Ping timeout: 244 seconds]
samrat has quit [Ping timeout: 246 seconds]
<j0sh> there are times i may want to constrain the matching on the variant (hence the GADT) but there are other times i want to ignore those constraints, and i'm not sure how to ignore them while making the compiler happy (or if it's even possible?)
kakadu has quit [Quit: Page closed]
psy_ has joined #ocaml
<mfp> j0sh: this types http://paste.debian.net/291049/
dsheets has quit [Ping timeout: 250 seconds]
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ocaml
<def`> j0sh: you introduce a abstract type (new type) when you want to the parameter to receive different types in the body of your function
AlexRussia has quit [Read error: Connection reset by peer]
<def`> you leave it a free variable ('a) when this parameter is not affected by your function, or instantiated only once
<def`> (newtype is the syntax "let f (type a) (g : a t) = …"
<ggole> j0sh: is the idea that a query can contain multiple kinds of ts?
ollehar has quit [Ping timeout: 255 seconds]
<j0sh> ggole: yes, the query can contain multiple kinds of ts
<j0sh> mfp: checking
samrat has joined #ocaml
<ggole> Then you probably need a gadt for the list to wrap the type parameter
<ggole> With mfp's approach the list has one parameter, and that's the only kind of t you can have in the list.
mort___ has quit [Ping timeout: 246 seconds]
<j0sh> ah, i see... didnt think of gadt'ing the list
<j0sh> mfp: your approach does work for my (simple) example, thanks
<j0sh> def`: is there a difference between "let f (type a)" versus "let f (type a.)" ? most of the examples i've seen use the latter
dsheets has joined #ocaml
<j0sh> and im not 100% clear on the distinction between locally abstract types and parametric polymorphism
<mfp> let f : type a. ... is both of the following at a time: let f (type a) .... (introducing abstract type) and let f : 'a -> ... (ensuring polymorphism)
<ggole> There are some cases where you need the latter for your program to type
<ggole> But this isn't one of them.
kushal has quit [Quit: Leaving]
<ggole> (Usually involving polymorphic recursion.)
<j0sh> mfp: oh i see, didn't realize "type a." was a special syntax
<mfp> btw., you need not use a list-like GADT, just one to hide the 'a in 'a t
<ggole> True, you could use type any = Any : 'a t -> any
<def`> j0sh: locally abstract type are the one which can be constrained in a pattern matching
<ggole> Then type query = any list
<mfp> yup
ril is now known as ril[away]
<def`> (different branches can have different constraints, that's the a). 'a are instantiated once and for all, or left free
<ggole> It's an extra indirection and maybe a bit more typing, but you get to reuse the List functions
<j0sh> i was hoping to avoid having to introduce another constructor, but i guess if that's the best way to do it...
<j0sh> def`: hmm, my understanding is not really intuitive yet. but i'll keep reading and play around with this some more
samrat has quit [Ping timeout: 240 seconds]
ril[away] is now known as ril
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ggole has quit []
ceryo has quit [Read error: Connection reset by peer]
ceryo has joined #ocaml
samrat has joined #ocaml
Anarchos has joined #ocaml
pyon has quit [Ping timeout: 255 seconds]
rand000 has joined #ocaml
samrat has quit [Ping timeout: 265 seconds]
kakadu has joined #ocaml
samrat has joined #ocaml
pyon has joined #ocaml
matason has quit []
mort___ has joined #ocaml
kushal has joined #ocaml
badkins has quit [Read error: Connection reset by peer]
badkins_ has joined #ocaml
badkins_ is now known as badkins
BitPuffin has quit [Ping timeout: 244 seconds]
jaseemabid has quit [Quit: Page closed]
mort___ has quit [Quit: Leaving.]
ygrek has joined #ocaml
moei has quit [Quit: Leaving...]
<ygrek> twimc, this blog is not in planet it seems -> http://kcsrk.info/blog/
Rebelion has joined #ocaml
samrat has quit [Ping timeout: 260 seconds]
samrat has joined #ocaml
<Anarchos> ygrek why not ?
<ygrek> you see it's posts in the planet?
samrat has quit [Ping timeout: 252 seconds]
samrat has joined #ocaml
dejanr has joined #ocaml
pyon has quit [Ping timeout: 240 seconds]
slash^ has quit [Read error: Connection reset by peer]
samrat has quit [Ping timeout: 264 seconds]
malc_ has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
samrat has joined #ocaml
pyon has joined #ocaml
marsam has quit [Remote host closed the connection]
marsam has joined #ocaml
samrat has quit [Ping timeout: 246 seconds]
GeorgeHahn has quit [Read error: Connection reset by peer]
claudiuc has joined #ocaml
zpe has joined #ocaml
evil-t0by has joined #ocaml
pyon has quit [Ping timeout: 265 seconds]
MrScout has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MrScout has joined #ocaml
pyon has joined #ocaml
pyon has quit [Client Quit]
pyon has joined #ocaml
swgillespie has joined #ocaml
johnf_ has joined #ocaml
NingaLeaf123 has quit [Ping timeout: 265 seconds]
johnf has quit [Ping timeout: 260 seconds]
carc has quit [Quit: QUIT]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
johnf has joined #ocaml
johnf_ has quit [Ping timeout: 250 seconds]
BitPuffin|osx has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
swgillespie has joined #ocaml
evil-t0by has quit [Quit: Bye!]
pyon has quit [Ping timeout: 244 seconds]
zpe has quit [Remote host closed the connection]
Simn has quit [Quit: Leaving]
pyon has joined #ocaml
MrScout has quit [Ping timeout: 246 seconds]
MrScout has joined #ocaml
sqweek has quit [Ping timeout: 244 seconds]
badkins has quit []
sqweek has joined #ocaml
moei has joined #ocaml
MrScout has quit [Remote host closed the connection]
malc_ has quit [Quit: leaving]
zpe has joined #ocaml
Lis has joined #ocaml
MrScout has joined #ocaml
<Lis> hello everyone. can someone give me a good overview of ocaml, what's typical for ocaml and what's the most important feature?
<companion_cube> hi! first, you can check ocaml.org and wikipedia. In a nutshell, Ocaml is a modern variant of ML: a mix of imperative and functional, expressive, and safe
ollehar has joined #ocaml
<companion_cube> its strong points are pattern matching, strong typing with type inference, objects, modules, GADTs
<companion_cube> basically it's quite fast, safe, and expressive.
<Lis> ok, every language claims to be safe in the functional domain :D
MrScout has quit [Ping timeout: 244 seconds]
<Lis> does the language change from version to version or does it stay the same?
<flux> lis, maybe this article is of interest to you: http://roscidus.com/blog/blog/2014/06/06/python-to-ocaml-retrospective/
<Lis> oh my god i hate python, but thank you
<Lis> i find it's runtime implementation uggly as hell
<ely-se> python is for python programmers
<flux> lis, ocaml has been adding some language features in the recent years. for example, the GADTs companion_cube mentioned.
<Lis> flux, ah ok, but it is backward compatible?
<profan> Lis: what, you don't enjoy them employing things such as eval for named tuples? (python does this) :D
<ely-se> named tuples are implemented with a horrible hack
<flux> mostly, but there is one particular feature that has had trouble with that: language preprocessor (a meta programming facility)
<flux> it has sort of an ugly history with names campl4, camlp5, but now I think things are cooling down with ppx :-)
<ely-se> the namedtuple constructor generates a string of Python and evals it, where the string represents a class definition
<flux> (camlp4, not campl4)
<ely-se> the result is all sorts of edge-cases you have to watch out for
<flux> lis, though it should be mentioned that ocaml programs usually don't write their own syntax extensions
<flux> lis, other than that, ocaml has been quite backwards-compatible
<Lis> hm i see why that language is used quiete often within research facilities
<flux> the other biggest backward incompatibilities have been because some construct has been found unsound and it's been made more strict in a more recent ocaml version. but that's essentially a bug fix.
<Lis> well, i come from haskell. everytime a new version comes out everyone needs to rewrite his libraries
<Lis> i love haskell but i need something more robust
<flux> and the third is that someone compiles with -warn-error and a new warning is introduced, but don't do that to released packages.. :)
<Lis> like i coded a programm in c, it still runs on windows 10 was writte for xp. and still runs on linux
<flux> lis, well, while the ocaml itself is quite safe from the language point of view (and its standard library), the libraries your program depends on may be a different matter..
<flux> usually you want to use the latest libraries anyway, when you resume hacking an older project
zpe has quit [Remote host closed the connection]
<flux> not all libraries are great at keeping 100% backwards compatibility.
<flux> but I guess one cannot blame ocaml for that :)
MrScout has joined #ocaml
<Lis> hm, i read about ocaml some while ago. and initially have a look at it becouse of unison
<Lis> can someone explain or guess why they chosen ocaml instead of java (which unison was originally written in) or maybe haskel erlang etc?
nightuser has joined #ocaml
<Lis> i just want to know weather it would be worth starting some major ocaml tutorials over the weekends.
<flux> difficult to say. perhaps they fancied ocaml more. or they wanted an environment that didn't require a runtime. ocaml can compile into native binaries.
<flux> in fact, probably exactly that because a Java dependency wasn't probably a great thing to have at 2005
<flux> (unison 2.13.0 was released then)
<companion_cube> or because unison was written by researchers, some of whom like OCaml's expressiveness and speed
<Lis> one of them stated becouse of the module system ocaml has
<Lis> thanks for the site btw flux
dejanr has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ygrek has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xificurC has quit [Ping timeout: 264 seconds]
<ollehar> anyone awake? you think I could adapt the ocaml gc to fit into the LLVM gc interface?
nightuser has quit [Read error: Connection reset by peer]
nightuser has joined #ocaml
MrScout has quit [Remote host closed the connection]
<bitbckt> probably.
<ollehar> bitbckt: ok
<ollehar> is it will decoupled?
swgillespie has joined #ocaml
<bitbckt> uhm. not as well as you'll probably wish.
badkins has joined #ocaml
<bitbckt> {major,minor}_gc.h in that dir, as well.
<ollehar> bitbckt: thanks
<bitbckt> good luck...
<ollehar> bitbckt: oh, it's made in C??
<bitbckt> yes.
<ollehar> hm
ely-se has quit [Quit: Leaving...]
<bitbckt> maybe I mis-assume how you want to use it... say more.
<companion_cube> ollehar: how recent is the LLVM GC interface?
tmtwd has quit [Ping timeout: 246 seconds]
<companion_cube> I know people here said support for GC was not sufficient, a few months ago
<companion_cube> ask Drup, whitequark
<bitbckt> Phillip and Sanjoy at Azul have been working on that.
<bitbckt> they gave a talk about it last year.
<bitbckt> not sure if that has made progress toward mainline, though...
systmkor has joined #ocaml
<ollehar> companion_cube: not sure, but yes.
<ollehar> it's getting better, it seems.
<ollehar> will sleep, thanks for the info
ollehar has quit [Quit: ollehar]
rand000 has quit [Quit: leaving]
marsam has quit [Read error: Connection reset by peer]
pyon is now known as grum-pyon
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
kakadu has quit [Remote host closed the connection]
marsam has joined #ocaml
marsam has quit [Remote host closed the connection]
marsam has joined #ocaml
nightuser has quit [Read error: Connection reset by peer]
nightuser has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
nightuser has quit [Ping timeout: 256 seconds]
marsam has quit [Remote host closed the connection]
nightuser has joined #ocaml
antkong has joined #ocaml
Haudegen has quit [Ping timeout: 250 seconds]
antkong has quit [Client Quit]
nightuser has quit [Ping timeout: 244 seconds]
antkong has joined #ocaml
jao has quit [Ping timeout: 255 seconds]
Haudegen has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
segmond has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
Haudegen has joined #ocaml