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
manizzle has quit [Ping timeout: 256 seconds]
Rebelion has quit [Ping timeout: 256 seconds]
badon has joined #ocaml
travisbrady has joined #ocaml
RossJH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Yoric has quit [Remote host closed the connection]
Rebelion has joined #ocaml
AltGr has joined #ocaml
Yoric has joined #ocaml
Rebelion has quit [Ping timeout: 256 seconds]
rock_neurotiko has quit [Remote host closed the connection]
bluebelle has quit []
Yoric has quit [Remote host closed the connection]
rock_neurotiko has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
Simn has quit [Quit: Leaving]
NoNNaN has quit [Remote host closed the connection]
Rebelion has joined #ocaml
NoNNaN has joined #ocaml
Rebelion has quit [Ping timeout: 244 seconds]
jao has quit [Ping timeout: 264 seconds]
Rebelion has joined #ocaml
dav has quit [Ping timeout: 244 seconds]
<Leonidas> Tekk_: I believe you need to generate stubs via ctypes
travisbrady has quit [Quit: travisbrady]
dav has joined #ocaml
Rebelion has quit [Ping timeout: 256 seconds]
BitPuffin has quit [Ping timeout: 256 seconds]
travisbrady has joined #ocaml
Rebelion has joined #ocaml
ahem2 has quit [Ping timeout: 245 seconds]
<Tekk_> thanks Leonidas
shinnya_ has quit [Ping timeout: 256 seconds]
Rebelion has quit [Ping timeout: 264 seconds]
MrScout_ has joined #ocaml
MrScout_ has quit [Read error: Connection reset by peer]
Rebelion has joined #ocaml
MrScout has quit [Ping timeout: 244 seconds]
struktured has joined #ocaml
dav has quit [Ping timeout: 255 seconds]
dav has joined #ocaml
travisbrady has quit [Quit: travisbrady]
struktured has quit [Ping timeout: 244 seconds]
travisbrady has joined #ocaml
rgrinberg has quit [Ping timeout: 265 seconds]
rgrinberg has joined #ocaml
dav has quit [Ping timeout: 245 seconds]
jao has joined #ocaml
jao has quit [Ping timeout: 244 seconds]
shaykha has joined #ocaml
govg has quit [Ping timeout: 264 seconds]
gdsfh1 has quit [Ping timeout: 264 seconds]
alkoma has joined #ocaml
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
jao has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
travisbrady has quit [Quit: travisbrady]
oscar_toro has quit [Ping timeout: 255 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
moei has quit [Quit: Leaving...]
gdsfh has joined #ocaml
marynate has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
thomasga has quit [Quit: Leaving.]
jao has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
jao has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
alkoma has quit [Remote host closed the connection]
funtik_ has quit [Remote host closed the connection]
kapil__ has joined #ocaml
funtik_ has joined #ocaml
jao has joined #ocaml
jao has quit [Ping timeout: 244 seconds]
darkf has joined #ocaml
govg has joined #ocaml
anemator has joined #ocaml
anemator has quit [Client Quit]
ygrek has joined #ocaml
jao has joined #ocaml
badkins has joined #ocaml
MrScout_ has joined #ocaml
MotorMe has joined #ocaml
MrScout_ has quit [Remote host closed the connection]
t4nk495 has quit [Ping timeout: 246 seconds]
jao has quit [Ping timeout: 255 seconds]
vanila has joined #ocaml
mcc has joined #ocaml
q66 has quit [Quit: Leaving]
nojb has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 244 seconds]
badkins has quit []
rgrinberg has joined #ocaml
MrScout_ has joined #ocaml
MrScout_ has quit [Read error: Connection reset by peer]
MrScout_ has joined #ocaml
MrScout_ has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Quit: Leaving.]
samrat has joined #ocaml
natrium1970 has joined #ocaml
<natrium1970> I have a question about modules, signatures, and hiding. One book gives an example: module type GENSYM = sig … end. Then module Gensym : GENSYM = struct … (* Only stuff declared in GENSYM will be visible from outside *) end.
<natrium1970> That works fine if GENSYM and Gensym are in a single file, but the file itself acts as a module, so GENSYM and Gensym are submodules of whatever file they’re in. What if I wanted to put GENSYM in GENSYM.mli and Gensym.ml so that I didn’t have the extra layer of module? Because the Gensym = module struct … end is implicit by placing it in its own file, there’s no place to put an equivalent to Gensym : GENSYM.
<natrium1970> In other words, how do I put a signature constraints on a top-level module?
nojb has quit [Quit: nojb]
<whitequark> so in module M : S = I, S is the contents of the mli file, and I is the contents of ml file
<whitequark> you could either put the contents of module type GENSYM in the mli file, or include GENSYM there
<natrium1970> So if I wanted module GensymOne and GensymTwo, each in a different file, and both constrained to GENSYM, there’s no easy way to do that?
<whitequark> as I've said, you can do include GENSYM
<whitequark> as in, not textually include, just write "include GENSYM"
<whitequark> or rather, "include X_intf.GENSYM", where X_intf is some other file defining GENSYM
rgrinberg has joined #ocaml
ggole has joined #ocaml
<whitequark> Tekk_: even with cstubs, you need to recite a enum entirely
mcc has quit [Quit: This computer has gone to sleep]
<natrium1970> Ah. Okay. Thanks. This seems to be made more complicated by the way OCaml implicitly wraps module struct around .ml file and sigantures around .mli files. That’s kind of confusing me. A lot of languages require you to say MODULE Blah = …. even though the filename is Blah.m3.
enitiz has quit [Ping timeout: 264 seconds]
<natrium1970> I’m trying to figure out some of this with books I’ve found on OCaml, but some of the books are out of date. Like one says that OCaml lacks first-class modules, which it apparently did lack at the time the book was written
<vanila> I think real world ocaml is pretty modern, thats what im learning form
<natrium1970> Yeah, but I’m trying to avoid Core, which is (no pun intended) pervasive in that book.
<vanila> hahaha
<natrium1970> Bcause Core does not play nice with js_of_ocaml.
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
<natrium1970> I know the simple stuff that doesn’t involve modules or objects from one of my courses.
natrium1970 has quit [Quit: natrium1970]
ygrek has quit [Ping timeout: 252 seconds]
govg has quit [Ping timeout: 245 seconds]
malc_ has quit [Quit: leaving]
rgrinberg has quit [Quit: Leaving.]
fafounetbis has joined #ocaml
shaykha has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
keen__________27 has joined #ocaml
keen__________26 has quit [Ping timeout: 244 seconds]
fafounetbis has quit [Ping timeout: 256 seconds]
zwer_w has joined #ocaml
zwer has quit [Ping timeout: 250 seconds]
moei has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
Pepe_ has quit [Ping timeout: 264 seconds]
kakadu has joined #ocaml
govg has joined #ocaml
govg is now known as Guest27395
Guest27395 has quit [Client Quit]
hekmek has joined #ocaml
MercurialAlchemi has joined #ocaml
MotorMe has quit [Remote host closed the connection]
martintrojer has quit [Ping timeout: 245 seconds]
chinglish has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
martintrojer has joined #ocaml
samrat has joined #ocaml
Yoric has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
AltGr has left #ocaml [#ocaml]
slash^ has joined #ocaml
paolooo_ has joined #ocaml
paolooo_ has quit [Client Quit]
paolooo has joined #ocaml
mort___ has joined #ocaml
paolooo has quit [Client Quit]
marynate has quit [Quit: Leaving]
Haudegen has quit [Ping timeout: 245 seconds]
contempt has quit [Remote host closed the connection]
Haudegen has joined #ocaml
contempt has joined #ocaml
iZsh has quit [Quit: ZNC - http://znc.in]
iZsh has joined #ocaml
govg has joined #ocaml
mengu has joined #ocaml
keen__________28 has joined #ocaml
keen__________27 has quit [Ping timeout: 244 seconds]
RossJH has joined #ocaml
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mort___ has quit [Quit: Leaving.]
adrien has quit [Ping timeout: 255 seconds]
mengu has quit [Ping timeout: 264 seconds]
mort___ has joined #ocaml
matason has joined #ocaml
adrien has joined #ocaml
mengu has joined #ocaml
Simn has joined #ocaml
psy_ has joined #ocaml
mort___ has quit [Quit: Leaving.]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
matason has quit [Ping timeout: 264 seconds]
mengu has quit [Ping timeout: 244 seconds]
Hannibal_Smith has joined #ocaml
kakadu has quit [Ping timeout: 264 seconds]
kakadu has joined #ocaml
psy_ has quit [Ping timeout: 256 seconds]
zwer_w is now known as zwer
psy_ has joined #ocaml
Anarchos has joined #ocaml
mengu has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
oscar_toro has joined #ocaml
Pepe_ has joined #ocaml
chinglish has quit [Ping timeout: 245 seconds]
Pepe_ has joined #ocaml
chinglish has joined #ocaml
contempt has quit [Ping timeout: 264 seconds]
contempt has joined #ocaml
nojb has joined #ocaml
contempt has quit [Ping timeout: 245 seconds]
contempt has joined #ocaml
nze` has quit [Ping timeout: 252 seconds]
dsheets__ has quit [Ping timeout: 264 seconds]
Thooms has joined #ocaml
nojb has quit [Quit: nojb]
chinglish has quit [Ping timeout: 240 seconds]
chinglish has joined #ocaml
nojb has joined #ocaml
contempt has quit [Disconnected by services]
nojb has quit [Client Quit]
mengu has quit [Remote host closed the connection]
contempt has joined #ocaml
mengu has joined #ocaml
nojb has joined #ocaml
jave has joined #ocaml
mengu has quit [Ping timeout: 255 seconds]
tane has joined #ocaml
samrat has joined #ocaml
Yoric has quit [Remote host closed the connection]
enitiz has joined #ocaml
kapil__ has quit [Quit: Connection closed for inactivity]
nojb has quit [Quit: nojb]
nojb has joined #ocaml
nojb has quit [Client Quit]
struktured has quit [Ping timeout: 265 seconds]
nojb has joined #ocaml
nojb has quit [Client Quit]
nojb has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
nojb has quit [Ping timeout: 245 seconds]
slash^ has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
nojb has joined #ocaml
mengu has joined #ocaml
axiles has joined #ocaml
q66 has joined #ocaml
BitPuffin has joined #ocaml
BitPuffin has quit [Ping timeout: 255 seconds]
malc_ has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
axiles has quit [Read error: Connection reset by peer]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
struktured has joined #ocaml
mengu has quit [Ping timeout: 240 seconds]
axiles has joined #ocaml
leowzukw has joined #ocaml
Rebelion has quit [Ping timeout: 244 seconds]
axiles has quit [Ping timeout: 265 seconds]
axiles has joined #ocaml
nojb has quit [Quit: nojb]
govg has quit [Ping timeout: 264 seconds]
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
dsheets__ has joined #ocaml
dsheets__ has quit [Ping timeout: 245 seconds]
govg has joined #ocaml
darkf has quit [Quit: Leaving]
mort___ has joined #ocaml
shaykha has joined #ocaml
nojb has joined #ocaml
vanila has quit [Quit: Leaving]
shaykha` has joined #ocaml
badkins has joined #ocaml
shaykha has quit [Ping timeout: 244 seconds]
manizzle has joined #ocaml
leowzukw has quit [Quit: Lost terminal]
samrat has quit [Remote host closed the connection]
tnguyen has quit [Quit: tnguyen]
marynate has joined #ocaml
samrat has joined #ocaml
Muzer has quit [Read error: Connection reset by peer]
marynate has quit [Max SendQ exceeded]
marynate has joined #ocaml
marynate has quit [Max SendQ exceeded]
marynate has joined #ocaml
dsheets__ has joined #ocaml
Muzer has joined #ocaml
rgrinberg has joined #ocaml
hekmek has quit [Quit: Verlassend]
jgjl has joined #ocaml
manizzle has quit [Ping timeout: 265 seconds]
dpf341 has joined #ocaml
shaykha` has quit [Ping timeout: 240 seconds]
flux has quit [Ping timeout: 244 seconds]
shaykha` has joined #ocaml
dpf341 has quit [Quit: WeeChat 0.4.2]
nojb has quit [Quit: nojb]
flux has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]
struktured has quit [Ping timeout: 256 seconds]
<badkins> I was reading through a comparison of OCaml, Haskell & Scheme here: http://lambda.jimpryor.net/translating_between_OCaml_Scheme_and_Haskell/ and in the section "Functions" he shows 3 different types of function declarations and recommends against the third.
<badkins> Which is: let rec factorial : int -> int = function .... any ideas why that's not recommended ?
<Drup> because he's an haskellist and using haskell's idioms, I suppose
<badkins> As a newbie, I thought that form seemed pretty good if you knew you were going to pattern match.
<Drup> That's how I would write it, minus the type annotation
<mrvn> let ocaml figure out the types.
<mrvn> I don't like when people write: let fac x = match x with ...
<badkins> sure - I typically don't annotate types - he was just showing the full syntax for comparison
<badkins> I did learn about OCaml's guards from the article - it doesn't seem to be mentioned in RWO for some reason.
<Drup> it's a bit weird to show plenty of OCaml syntax and only one Haskell syntax, while you can perfectly write functions in plenty of different ways in haskell too ...
<badkins> does show up here though: http://www.mpi-sws.org/~rossberg/sml-vs-ocaml.html
<Drup> ahah, this page is so obviously written by an haskell person :D
<ggole> I don't think Andreas Rossberg is a Haskell guy
<Drup> well, he tries very hard to be neutral without really succeeding.
<Drup> ggole: I'm talking about the previous link, not the sml/ocaml one
<ggole> Oh right, never mind then
<mrvn> When switching from ocaml to C++ I always want to write: auto foo(auto x, auto y) { return x + y; }
<whitequark> have you seen the last mail on caml-list
<Drup> ?
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Muzer has quit [Ping timeout: 264 seconds]
marynate has quit [Quit: Leaving]
shaykha` has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
jgjl has quit [Ping timeout: 256 seconds]
<mrvn> whitequark: ?
<mrvn> Subject: [Caml-list] Ocaml programmers interested in human-level AI
<mrvn> ?
<ousado> LOL human-level AI
<whitequark> yep
<Drup> oh, I just skipped "human-level" and just read "AI"
<whitequark> "we have a startup working on that subject"
<whitequark> it's hysterical
<cmtptr> what do you guys tend to use to build ocaml projects? ocamlbuild is not intuitive to me at all. is it sacreligious to just write my own makefile?
<mrvn> When I write an AI why would I want to limit it to be as stupid as a human? :)
<mrvn> cmtptr: _oasis
<mrvn> cmtptr: whatever you do use ocaml findlib
<cmtptr> thanks
Muzer has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
matason has joined #ocaml
badon has quit [Ping timeout: 250 seconds]
struktured has joined #ocaml
Haudegen has quit [Ping timeout: 265 seconds]
badon has joined #ocaml
<ggole> whitequark: tell them to ask it to write a decent build system
<whitequark> lol
<adrien> Drup: Andreas' Rossberg page has been around for a looooooooong time
<adrien> ah, hadn't seen the previous one :)
<adrien> also, for the last mail on the ML, it's not the first time I find the author "bold"
<Drup> adrien: again, I was not talking of this page.
<adrien> yeah, saw that a bit after :P
<adrien> you're similar to Str in usage actually :)
<Drup> :<
<whitequark> wow rude
<whitequark> ggole: ... I actually did
<ggole> Haha
<ggole> This can't possibly end well
<Drup> :D
<ggole> The robot revolution will begin when they realise we're asking them to do the impossible
<adrien> :)
<adrien> ggole: that'll keep them busy
<struktured> whitequark: human-level AI is probably supposed to be "strong" AI
<struktured> but yeah it sounds incredibly sophomoric
<whitequark> typical silly valley arrogance, too
<whitequark> struktured: someone on twitter suggested "strongai.ly"
mort___ has quit [Quit: Leaving.]
<ggole> There's interesting recent progress in fields like image recognition
<ggole> But what a sad load AI has been over the years
<whitequark> i'm wondering how much of that progress can be attributed to moore's law
<whitequark> google used how many machines, 8k?, for their cat picture recognizer?
<struktured> ggole: the funniest part is how AI is kinda going in circles. we are back to deep neural networks, 15 years later
Haudegen has joined #ocaml
<ggole> I don't know enough to say whether it's the latest tricks that have done it
<Drup> struktured: that's the whole storry of compsci (or even science in general). Nothing surprising here.
<whitequark> ggole: I do recall a few tricks, but I feel like the whole second coming of AI is kind of overrated.
<whitequark> same old story, a few orders of magnitude cheaper CPU time
<ggole> We'll see
<ggole> And not from the startups, I suspect
<struktured> whitequark: AI is not just optmization, it's all policy / control theory with imperfect information and minimal resources
<whitequark> sure
<struktured> *all/also
<struktured> Drup: ha but one not cyclical similar thing I see is AI and machine learning are basically applications of apparently useless math established 50-500 years ago
<Drup> that's ... also very cyclical..
<struktured> Drup: well its not the same state because now we can exercise dusty math papers with fancy computer simulations
<Drup> sure
<Drup> but I mean, it's also exactly what's happening in science in general all the time
<Drup> someone invents something
<Drup> it's deemed completely impossible to use or useless at the time
<Drup> and someone exhumes it 20 to several hundred of years later because it's now useful/practical with modern methods.
<struktured> indeed
<cmtptr> is it common practice to put ;; on a line by itself, or do people generally thing this is ugly?
<Drup> it's ugly and useless :p
NoNNaN has quit [Quit: []]
tnguyen has joined #ocaml
<mrvn> cmtptr: never put ;; in a file. That's just for interactive typiong
<cmtptr> aren't there cases where you have to?
<mrvn> no
Hannibal_Smith has joined #ocaml
<cmtptr> well alright then!
psy__ has joined #ocaml
<ggole> Yes, but those are never necessary.
<mrvn> There are cases though where it gives errors
<Drup> whitequark: he answered seriously ._.
psy__ has quit [Client Quit]
psy_ has quit [Quit: Leaving]
hekmek has joined #ocaml
matason has quit [Ping timeout: 265 seconds]
psy_ has joined #ocaml
<cmtptr> er, no composition operator? how do I write partial application like "print_endline . to-string"?
<cmtptr> that is, "let print_expr = print_endline . to_string"
<Drup> cmtptr: let print_ext x = print_endline @@ to_string x
<mrvn> cmtptr: let print_expr e = Printf.printf "\n%s%!" (to_string e)
<cmtptr> so in other words, you just don't, I guess. fair enough, thanks
<Drup> mrvn: if you go this way, use %a ;)
<mrvn> cmtptr: make your own: let (@@@) f1 f2 x = f1 (f2 x)
<mrvn> Drup: can I pass to_string to %a?
<whitequark> Drup: I think I started the most ridiculous thread of the year
<whitequark> well, not started
<cmtptr> ah, cool. haven't gotten far enough to have seen the definition of infix functions yet
nojb has joined #ocaml
<Drup> mrvn: sure
<Drup> at least if you are rendering to a string
<Drup> ah, maybe only for asprintf, not printf
<mrvn> Drup: "%a" (fun out x -> print_string (to_string x))?
<Drup> meh, Print is annoying, I prefer Format, it's more consistent
<whitequark> ugh, ignoring "out"
<Drup> mrvn: no, that's the worst idea you could come up with.
<Drup> yeah, ok, you can't give to_string directly, even with sprintf
<Drup> (as I said, meh Print)
<mrvn> Drup: "%a" (fun out x -> Printf.kfprintf out ((to_string x)) to be correct. I prefer %s
<Drup> yeah
<mrvn> (+ the missing args)
<Drup> Libraries should provide a pp function anyway :>
<mrvn> fun out x -> output_string out (to_string x) is simpler, but still way more than %s
<mrvn> Drup: or just get one from ppx
hekmek has quit [Quit: Verlassend]
<ggole> It would be nice to be able to write one printer and get/derive (efficient) versions of everything you would otherwise duplicate
<Drup> ggole: you mean, like deriving ? :D
<mrvn> like sexplib does?
<ggole> Can you control the output of deriving?
<Drup> to an extend, yes
<ggole> I should probably have a closer look some time.
<mrvn> you can always overwrite the function with your own prettied up one.
<whitequark> or even request to see the output of deriving using merlin or something
<whitequark> (not that merlin implements it right now, I don't think so)
rgrinberg has joined #ocaml
<mrvn> can you annotate fields of a type to use a different printer?
NoNNaN has joined #ocaml
<def`> whitequark: implement what?
<mrvn> type r = { x : int; hidden : int [%printer fun _ -> ()]; } or something
<def`> expanding ppx?
<whitequark> yea
<whitequark> mrvn: yes you can do, it's even almost exact same syntax
<whitequark> @printer
<def`> interesting idea :)
<whitequark> although in this case you'd use [@opaque]
<def`> I'll.think about that, sounds cool
<mrvn> does sexplib support ppx yet?
<ggole> Hmm, nice idea
<whitequark> mrvn: no
<whitequark> "Re: [Caml-list] opam-installext (Was: Ocaml programmers interested in human-level AI)" uhhhhh
<ggole> Emacs has things for running the C preprocessor or lisp macros
<ggole> And they are handy
<Drup> whitequark: there will be issues with pprintast.
<whitequark> where?
<Drup> to output the code generated from the ppx
<whitequark> why?
<Drup> because pprintast sucks and is buggy as fuck ?
<rks`> pprintast ou pprinttyped ?
<whitequark> I found it sufficiently usable
<rks`> wait, maybe pprinttyped doesn't exist
<rks`> nevermind me.
<Drup> pprinttyped doesn't exist no. you have to use untypeast
pyon has joined #ocaml
<rks`> yep
<rks`> (printtyped exists, not pp...)
matason has joined #ocaml
moei has quit [Read error: Connection reset by peer]
moei has joined #ocaml
travisbrady has joined #ocaml
matason has quit [Quit: leaving]
<Drup> whitequark: should the annotation [@@ocaml.deprecated .. ] be in the .mli or the .ml ?
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
oscar_toro has quit [Ping timeout: 244 seconds]
<whitequark> mli
<whitequark> in ml it will not work
<Drup> ok
enitiz has quit [Ping timeout: 245 seconds]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
jonludlam has joined #ocaml
tnguyen has quit [Quit: tnguyen]
Yoric has quit [Ping timeout: 265 seconds]
ente has joined #ocaml
rock_neurotiko has quit [Ping timeout: 245 seconds]
alkoma has joined #ocaml
tani has joined #ocaml
tane is now known as Guest2590
Guest2590 has quit [Killed (rajaniemi.freenode.net (Nickname regained by services))]
tani is now known as tane
slash^ has quit [Read error: Connection reset by peer]
travisbrady has quit [Quit: travisbrady]
nojb has quit [Quit: nojb]
Yoric has joined #ocaml
<dmbaturin> Is it a bad idea to use an optional argument for a tail-recursive function accumulator instead of using a nested function?
reynir is now known as gunslinger
axiles has quit [Ping timeout: 264 seconds]
gunslinger is now known as reynir
rock_neurotiko has joined #ocaml
Yoric has quit [Remote host closed the connection]
jgjl has joined #ocaml
axiles has joined #ocaml
ggole has quit []
kotee has joined #ocaml
malc_ has quit [Quit: leaving]
oscar_toro has joined #ocaml
lupine is now known as lumpen
samrat has quit [Quit: Computer has gone to sleep.]
rock_neurotiko has quit [Ping timeout: 244 seconds]
knoedl has joined #ocaml
<knoedl> hi
<knoedl> why can't one write this : http://pastebin.com/H86LQWsv ?
<knoedl> and what would be a good alternative?
<Drup> dmbaturin: it exposes an implementation detail, which is meh.
<Drup> knoedl: put paranthesis around ([] as xs)
<dmbaturin> Drup: Good point.
<knoedl> thanks Drup, why are they needed?
<knoedl> i don't see how the code is ambiguous without them
<Drup> because "as" as the lowest priority
<Drup> has*
<Drup> knoedl: it's simply a parsing issue, nothing else
<knoedl> ok thanks!
jprakash has joined #ocaml
lumpen is now known as lupine
rock_neurotiko has joined #ocaml
nullcat has joined #ocaml
<nullcat> What advantages does OCaml have compared with Haskell?
<whitequark> less people who like to explain monads, badly
<def`> :DD
<def`> you're in a particularly good mood today
<def`> nullcat: predictibility, simplicity
<nullcat> i see
<dmbaturin> OCaml has a camel mascot, haskell does not.
<nullcat> +1 lol
MisaMisa has joined #ocaml
<dmbaturin> http://blog.enfranchisedmind.com/2007/08/a-monad-tutorial-for-ocaml/ There is at least one monad tutorial though.
<nullcat> def` can you explain more on 'predictibility'?
<dmbaturin> OCaml is eager by default.
Hannibal_Smith has quit [Ping timeout: 245 seconds]
<Tekk_> anyone know if ctypes provides coercions between the primitive types? mostly u8_t -> int, u32_t -> int, etc.
Hannibal_Smith has joined #ocaml
<MisaMisa> I don't see how laziness == unpredictibity, especially since haskell is pure functional (most of the time)
<Tekk_> MisaMisa: in the sense that when you do something you know that you did that something
<Tekk_> not that you'll suddenly have some big I/O wave hit you somewhere down the road when you're not necessarily expecting it
<nullcat> FYI, MisaMisa is one of my friend who is a Haskell guy and asks me that question..
<Drup> MisaMisa: haskell is not pure functional most of the time
travisbrady has joined #ocaml
<Drup> it's side effects are controlled
<Drup> It's not the same thing.
BitPuffin has joined #ocaml
<Drup> its*
<Tekk_> actually it's impossible to write a pure functional haskell program technically
<Tekk_> right?
<MisaMisa> of course
<Tekk_> but that's a bit nitpicky :)
<adrien> Drup: "its"
rgrinberg has quit [Quit: Leaving.]
<Drup> adrien: too late :D
<Hannibal_Smith> Some things to consider about a lazy language like Haskell
<nullcat> thx
<dmbaturin> Speaking of that, what exactly are existential types?
rock_neurotiko has quit [Ping timeout: 264 seconds]
mengu has quit []
oscar_toro has quit [Ping timeout: 240 seconds]
jonludlam has quit [Quit: Coyote finally caught me]
NSA360 has joined #ocaml
rgrinberg has joined #ocaml
BitPuffin has quit [Ping timeout: 264 seconds]
travisbrady has quit [Ping timeout: 255 seconds]
<Drup> MisaMisa: so, to answer your question, there are various design decision in Haskell that I don't like and that, imho, make programming in it unnecessary hard.
<Drup> 1) reasoning about performances in haskell is hard, because of lazyness and typeclass and the whole optimization framework based on rules (when they don't apply, your performances suck really badly).
<Drup> 2) I don't like restrained side effects with monads. algebraic effects are much better but if I have to choose between monads and nothing, I prefer nothing.
<MisaMisa> hmm...
<Drup> 3) Typeclasses, as implemented in Haskell, present a set of issues that makes the code hard to read.
<Drup> 4) I don't like the tendency of the haskell community to play type riddles.
<Drup> that includes the recent trend of transforming GHC Haskell in a dependently typed language.
<Drup> (there are various other points that makes me prefer OCaml, like the fact that records are much better, that I like OCaml's functors, that OCaml has various possibilities to do subtyping and that js_of_ocaml is very good :p)
<NSA360> Hi. Im trying to make a log parser in ocaml. Its been hard to understand but i did already the lexer and the parser and it went well, but... without an ast. can you help me how can i do that? I guess its very simples but... :/
<NSA360> [S [TittleA MultipleLinesA] [TittleB MultiplesLinesB] [TittleC MultiplesLines C ] [TittleD MultiplesLines D] ]]
<dmbaturin> A tiny points that annoys me in haskell: in ocaml REPL you can enter any program that can be fed to compiler, in GHCi it's not the case. :)
<dmbaturin> * point
<Tekk_> dmbaturin: how does that work?
<Drup> NSA360: what is the question ? ^^
* Tekk_ has never seen the limitations of ghci
<dmbaturin> NSA360: What did you use for the lexer and parser?
<Tekk_> I've never really messed with haskell to begin with actually
<NSA360> ocamllex and ocamlyacc
<Drup> oh, also, in the whole ocaml vs haskell : merlin is much better than ghc-mod :D
<Drup> (and cabal is terrible terrible terrible)
<dmbaturin> Tekk_: Well, haskell function-level pattern matching uses multiple lines (as in "length [] = 0 \n length (x:xs) = 1 + length xs". GHCi doesn't recognize this as a single function if you enter it line by line (unless I'm missing some trick for it).
<NSA360> The question is: how can i make an ast tree for this grammar [S [TittleA MultipleLinesA] [TittleB MultiplesLinesB] [TittleC MultiplesLines C ] [TittleD MultiplesLines D] ]]
<Tekk_> dmbaturin: ah
<Drup> NSA360: you just did ? ^^
<dmbaturin> Tekk_: Also, GHCi requires that all expressions are prefixed with "let", while compiler doesn't support this syntax, so you can't just paste into REPL from source file and back.
<Drup> NSA360: what is the output of your parser at the moment ?
<MisaMisa> dmbaturin: you need to wrap your input with :{ and :}
<Drup> unhappy smiley and happy smiley
<MisaMisa> so I was just curious about the difference between two programming languages; the answer I received are beyond my expectations...
nojb has joined #ocaml
nojb has quit [Client Quit]
<Drup> ah, I though you wanted something opinionated :D
keen__________29 has joined #ocaml
Yoric has joined #ocaml
<Drup> If you want something relatively neutral: http://blog.ezyang.com/2010/10/ocaml-for-haskellers/
<dmbaturin> MisaMisa: Hhm. unknown command ':{'
keen__________28 has quit [Ping timeout: 256 seconds]
t4nk975 has joined #ocaml
<Drup> MisaMisa: oh, I forgot something extremely important, It deserves to be in 0. : Haskell's module system is really really bad.
<MisaMisa> dmbaturin: http://dev.stephendiehl.com/hask/ search for ":{"
<MisaMisa> Drup: maybe I would be able to answer my own question after learning ocaml.
kotee has left #ocaml [#ocaml]
<Drup> sure
<Drup> I didn't know if I would like haskell before I used it a bit.
nojb has joined #ocaml
nojb has quit [Client Quit]
<pippijn> Build:
<pippijn> ghc --make file.hs
<pippijn> ocamlopt -o file file.ml
<pippijn> not quite
<pippijn> that's just for a single file
<MisaMisa> maybe I need to clarify this: I did not ask the question in this channel. my friend (who is an ocaml enthusiast) posted it here then I came to read your replies to him.
travisbrady has joined #ocaml
jao has joined #ocaml
<dmbaturin> I certainly don't regret learning about both.
<badkins> I do miss list comprehension syntax a bit from Haskell, but the "eager", modules, tooling, I/O, Unix compatibility, etc. are nice in OCaml IMO
jprakash has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
<thizanne> you can actually use syntax extensions if you want list comps in OCaml
<Drup> yeah, there is a list compression camlp4 extension
<badkins> cool - where do I go to get started?
<Drup> comprehension*
<Drup> badkins: camlp4 manual.
<Drup> (huhuhu)
<badkins> thx
tane has quit [Quit: Verlassend]
nicoo has quit [Remote host closed the connection]
Haudegen has joined #ocaml
nicoo has joined #ocaml
asakim has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
t4nk975 has quit [Ping timeout: 246 seconds]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
NSA360 has quit [Ping timeout: 255 seconds]
kakadu has quit [Remote host closed the connection]
dav has joined #ocaml
nojb has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
demonimin has quit [Ping timeout: 265 seconds]