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
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
n3ss3s has quit [Ping timeout: 272 seconds]
blandflakes has joined #ocaml
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nullcat_ has joined #ocaml
<ollehar1> sleep time, thanks for input
ollehar1 has quit [Quit: ollehar1]
ollehar has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
n3ss3s has joined #ocaml
<n3ss3s> Any pointers for serving a file (media) in cohttp?
AltGr has joined #ocaml
tinhead_ has quit [Remote host closed the connection]
tinhead has joined #ocaml
tinhead has quit [Remote host closed the connection]
<sh0t> guys sorry again i get a syntax error in this part of the code ...http://paste.ubuntu.com/11531537/ i don't know what's the problem
keen___________4 has joined #ocaml
<sh0t> i solved like this http://paste.ubuntu.com/11531572/ but i don't understand what was the problme
keen___________3 has quit [Ping timeout: 255 seconds]
tinhead has joined #ocaml
pyon has quit [Ping timeout: 250 seconds]
inf-gropeoid has joined #ocaml
<def`> sh0t: you can't have an expressing following a global binding (plus your indentation is scary)
<def`> use let () = … for top-level statements
<dmbaturin> sh0t: I guess get_prog was supposed to be a function.
<sh0t> yea it is dmbaturin
<dmbaturin> The traditional way to make a function "without arguments" is to make it unit -> something
<sh0t> ah ok
<dmbaturin> let get_prog () = ...
<dmbaturin> let something = get_prog () in ...
<def`> and use <> in comparison, not !=
<sh0t> why def` ?
<dmbaturin> <> is structural inequality (composed in the same way), != is physical inequality (isn't the same object in memory).
<dmbaturin> (Some 0) != (Some 0) ;;
<paarth> sh0t, why were you using let _?
<paarth> that is significantly better
tinhead has quit [Remote host closed the connection]
<sh0t> what is better?
<sh0t> ok thanks def` and thanks dmbaturin i understand the differene
<paarth> def`, what's the character you used earlier? I see …
<def`> ellipsis :)
<def`> It is …
<def`> ...*
badon has joined #ocaml
<paarth> ah. I should improve my IRC situation
<dmbaturin> paarth: I see your … correctly as a ligature for ... :)
<def`> sorry, I have unicode enabled term and keyboard layou
<def`> t*
<paarth> :P My lack of proper tooling is certainly not your problem. Thanks for the clarification!
<def`> :-)
<sh0t> I can't parse more than one token...mmm nice!
jwatzman|work has quit [Quit: jwatzman|work]
maurer has quit [Ping timeout: 256 seconds]
maurer has joined #ocaml
kdef has joined #ocaml
BitPuffin|osx has joined #ocaml
<dmbaturin> sh0t: That's arguably better than being unable to parse any tokens at all. ;)
<sh0t> ahha dmbaturin you are totally right
<sh0t> hey now it works:) a problem in the grammar
<sh0t> i deserve some food :)
shinnya has quit [Ping timeout: 252 seconds]
w0rp has quit [Ping timeout: 264 seconds]
badkins has quit []
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
darryn has joined #ocaml
blandflakes has joined #ocaml
blandflakes has quit [Client Quit]
blandflakes has joined #ocaml
jabesed has joined #ocaml
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
darryn has quit [Quit: leaving]
leafac has quit [Quit: Leaving.]
jabesed has quit [Ping timeout: 256 seconds]
jabesed has joined #ocaml
darryn has joined #ocaml
<darryn> what are need to have packages for emacs? I have merlin and ocp-indent...
<Algebr> pretty much it.
<Algebr> tuareg-mode
<darryn> Got it
<darryn> Now how do I have these things autoload on .ml files?
<darryn> I have the .emacs changed to have them installed, from opam
yminsky has joined #ocaml
<darryn> nvm, I solved it
<darryn> elisp magic
Algebr has quit [Ping timeout: 256 seconds]
<n3ss3s> gonna find food
<darryn> I am sorry you don't have easy access to food :(
kdef has quit [Quit: Leaving]
<dmbaturin> opam search food
<darryn> So, I got this chess game coded in ocaml, from some random site, but it doesn't compile :/
<dmbaturin> Well, there are many possible reasons.
tmtwd has joined #ocaml
Algebr has joined #ocaml
n3ss3s has quit [Ping timeout: 272 seconds]
rand000 has quit [Quit: leaving]
manizzle has quit [Ping timeout: 264 seconds]
<struktured> the fact that programs compile at all is in general a miracle
tmtwd has quit [Remote host closed the connection]
<darryn> Computers are magic
jeffmo has quit [Quit: jeffmo]
BitPuffin|osx has quit [Ping timeout: 258 seconds]
n3ss3s has joined #ocaml
<struktured> darryn: I fixed it. just remove "Rules." from Rules.allsquares in rules.ml
<struktured> Rules.all_squares, with underscore, just take out the Module name prefix
<darryn> give me a second
<darryn> cool, it works :)
nullcat_ has quit [Ping timeout: 265 seconds]
<struktured> noice. is the algorithm any good? i didn't bother to look. minimax derivatve?
<darryn> It is playing fairly well
<darryn> Do you play chess?
<struktured> darryn: I used to play alot, now, redhotpawn.com and ocassional bout with friends nearby at a coffee shop
<darryn> play on lichess?
<struktured> no, should I?
<darryn> Yes, it is a very nice website. Has a very nice android app too.
<darryn> No signin required, if that's your thing
darkf has joined #ocaml
<struktured> I could use a good app, sign in is fine if its only once ever, for all time. my reddit app is killing me lately. I have to sign in practically every time I use it
<struktured> darryn: what are your ocaml goals exactly, re: chess?
<darryn> For hobby/general programming.
<struktured> what side? gui? portability? ai? analysis?
<darryn> I am considering switching to haskell, just because the community is larger/gets more support.
<darryn> Gui and Portability
<struktured> so cell phone app then?
<struktured> darryn: well I am throwing my vote for ocaml. I like it. give it a shot a bit longer before switching
<darryn> I'd rather not work with smart devices
<darryn> Well, I don't see a down side to switching over, haskell seems to have the upper hand. But like others said, I will probably just end up learning both
<struktured> Despite your best efforts, you will know many programming languages
<darryn> That's okay.
c74d3 is now known as c74d
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<darryn> Does OCaml have good multi-platform support?
<struktured> I have such a silly utop issue I'm embarrased to report it, but it's driving me nuts. When I ssh to a redhat 6/7 box, utop renders some weird ascii characters and is essentially unusable. Probably a simple fix by changing the terminal settings in some way... anyone else ever run into this?
<struktured> darryn: eh....its a decent multi-unix platform..windows is spotty but can be accomplished if you care enough. mirage helps if you care that sort of thing, and mobile devices reportedly work with ocaml but I have no experience with it
<darryn> would haskell work better for multi-platform?
<struktured> dunno, can ask in their channel if you wish
<darryn> I will..
ygrek has quit [Ping timeout: 244 seconds]
blandflakes has joined #ocaml
blandflakes has quit [Client Quit]
idegen has quit [Quit: Leaving.]
darryn has left #ocaml [#ocaml]
Pip has joined #ocaml
swgillespie has joined #ocaml
<rgrinberg> ocaml in theory has good support for cross platform
<rgrinberg> in practice, no one ever tests anything on m$ wind0ze
<Pip> :D
<Pip> Which one is better, Ocaml or Haskell?
<rgrinberg> since this is #ocaml the answer is clear
<def`> javascript?
<Pip> Scala?
<rgrinberg> def`: did you know that a tiny unpopular language like ocaml has better auto complete than js who probably had 1000x the engineering man years :P
<rgrinberg> and as a bonus, the auto complete was made by a couple of college kids
<def`> rgrinberg: you can't be serious!
<Pip> lol
<Pip> Google was created by some college kids
<rgrinberg> Pip: search is much easier than js auto complete
<Pip> Oh
<Pip> Sounds like high end AI
nullcat_ has joined #ocaml
<def`> see, if js is harder to complete its because its more powerful
<rom1504> clearly :p
mcc has joined #ocaml
<Pip> I see
<rom1504> anyway, you're called Pip , so you should use python
<Pip> I did learn Python
<Pip> But I also want to try something new
<rom1504> you won't be able to do pip install in ocaml :p
<Pip> I don't use Python much
<Pip> Is Java a terrible language?
<def`> Yes ?
<Pip> Why?
<Pip> I never liked Java, I don't know why
<def`> From a type system pov: omnivariant arrays
sh0t has quit [Remote host closed the connection]
<def`> From a software engineering pov: having to manually write names such as AbstractTemplateFactory just highlight how much the language is poor at abstracting
<def`> how poor the language is at abstracting*
<mcc> There is definitely a lot of repetitive typing in Java :( And the platform is kind of heaviweight.
<Pip> True
manizzle has joined #ocaml
<dmbaturin> There's a book "how to get around C++/Java limitations", also known as "design patterns".
<Algebr> lol
<Pip> dmbaturin, Are you serious?
<Pip> I know the book "Design Patterns"
<Pip> It's all about patterns in OOP
troydm has quit [Ping timeout: 264 seconds]
<dmbaturin> Yep. How many of them are still applicable in more expressive languages? :)
<def`> (-: time to sleep, good night!
psy_ has quit [Ping timeout: 256 seconds]
<Pip> Good night
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<mcc> i do not disagree with dmbaturin's comment necesarily
Algebr has quit [Ping timeout: 272 seconds]
samg_ has joined #ocaml
ygrek has joined #ocaml
MrScout has quit [Ping timeout: 265 seconds]
jabesed has quit [Ping timeout: 256 seconds]
<paarth> Honestly I consider any language that allows naive object downcasting to be unsafe
<dmbaturin> mcc: It was not meant as _entirely_ serious of course, but among that book fans there's a trend to consider those patterns fundamental.
siddharthv_away is now known as siddharthv
n3ss3s has quit [Ping timeout: 255 seconds]
<dmbaturin> Pip: http://norvig.com/design-patterns/design-patterns.pdf This is a bit old (especially in terms of language choice), but still interesting.
<dmbaturin> I'm still to meet anyone who still uses smalltalk.
SomeDamnBody has joined #ocaml
<SomeDamnBody> I'm trying to use oasis to build an ocaml project
<SomeDamnBody> it consists of a small set of files, but several libraries
<SomeDamnBody> oasis doesn't seem to be generating the project correctly
<SomeDamnBody> because when I do oasis setup ;
<SomeDamnBody> ocaml setup.ml -configure
<SomeDamnBody> it blows up with: E: cannot find findlib package
<dmbaturin> Is findlib installed?
<SomeDamnBody> what package name? I was just looking with apt-cache
<SomeDamnBody> I just tried to install libfindlib-ocaml
<SomeDamnBody> and that didn't seem to get oasis to pick it up...
<SomeDamnBody> ocamlfind certainly is. I would much rather use opam than the apt package name
<dmbaturin> ocaml-findlib, apparently.
<SomeDamnBody> ... err... are you sure it can't be installed with opam?
<dmbaturin> Did you install oasis from opam and findlib from the repos?
<SomeDamnBody> I really think that installing things with apt where you have duplicates from opam causes difficult to debug version conflicts
<SomeDamnBody> ... hold on
<SomeDamnBody> oasis is installed through oapm
<SomeDamnBody> opam
<SomeDamnBody> ocamlfind is installed
<dmbaturin> Yes, installing from different sources can cause problems like this. Happened to me a couple of times.
<SomeDamnBody> right, but I have oasis installed from opam
<SomeDamnBody> it's just that oasis isn't picking things up right...
<SomeDamnBody> do I have to run the -configure between setup.ml generation and building?
<dmbaturin> You only need to do it if you changes anything in the setup, or want to configure with different options.
<dmbaturin> * changed
<SomeDamnBody> oh...
<SomeDamnBody> because I *can* do oasis setup ; ocaml setup.ml -build
<dmbaturin> I usually just the ./configure script produced by oasis.
<dmbaturin> * use
<SomeDamnBody> it's not producing a configure script for me.
<SomeDamnBody> also, I *used* to be able to configure, build as of ten minutes ago... since I ignorantly deleted my setup.data file
<SomeDamnBody> touch setup.data ; ocaml setup.ml -build
<SomeDamnBody> worked!
Pip has quit [Ping timeout: 256 seconds]
<dmbaturin> SomeDamnBody: Does a trivial script that uses findlib, such as #use "topfind";; let () = print_endline "worked" work?
<SomeDamnBody> I fired up utop and that worked
<SomeDamnBody> apparrently, I was just new to oasis and ocamlbuild
<SomeDamnBody> I am impressed and finding it surprisingly easy and high quality :)
<paarth> let's say I've got a number of items that are going to follow the same pipeline. I could do something like " [a';b';c'] = [a;b;c] |> List.map pipeline_func "but that results in warnings about pattern incompleteness. Is there a better way of handling this case?
<dmbaturin> paarth: I think the non-exhaustive warning is safe to ignore in this case (since there's no chance map will make a [] out of [a;b;c]).
<paarth> dmbaturin, I agree, but my vain desire for clean build output forced me to ask
<paarth> thanks
<dmbaturin> What's the context?
<dmbaturin> The list is always three items long?
<paarth> dmbaturin, yes
<dmbaturin> I'd probably make it a tuple (or record), although I'd have to define a "map" for it and it would be a bit repetitive.
agarwal1975 has quit [Quit: Connection closed for inactivity]
<dmbaturin> Or make it work with lists of any length, if the number of items is inherent to the implementation rather than the problem.
<paarth> yeah. This is me being a bit lazy and not wanting to retype the pipeline bit
<paarth> you know if I was being truly committed to being lazy this might be a good moment to play with ppx
MrScout has joined #ocaml
dtscode is now known as notdtscode
SomeDamnBody has quit [Ping timeout: 252 seconds]
notdtscode is now known as charmander
MrScout has quit [Remote host closed the connection]
wraithm has quit [Ping timeout: 272 seconds]
sepp2k has joined #ocaml
psy_ has joined #ocaml
jonludlam has quit [Ping timeout: 240 seconds]
Pip has joined #ocaml
Pibian has joined #ocaml
manizzle has quit [Remote host closed the connection]
Pip has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Ping timeout: 250 seconds]
amnn has joined #ocaml
rgrinberg has joined #ocaml
manizzle has joined #ocaml
Bhavya has joined #ocaml
Pibian has quit [Changing host]
Pibian has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Bhavya has quit [Quit: Quit the channel]
SomeDamnBody has joined #ocaml
tinhead has joined #ocaml
obadz has quit [Ping timeout: 255 seconds]
obadz has joined #ocaml
SomeDamnBody has quit [Ping timeout: 272 seconds]
natrium1970 has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
Simn has joined #ocaml
tinhead has quit []
Pibian has quit [Ping timeout: 256 seconds]
Pibian has joined #ocaml
charmander is now known as notdtscode
natrium1970 has quit [Quit: natrium1970]
jonludlam has joined #ocaml
Haudegen has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
TheLemonMan has joined #ocaml
mcc has quit [Quit: This computer has gone to sleep]
noze has quit [Ping timeout: 272 seconds]
maufred has quit [Ping timeout: 264 seconds]
maufred has joined #ocaml
rgrinberg has quit [Ping timeout: 245 seconds]
A1977494 has joined #ocaml
jcloud has quit [Quit: Connection closed for inactivity]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xificurC has joined #ocaml
A1977494 has left #ocaml [#ocaml]
<flux> hmm, this could be a nice alternative to Toml, if you don't really need toml: https://zoggy.github.io/ocf/doc.html
stomp has quit [Quit: leaving]
matason has joined #ocaml
samg_ has left #ocaml [#ocaml]
cschneid has quit [Ping timeout: 265 seconds]
jyc has quit [Ping timeout: 256 seconds]
mort___ has joined #ocaml
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jyc has joined #ocaml
cschneid has joined #ocaml
Submarine has joined #ocaml
tmtwd has joined #ocaml
Pibian has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 272 seconds]
cml has joined #ocaml
matason has quit []
matason has joined #ocaml
mort___ has left #ocaml [#ocaml]
zpe has joined #ocaml
freling has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
yomimono has joined #ocaml
A1977494 has joined #ocaml
A1977494 has left #ocaml [#ocaml]
stomp has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
dsheets has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
milosn has quit [Quit: leaving]
rgrinberg has quit [Ping timeout: 256 seconds]
jonludlam has joined #ocaml
Kakadu has joined #ocaml
zpe has joined #ocaml
kushal has joined #ocaml
hay207 has joined #ocaml
kushal has quit [Max SendQ exceeded]
kushal has joined #ocaml
dsheets has joined #ocaml
leafac has joined #ocaml
yomimono has quit [Ping timeout: 255 seconds]
yomimono has joined #ocaml
<vbmithr_> This simple coercion was not fully general. Consider using a double coercion.
<vbmithr_> What's a double coercion ?
<flux> (foo : a :> b) - you first tell its type and then coerce it
<def`> (a : t1 :> t2)
<flux> though I suppose maybe ocaml documentation itself as well
<vbmithr_> Oh ok.
<vbmithr_> I'm a bit lost with all this
Haudegen has quit [Ping timeout: 272 seconds]
<vbmithr_> ok.
<vbmithr_> I'm gonna try.
octachron has joined #ocaml
rand000 has joined #ocaml
afiskon has joined #ocaml
rgrinberg has joined #ocaml
zmyrgel has left #ocaml ["WeeChat 1.1"]
rgrinberg has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
freling has quit [Quit: Leaving.]
amnn has joined #ocaml
rand000 has quit [Quit: leaving]
<ollehar> someone should mix 1ML with a typed effect-system like koka. that would be really cool.
jonludlam has quit [Ping timeout: 245 seconds]
ingsoc has joined #ocaml
jabesed has joined #ocaml
<ollehar> wait, this is awesome. they include an explanation from #haskell IRC in the forum: https://wiki.haskell.org/Monad/ST
<ollehar> Shouldn't we do that, too? Some great explanations are thrown around here.
<dmbaturin> ollehar: The question is, where to store them (in the absense of wiki).
<ollehar> we have no wiki?
<ollehar> :(
<ollehar> let's just store them in the haskell wiki, then ;)
<dmbaturin> ocaml.org maintainers are usually responsive, but the development process with pull requests approved by maintainers is not well suited for quick edits.
sdothum has joined #ocaml
<ollehar> gah, no, pulling is not good for that
<dmbaturin> I don't think ocaml.org should be open to unapproved edits of course, but a wiki complementary to it could be a good thing too.
<ollehar> wiki.ocaml.org?
<ollehar> \o/
<flux> how big a deal is it? it appears github just gives an 'edit' button which does the forking&editing for you. you still need to pr it?
<flux> you of course need to have a github account.
<ollehar> too technical, imo
<flux> I suppose at least the link to the edit button of the particular page could be on each page
<dmbaturin> flux: Sure. I didn't try the edit button (I just clone it the usual way and edit locally), but the patch still has to go through the maintainers anyway.
<ollehar> a wiki would have a better "feeling"
<flux> dmbaturin, I'm quite sure it wouldn't be a bottle neck..
<ollehar> and welcome contributions more
<flux> wikis tend to end up disorganized
jonludlam has joined #ocaml
<ollehar> just need to disciplne the access rights in the wiki
<ollehar> points and stuff like in stackoverflow
<flux> there is already stackoverflow :)
<flux> asking for access rights is even a bigger boundary of contribution IMO
<dmbaturin> flux: From my experience, merging a non-controversial patch into ocaml.org still a week or more. Maybe adding more maintainers could speed it up, but there's no way it can be instant.
jabesed has quit [Ping timeout: 265 seconds]
<flux> well, it can be instant if you have direct editing abilities in the pages, comparable to a standard wiki account?
seanmcl has joined #ocaml
<flux> I think the maintainers wouldn't like to deal (at all) with vandalism.
<ollehar> stackoverflow is NOT a wiki, the mods there are too strict.
<flux> in any case, how do you add 'points and stuff like in stackoverflow' to a site? is there a pre-existing solution for that?
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<dmbaturin> flux: Well, that's why I say a wiki should be separate, complementary to ocaml.org
<ollehar> uhm, don't know. just pulled that out of my ass. how is it done on wikipedia?
Algebr has joined #ocaml
<flux> wikipedia doesn't have points, does it?
<ollehar> probably not, but they must have some system...
<dmbaturin> A type inference captcha could be used to prevent spam and vandalism by incompetent people. ;)
<flux> I don't know Wikipedia has its software available publically
<dmbaturin> flux: http://mediawiki.org
<flux> right, had forgotten its name
<flux> ok, but then you need to use PHP :P
<dmbaturin> MW is the only software written in PHP I like enough to even modify it.
<ollehar> or hacklang, but yeah...
sdothum has joined #ocaml
sdothum has quit [Client Quit]
tmtwd has quit [Ping timeout: 265 seconds]
sdothum has joined #ocaml
<flux> btw, there used to be an ocaml wiki ocaml-tutorial.org but it fell out of maintenance/interest? you can still find it here: http://mirror.ocamlcore.org/ocaml-tutorial.org/
<dmbaturin> flux: I think a substantial part of it was imported into ocaml.org
<flux> great
rgrinberg has joined #ocaml
<ollehar> hm
inf-gropeoid has quit [Quit: I have irrefutable proof that D < 0. It follows trivially from 2D > 3D, which is obviously true.]
leafac has quit [Quit: Leaving.]
rgrinberg has quit [Ping timeout: 264 seconds]
<dmbaturin> This is the first time I see the original ocaml-tutorial.org, I only knew of it from ocaml.org. :)
<dmbaturin> Looks like the tutorials section is indeed based on it.
<flux> I'm wondering if in fact there is a more consistent flow of contributions to ocaml.org than there was for ocaml-tutorial.org..
<companion_cube> https://github.com/ocaml/ocaml.org/blob/master/site/learn/tutorials/basics.md <-- for instance, there is an "edit" button here
<companion_cube> so I suppose proposing a patch is really easy
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
sdothum has joined #ocaml
leafac has joined #ocaml
sdothum has quit [Client Quit]
leafac has quit [Client Quit]
sdothum has joined #ocaml
ggole has joined #ocaml
jabesed has joined #ocaml
Hannibal_Smith has joined #ocaml
Sim_n has joined #ocaml
leafac has joined #ocaml
<ollehar> yeah, but patching things like that seems weird for including more informal material like IRC chats.
<ollehar> or discussions.
Simn has quit [Ping timeout: 252 seconds]
<flux> well, I don't mind that the material is better thought-out than IRC chat logs.
<flux> in fact, there is some reviewing going on some pull requests
siddharthv is now known as siddharthv_away
Algebr has quit [Ping timeout: 255 seconds]
yomimono has quit [Ping timeout: 265 seconds]
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
kushal has quit [Ping timeout: 255 seconds]
Grayswandyr has joined #ocaml
<ollehar> I for one would like something between IRC/reddit and the "official" site.
<ollehar> but but
<Drup> like a mailing list ?
<Drup> :]
<ollehar> mm, mailing lists are also kind of temporary...
<ollehar> asch
<Drup> not really
<ollehar> well, you can't edit a mail after it's send.
<ollehar> uhm
<ollehar> so... it's too permanent?
<adrien_znc> :D
<companion_cube> let's start a google wave thread!!
Sim_n is now known as Simn
rgrinberg has joined #ocaml
<dmbaturin> companion_cube: Google Wave thread can only be about CAML Light. The living can't enter the realm of the dead.
rgrinberg has quit [Ping timeout: 258 seconds]
sh0t has joined #ocaml
Grayswandyr has quit [Quit: Page closed]
freling has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
<ollehar> I'll just make my own wiki, with beer and hookers
leafac has quit [Quit: Leaving.]
<octachron> dmbaturin: Should I mention that CAML Light is still taught in France?
<ollehar> no
<adrien_znc> yes
<adrien_znc> ='(
jabesed has quit [Ping timeout: 265 seconds]
<Drup> unfortunately :(
<thizanne> when creationism is still taught in US, that doesn't feel like so outdated
<adrien_znc> :D
<companion_cube> it's taught to students in math curricula, who never programmed ever before
<companion_cube> the differences between caml light and OCaml are not much relevant in this case
<companion_cube> (better: caml light accepts latin-1 identifiers)
<adrien_znc> it's fine but the issue is that they think it's the same as ocaml and that ocaml therefore has a non-existant ecosystem
<Drup> companion_cube: except the tooling for ocaml doesn't work for camllight
<Drup> (and what adrien_znc said)
<companion_cube> what tooling?
<companion_cube> seriously, those students are happy with camlWin (or winCaml, can't remember)
<companion_cube> they won't use libraries anyway, nor modules
<Drup> no, they are not happy with it
<Drup> they just don't have the choice
<adrien_znc> yes but then they think you need to use Graphics
<companion_cube> well, what's better than graphics for them? don't tell me jsoo
<adrien_znc> haha
<adrien_znc> nah but they think there's nothing else
<adrien_znc> so they finish their studies while believing ocaml can't be used for anything
<companion_cube> maybe there should be more emphasis on caml <> OCaml
<Drup> or maybe they should just use ocaml and remove camllight because it's a completely useless distinction ?
<Drup> it's just an artefact from 15 years ago
<companion_cube> and then poor students can't write functions in french :)
<Drup> companion_cube: they can, if their file is in latin1
idegen has joined #ocaml
<thizanne> last time I tried, the windows ocaml toplevel could randomly (?) fail
<companion_cube> Drup: ... really?
<thizanne> we didn't have these problems with caml light, and they are relevant when everybody programs by copy-pasting some file content in the toplevel
<companion_cube> let yoplaît = Mangé would work?
<Drup> thizanne: winCaml is not the most stable thing ever either
<flux> Warning 3: deprecated: ISO-Latin1 characters in identifiers
<companion_cube> you didn't try camlWin, it's much better
<companion_cube> or win caml
<companion_cube> fuck it, can't remember the good one
<Drup> companion_cube: it produces a warning, but you can
<companion_cube> yaay
<companion_cube> then, if there was a decent IDE for OCaml on windows, it could be worth the change
<adrien_znc> IDE?
<adrien_znc> ='(
<companion_cube> something you can write code in, and eval the code easily
<companion_cube> please don't say 'emacs'
<Drup> ocamltop ?
<companion_cube> I don't know, does it really work?
<companion_cube> is it installable on windows? :p
<companion_cube> I mean, it's probably using ocp-build
<Drup> well, ocp-build works on windows
<companion_cube> opam init default 4.01.0+ocp-bin ← oh god
<flux> I guess caml light doesn't support utf8 identifiers either
<adrien_znc> companion_cube: I tried emacs when I started with ocaml
<adrien_znc> I stopped because it made my pinky hurt
Gama11 has joined #ocaml
jabesed has joined #ocaml
kushal has joined #ocaml
<flux> adrien_znc, do you even lift?! with your pinky finger?
seanmcl has joined #ocaml
<companion_cube> all this is quite recent, Drup
<companion_cube> did you try ocamleditor? it looks nice, but it might not work for what I know
<Drup> ocamleditor ?
<Drup> no it's not
<Drup> it's not recent at all
<adrien_znc> flux: Ctrl and Fn keys were inverted (laptop)
<q66> ctrl - fn is the right order :)
tmtwd has joined #ocaml
<adrien_znc> try C-w on a azerty keyboard with inverted fn and ctrl keys
<q66> if it's a thinkpad (which gets the default order wrong) you can swap it in bios
<q66> and you can also stop using azerty :)
<thizanne> if you use emacs, you should bind control on caps-lock anyway
<thizanne> (and I guess vim users do the same with esc)
<q66> i have even better way
<q66> stop using emacs
<q66> :)
<Drup> That was a very interesting set of recommendation, thank guys. :3
<adrien_znc> q66: wasn't, but that was also 10 years ago
<adrien_znc> but that made me try vim
<adrien_znc> and I liked it
rgrinberg has joined #ocaml
Cyanure has joined #ocaml
hay207 has quit [Remote host closed the connection]
<companion_cube> thizanne: in vim, ctrl-c is a perfectly good escape
AltGr has left #ocaml [#ocaml]
Gama11_ has joined #ocaml
Gama11 has quit [Ping timeout: 265 seconds]
<sh0t> HI guys I installed oasis (on ubuntu) with opam but now if i type oasis setup -setup-update dynamic it says it's not installed...
<sh0t> nvm i solved
<sh0t> :)
milosn has joined #ocaml
rgrinberg has quit [Ping timeout: 272 seconds]
wraithm has joined #ocaml
Gama11 has joined #ocaml
Gama11_ has quit [Ping timeout: 276 seconds]
A1977494 has joined #ocaml
rgrinberg has joined #ocaml
A1977494 has left #ocaml [#ocaml]
<sh0t> guys can someone help me with oasis?
<companion_cube> well, ask
mhi^ has left #ocaml [#ocaml]
<sh0t> sure so I have this project which at the moment I compile "by hand". The project is divided in a few files and the main is in the file, say, Main.ml. How do I specify in the file _oasis the dependencies ?
<sh0t> the other files are not declared as modules...
<companion_cube> oasis uses ocamlbuild, which is able to find (simple) dependencies by itself
<companion_cube> if a.ml uses module B, ocamlbuild searches for b.ml in the same directory
<companion_cube> for a simple project, you can have Executable foo Path: src/ MainIs: main.ml
<sh0t> so I don't need to specify dependencies?
<companion_cube> in simple cases, no
<flux> and I think most programs are simple cases
<sh0t> yeah flux at least in my case
<sh0t> companion_cube, but the other files need to be declared as "modules"? SOrry I am not really familiar yet with module system of ocaml
<flux> if you refer to module B, ocaml compiler knows to look for b.ml
<companion_cube> Modules: A, B, C ... is used for libraries
<companion_cube> because a library just contains modules that do not necessarily depend on one another
<flux> and so does the ocamlbuild autodepedency system
<companion_cube> whereas an executable has a main module, and its dependencies
<sh0t> ok sorry I thkn you are underestimating my ignorance..:) I rephrase: I am not using the keyword "module". I just have a file and in it i "open" some other files.
<flux> it's ok :)
<flux> if you don't have "pack modules" then you don't need indicate dependencies
<flux> and if you don't know what "pack modules" are, then you are not using them :)
<flux> you can just stick a bundle of .ml-files in a directory and ocamlbuild foo.byte fill find out the module foo.ml and its dependencies automatically
<flux> looks ok?
<flux> but if you're making a library for others to use, you might want to indeed look into pack modules :)
<flux> I'm not familiar how to use them with oasis though.
<flux> at least if your public interface of the library is more than one module large
<sh0t> no library
<sh0t> i want an executable
<flux> I don't think you need BuildDepends there then, or if you do it should read something else than 'lib'
<flux> so you have tried compiling and it doesn't work?
<sh0t> I ran oasis setup
<jonludlam> here's the simplest one I could find (which works)
<sh0t> and iget myocamlbuild.ml setup.ml _tags
<flux> sh0t, and ocamlbuild -use-ocamlfind interp.byte ?
<flux> or I guess via that setup.ml somehow
<flux> ocaml ./setup.ml -build
<jonludlam> sh0t, if you add the 'DevFiles' plugin, I think it'll make you a makefile
<sh0t> so I am now using jonludlam's file...a bit modified...
<sh0t> if i run oasis setup i get a configure file...
<sh0t> a setup
<sh0t> and a myocamlbuild...and _tags
<jonludlam> if it didn't build you a makefile, the one in rrddump is probably generic enough to take
<jonludlam> just get rid of the unstall/uninstall targets
rgrinberg has quit [Ping timeout: 272 seconds]
<sh0t> can you please explain to me the line BuildDepends: ?
xificurC has quit [Ping timeout: 240 seconds]
<sh0t> I get a Makefile now
<flux> it is the list of ocamlfind packages it requires to build
<sh0t> right so it's not what I thought :D
<sh0t> i am almost there
<flux> seems like something I should read some day: https://ocaml.org/learn/tutorials/setting_up_with_oasis.html
<sh0t> quote :)
<sh0t> i am reading it
Hannibal_Smith has joined #ocaml
yomimono has joined #ocaml
struktured has quit [Ping timeout: 256 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
<sh0t> so if i run oasis setup i get the configure and the Makefile...so then i run configure...seems to work...if i run make...i get this http://paste.ubuntu.com/11544583/
<sh0t> ok i just moved away those files...
<sh0t> but how do i make this automatic?
kdef has joined #ocaml
<sh0t> i mean i dont' wanna run by hand ocamllex and ocamlbuild
Sim_n has joined #ocaml
tane has joined #ocaml
<flux> oasis setup.ml -build seems to do it
<flux> and ocamllex is automatically dealt with ocamlbuild
<flux> if you have .mll-files
<sh0t> mm ok
<sh0t> lemme try
Simn has quit [Ping timeout: 276 seconds]
<sh0t> Files parser.mly and parser.ml should not be together in src
<sh0t> Files parser.mly and parser.mli should not be together in src
<sh0t> flux, yo meant ocaml setup.ml -build right?
<flux> yes
<flux> well, it's right
<octachron> sh0t: were the parser.ml{i} generated from parser.mly?
<flux> you shouldn't have both parser.ml and parser.mly
rgrinberg has joined #ocaml
<flux> I guess it requires to not have the .mli either
<sh0t> yes octachron
<sh0t> well i only want to have the mly...and generate the ml from it
yomimono has quit [Ping timeout: 246 seconds]
freling has quit [Quit: Leaving.]
leafac has joined #ocaml
<flux> remove the .ml and .mli files then
<Denommus> sh0t: it will be generated, don't worry
<octachron> shOt: you don't need to have these files in your source directory, ocamlbuild will automatically generate them and place them in the _build directory
<Denommus> sh0t: it just won't be the same place your mly file is
<sh0t> ok but now i get something weird:
<Denommus> is there a MVar library for OCaml?
Sim_n is now known as Simn
<sh0t> + /home/sh0t/.opam/system/bin/ocamlfind ocamlc -c -g -annot -bin-annot -o parser.cmi parser.mli
<sh0t> File "parser.mli", line 43, characters 48-56:
<sh0t> Error: Unbound module Ast
<sh0t> this if i run ocaml setup.ml -build after the configure
<flux> where is the Ast module defiend?
leafac has quit [Read error: Connection reset by peer]
<Denommus> sh0t: before anything, are you producing a library or a binary?
<flux> binary
<sh0t> binary Denommus
<Denommus> sh0t: do you have an ast.ml and ast.mli on the same directory as parser.mly?
<sh0t> nope
<sh0t> i have lexer.mll lexer.mll _oasis parser.mly src
<sh0t> in one dir
<sh0t> and in src i have all the rest
<sh0t> only ml files in src
<flux> so where does Ast come from?
<Denommus> sh0t: how have you told oasis to handle the src directory, if at all?
<flux> it wouldn't fail otherwise this way?
leafac has joined #ocaml
badkins has joined #ocaml
<sh0t> ok in lexer.mll in the section header i open Ast but it doesn't happen anymore and now i get a different errro
<sh0t> so the problem is that in parser.mly i have this line
<sh0t> %type <Ast.stmt> main
<sh0t> and ast is in src
blandflakes has joined #ocaml
<flux> you have ast.ml in src?
<flux> hmm, right, now I understand it
<flux> you should have all the .mll and .mly files in the src directory as well
<sh0t> ok but then flux it complains "i shouldnt have" those files in the same dir
<flux> I don't know how ocamlbuild would handle dependencies crossing directories
<flux> sh0t, have you written parser.mli yourself or generated it?
<sh0t> the mli
<sh0t> never created it
<sh0t> so generated
<flux> sh0t, let's say it this way: after ocaml setup.ml -clean you should have files lexer.ml, lexer.mli, parser.ml or parser.mli _nowhere_
<flux> if that is the case, then ocaml setup.ml -build should not complain about having both parser.ml and parser.mly in the same directory, because parser.ml doesn't exist
<flux> and when it does generate parser.ml, it won't go to the same directory
afiskon has quit [Quit: Leaving]
<flux> if after the cleaning you have the forementioned files somewhere, remove them
<sh0t> YEAH
<sh0t> it works finally
<sh0t> thanks guys
Submarine has quit [Remote host closed the connection]
<flux> good time to use git commit ;)
rgrinberg has quit [Quit: WeeChat 1.2]
slash^ has joined #ocaml
badkins has quit [Remote host closed the connection]
<sh0t> ahah yeah
<sh0t> how do i clean everything?
<sh0t> ocaml setup.ml -clean leaves something
<sh0t> and also oasis setp-clean
gabemc has joined #ocaml
yomimono has joined #ocaml
zpe has quit [Remote host closed the connection]
yomimono has quit [Ping timeout: 252 seconds]
Kakadu has quit [Ping timeout: 246 seconds]
Intensity has joined #ocaml
shinnya has joined #ocaml
yomimono has joined #ocaml
octachron has quit [Quit: Leaving]
yomimono has quit [Ping timeout: 244 seconds]
<sh0t> so guys a more general question. I am trying to develop an interpreter for a toy language where you only have references to actual data, and where every value is actually stored in arrays of varaible length. How would you go and implement this in ocaml..I 've been reading stuff about "ref" and "array" in ocaml. I guess in this case a lot of the work owuld be handled by ocaml language
<sh0t> am I right?
leafac has quit [Quit: Leaving.]
MrScout has joined #ocaml
leafac has joined #ocaml
Sim_n has joined #ocaml
<Drup> sh0t: -distclean
<sh0t> i still have the configure and the makefile
Simn has quit [Ping timeout: 252 seconds]
tane has quit [Quit: Verlassend]
matason has quit []
matason has joined #ocaml
matason has quit [Client Quit]
MrScout has quit [Remote host closed the connection]
MrScout has joined #ocaml
<Drup> well yeah, you want to remove that ?
Submarine has joined #ocaml
Submarine has joined #ocaml
nullcat has joined #ocaml
<flux> sh0t, you probably add the files you want to keep to your git repository and then git clean -d -x --force ;)
<sh0t> yeah Drup because say i add more files to my project i need to update my makefile right?
ggole has quit []
<sh0t> ahh right but for simple projects ocaml finds dependencies by itself
<Drup> sh0t: you don't need to remove them, just do oasis setup again
<sh0t> ok
<flux> but are they something you want to add to version control?
matason has joined #ocaml
ygrek has joined #ocaml
matason has quit []
matason has joined #ocaml
yomimono has joined #ocaml
jonludlam has quit [Ping timeout: 265 seconds]
gabemc has quit [Ping timeout: 256 seconds]
jwatzman|work has joined #ocaml
<sh0t> yes flux
<sh0t> in general yes
<sh0t> sometimes i just mess around and it's not worth to commit/push htough...
<sh0t> from my point of view...
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Drup> sh0t: if you use setup-dynamic, you don't have to redo the setup.
<Drup> and it's so thin than you can push it
<Drup> (it should not be used for release, though)
Haudegen has quit [Ping timeout: 246 seconds]
<sh0t> mm ok:)
darkf has quit [Quit: Leaving]
Gama11_ has joined #ocaml
badkins has joined #ocaml
simn__ has joined #ocaml
Gama11 has quit [Ping timeout: 258 seconds]
Sim_n has quit [Ping timeout: 252 seconds]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
cml has quit [Ping timeout: 246 seconds]
sdothum has joined #ocaml
matason has quit []
sdothum has quit [Client Quit]
Anarchos1 has joined #ocaml
sdothum has joined #ocaml
<sh0t> so guys a more general question. I am trying to develop an interpreter for a toy language where you only have references to actual data, and where every value is actually stored in arrays of varaible length. How would you go and implement this in ocaml..I 've been reading stuff about "ref" and "array" in ocaml. I guess in this case a lot of the work owuld be handled by ocaml language am I right?
swgillespie has joined #ocaml
<Drup> I'm not really sure what the question is, tbh.
<nicoo> It should, yes. You don't have to implement toy-language's arrays using OCaml arrays, though
<sh0t> why ?
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
waneck has joined #ocaml
seanmcl has joined #ocaml
Haudegen has joined #ocaml
<vbmithr_> Is there a way to figure out what happens before an out of memory error ?
ygrek has quit [Ping timeout: 250 seconds]
<vbmithr_> I mean, I'd like to see the allocations
<Drup> (sorry, it's not an answer, but I couldn't resist :D)
sdothum has joined #ocaml
Anarchos1 has quit [Ping timeout: 240 seconds]
<vbmithr_> thanks
sdothum has quit [Client Quit]
Algebr has joined #ocaml
sdothum has joined #ocaml
sdothum has quit [Client Quit]
ncthom91 has joined #ocaml
Anarchos1 has joined #ocaml
ncthom91 has quit [Client Quit]
Anarchos1 has quit [Client Quit]
Anarchos1 has joined #ocaml
sdothum has joined #ocaml
sepp2k has quit [Quit: Leaving.]
sdothum has quit [Client Quit]
manizzle has quit [Ping timeout: 272 seconds]
ncthom91 has joined #ocaml
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sdothum has joined #ocaml
sdothum has quit [Client Quit]
seanmcl has joined #ocaml
sdothum has joined #ocaml
ygrek has joined #ocaml
octachron has joined #ocaml
sh0t has quit [Ping timeout: 256 seconds]
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
luzie has quit [Remote host closed the connection]
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
luzie has joined #ocaml
seanmcl_ has joined #ocaml
seanmcl has quit [Ping timeout: 245 seconds]
simn__ is now known as _hx_simn
waneck is now known as __hx_waneck
tane has joined #ocaml
yomimono has quit [Ping timeout: 244 seconds]
<Algebr> has anyone been able to successfully get lablgtkosx to work
nullcat_ has joined #ocaml
xificurC has joined #ocaml
struk|work has joined #ocaml
ollehar1 has joined #ocaml
inf-gropeoid has joined #ocaml
blandflakes has joined #ocaml
inf-gropeoid is now known as pyon
TheLemonMan has joined #ocaml
sh0t has joined #ocaml
dsheets has quit [Ping timeout: 258 seconds]
nullcat_ has quit [Read error: Connection reset by peer]
nullcat_ has joined #ocaml
mort___ has joined #ocaml
Tamae has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
afiskon has joined #ocaml
<Denommus> I almost got something like mfix in OCaml using Lwt!
jabesed has quit [Ping timeout: 265 seconds]
jabesed has joined #ocaml
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
nopf has quit [Remote host closed the connection]
jabesed has quit [Ping timeout: 256 seconds]
jwatzman|work has quit [Read error: Connection reset by peer]
nullcat has joined #ocaml
<orbitz> smondet or Drup, if you're around here is the source code. Still unsure how to solve it well: https://gist.github.com/orbitz/8733faa6420f97c970af
The_Mad_Pirate has quit [Excess Flood]
The_Mad_Pirate has joined #ocaml
Kakadu has joined #ocaml
jwatzman|work has joined #ocaml
TheLemon1an has joined #ocaml
TheLemonMan has quit [Disconnected by services]
TheLemon1an is now known as TheLemonMan
wwilly has joined #ocaml
jabesed has joined #ocaml
yomimono has joined #ocaml
<smondet> orbitz: in `revops_fn.mli` the type 'a OpRev.t is abstract so there is no way to make it match anything
mengu has quit [Remote host closed the connection]
Hannibal_Smith has quit [Quit: Leaving]
mengu has joined #ocaml
mengu has quit [Remote host closed the connection]
<Denommus> in Lwt, is there a function equivalent to (>>=), but that ignores the argument to the second function? (Like Haskell's (>>))
xificurC has quit [Ping timeout: 272 seconds]
leafac has quit [Quit: Leaving.]
badkins has quit []
__hx_waneck has quit [Read error: Connection reset by peer]
<flux> even if there was (ie. you can just write let (>>) a b = a >>= fun _ -> b), it could be annoying because of side effects
leafac has joined #ocaml
waneck has joined #ocaml
<flux> I think though that Jane Street Core comes with that kind of syntax extension, that does >>= but for unit functions, by means of syntax transformation
_hx_simn is now known as Simn
<Denommus> flux: won't the side effects be "wrapped" inside Lwt.t anyway?
<flux> no. consider return (i := 42) >> return (i := 45). it's not very different from foo (i := 42) + bar (i := 55)
<flux> except for the numbers :)
<flux> you need to have a function to postbone the evaluation of the right side
willy_ has joined #ocaml
<flux> though my example is a bit malformed, oh well..
<flux> actually it's probably ok if I used the syntax extension?
wwilly has quit [Ping timeout: 264 seconds]
<Denommus> ok, then
Hannibal_Smith has joined #ocaml
matason has joined #ocaml
nopf has joined #ocaml
<Algebr> Async had >>> I thought
kushal has quit [Ping timeout: 276 seconds]
_andre has quit [Quit: leaving]
<flux> oh, maybe, I haven't used it
ncthom91 has joined #ocaml
willy_ has left #ocaml ["Leaving"]
<sh0t> guys I am trying to define a new type to describe arrays of int references...i am trying with something like this: type numericRefArray={size: int; capacity:int; v: (ref 0) array};; of course it doesnt work. I tried to set int instead of 0 there which i think shouold be the right thing to do but it doesnt work either
ncthom91 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zozozo> sh0t: why would you want references in an array ?
<zozozo> cells in arrays are already mutables
<sh0t> mmm...so i am trying to implement this toy language where everything is an array of references...like int are just array of size of which point to an integer...
<sh0t> *of sieze 1
<sh0t> *size
<zozozo> ok, but in the internal representation, you don't have to put references, since arrays are already mutable in ocaml
<zozozo> also, do you nedd growable arrays, or arrays with fixed size are enough ?
<zozozo> *need
<sh0t> growable
<sh0t> can i ask you how you would do that?
<zozozo> ok, then the best way to do it, I think, is to first define a new type 'a vector, which is the type of growable arrays which contains values of type 'a
<zozozo> sh0t: basically, you use an array of fixed size, until you d'ont have enough space left, in which case you reallocate a new bigger array and copy all contents
<sh0t> sure but in this case i'd have an array of 'a not an array of ref 'a...or are u saying that's actaulyl what i'd get
<sh0t> ?
<zozozo> sh0t: you can look at this implementation : https://github.com/c-cube/ocaml-containers/blob/master/src/core/CCVector.ml
<zozozo> sh0t: well, once you have an 'a array, an ('b ref) array is juste a particular case with 'a = 'b ref
<sh0t> mm i see
<sh0t> also another question about notations
<sh0t> *notation
<sh0t> 'a means always a type
<sh0t> ?
<sh0t> what about a?
mort___ has quit [Quit: Leaving.]
<zozozo> well, 'a is usually used for polymorphic types
<octachron> 'a means a free type variable: i.e a type that is not defined in the current scope
<zozozo> sometimes though, you use a (for instance when you specify types for functions on gadts)
<sh0t> ok
<sh0t> it's a variable which ranges on types
<sh0t> *over
<flux> if you don't feel it's important to implement growable arrays youself, I think it's already implemented in maybe Batteries and/or Containers..
<flux> oh, zozozo mentioned Containers
<sh0t> no flux I wanna do that by myself
<sh0t> it's not that i wanna reimplemnt the wheel but i need that
hongbo has joined #ocaml
<sh0t> zozozo, so basically u are just saying: type ('a,'mut) t = {
<sh0t> mutable size : int;
<sh0t> mutable vec : 'a array;
<sh0t> }
<flux> you don't need 'mut unless you want to be fancy
<zozozo> you can forget the 'mut part
<sh0t> right ..what's that?
<sh0t> it's not used
<zozozo> well it's a way to have non-mutable vectors
<flux> it's a phantom type for impelemnting read only/read write distinction with types
<zozozo> using types to ensure non-mutability
<sh0t> and what about the mutable keyword?
<zozozo> that's for fiels in a record
<zozozo> *fields
mort___ has joined #ocaml
<sh0t> yeah but what if i remove it...then i can't overwrite them once i created one value?
<sh0t> of that type
<zozozo> that is right
<sh0t> i still have question about the syntax: what's the name of that new type i create there?
slash^ has quit [Read error: Connection reset by peer]
<zozozo> where ?
<sh0t> type 'a t=....
<zozozo> that defines a type named 't' which takes another type as parameter
<zozozo> you would also write : type 'a mytype = ...
<zozozo> *could
<flux> or type 'value_type mytype = ..
<octachron> or type 'array_element_type my_type_name = { size: int; vec : 'array_element_type array }
afiskon has quit [Quit: Leaving]
matason has quit []
<sh0t> ok now it's clear
<sh0t> let z={size=4; vec=Array.make 1 0};;
robink has quit [Ping timeout: 248 seconds]
<sh0t> should work right?
<zozozo> sh0t: yup
<sh0t> to construct a value of type
<sh0t> int t
<sh0t> Error: This expression has type int array
<sh0t> but an expression was expected of type a' array
<sh0t> Type int is not compatible with type a'
<zozozo> sh0t: could you show the whole code ?
blandflakes has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
robink_ has joined #ocaml
<sh0t> zozozo, now it works i f**ed up before
<sh0t> thanks
<zozozo> ^^
robink_ is now known as robink
ncthom91 has joined #ocaml
notdtscode is now known as PaulMaudib
mawuli has quit [Ping timeout: 265 seconds]
matason has joined #ocaml
<Drup> Denommus, flux: lwt's syntax extension has >>
<Drup> and it works as expected
<Drup> flux explained why it can't be a regular function well enough
jonludlam has joined #ocaml
mort___ has quit [Quit: Leaving.]
<Denommus> Drup: thanks
jonludlam has quit [Ping timeout: 265 seconds]
dsheets has joined #ocaml
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
mawuli has joined #ocaml
octachron has quit [Quit: Leaving]
PaulMaudib is now known as squirtle
squirtle is now known as dtscode
leafac has quit [Quit: Leaving.]
jabesed has quit [Ping timeout: 272 seconds]
Simn has quit [Quit: Leaving]
jonludlam has joined #ocaml
Hannibal_Smith has joined #ocaml
matason has quit []
MrScout has quit [Ping timeout: 256 seconds]
Cyanure has quit [Remote host closed the connection]
mort___ has joined #ocaml
tane has quit [Quit: Verlassend]
blandflakes has joined #ocaml
blandflakes has quit [Client Quit]
wraithm has quit [Quit: leaving]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
ingsoc has quit [Ping timeout: 246 seconds]
blandflakes has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]
yomimono has quit [Quit: Leaving]
mort___ has quit [Quit: Leaving.]
badkins has joined #ocaml
mort___ has joined #ocaml
kdef has quit [Ping timeout: 265 seconds]
<sh0t> guys sorry can anyone help me with this?
<sh0t> ooops sorry
<sh0t> nevermind
<sh0t> :)
troydm has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sh0t> guys can someone please explain to me the difference between these two functions?
<sh0t> one works and mine of course not :)
<ollehar1> sh0t: what's the error message
<ollehar1> ?
<sh0t> sorry ollehar1 it now works...i don't know why...as soon as I ask here things work...
<ollehar1> ha
<ollehar1> ok
<ollehar1> though, you should know why :/
<nullcat> your function works for me
Kakadu has quit [Remote host closed the connection]
<nullcat> you dont't need to explicitly do pattern matching on record to extract the field
<nullcat> ......
<Drup> it's equally effective with IRC instead of rubber ducks :D
<ollehar1> also, use option or result instead of exceptions...
<sh0t> Drup, ahah i am gonna go get a rubber duck asap
<sh0t> nullcat, u mean i should just use dot notation?
<sh0t> ollehar1, i don't know what they are yet...
<nullcat> yes, dot is just fine
<ollehar1> option = Some 'a | None
<ollehar1> instead of nullable variables
<ollehar1> So return None when no result, and Some 'a with there's a result
<ollehar1> *when
<sh0t> ahh like Maybe in haskell
Tekilla has joined #ocaml
<sh0t> here we are with monads...:/
mort___ has left #ocaml [#ocaml]
kdef has joined #ocaml
<dmbaturin> Well, option/maybe only becomes a monad when you implement corresponding bind and return. Nothing prevents you from using it in non-monadic fashion.
<dmbaturin> You can use it as a functor (in haskell sense) rather than monad as well. :)
seanmcl_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ollehar1 has quit [Quit: ollehar1]
waneck has quit [Ping timeout: 250 seconds]
<sh0t> yeah i really need to study category theory to really understand these things.
<Drup> no you don't
swgillespie has joined #ocaml
<sh0t> well let's just say I'd like to
<sh0t> i am mostly interested in the theory of pl
<sh0t> but yeah also practice a lot.
<nullcat> watched a category theory course online, almost fell asleep after 15 mins. you don't need to understand them to write ocaml...
<dmbaturin> nullcat: Which one?
<nullcat> oregon summer school programming languages...
<nullcat> i do really want to finish "types and programming language" this summer, which is already pretty theoretical to me..
<sh0t> well i don't just wanna write ocaml but yeah i think u dont "need" cat.theory to program
<nullcat> and if you understand theoretical stuff, it's definitely much better (like drup)
<nullcat> yeah
<nullcat> it's always good to know. i am not against it
<sh0t> yeah
<Drup> heeeh
<Drup> I have no knowledge of category theory whatsoever
<nullcat> well, i mean you know some theoretical knowledge (i saw that popl paper...)
<Algebr> Uh, is there a way to overload compare ?
<Drup> ah yes, I did the implementation of that :3
<nullcat> :3
<dmbaturin> sh0t: What's fun is that the paper that introduced monads doesn't even mention category theory. :)
<Drup> dmbaturin: which one ?
<dmbaturin> Drup: Wadler's Monads for Functional Programming.
<sh0t> i htink the one of moggi was even earlier than that
<Drup> ok, introduced monads *as a programming paradigm*
<Drup> it's not the one introducing the concept :p
<dmbaturin> Well, true.
Tekilla has quit [Quit: Quitte]
<dmbaturin> Algebr: The built-in compare is a bit mysterious to me.
waneck has joined #ocaml
<dmbaturin> It looks magically overloaded but I have no idea how it's done.
<Algebr> its really mysterious to me.
<Algebr> exactly
<Algebr> I found a C thing in byterun.c, something like caml_runcompare,
<Drup> it's a function written in C that inspect the memory representation of the object at runtime and decide, based on it, how it's going to compare things
<Drup> it looks magic because it is.
madroach_ has joined #ocaml
madroach has quit [Read error: Connection reset by peer]
Hannibal_Smith has quit [Quit: Leaving]
<dmbaturin> So there's no way to extend that magic?
natrium1970 has joined #ocaml
<dmbaturin> * Without modifying the runtime.
w0rp has joined #ocaml
<zozozo> dmbaturin: write your own functions in C and use bindings to them ?
<Drup> dmbaturin: no
<dmbaturin> zozozo: Well, I'd need to make the built-in implementation of compare use it somehow.
<zozozo> ah, I didn't really get that part
<Drup> dmbaturin: just use your own compare function
<natrium1970> I’m trying to learn about GADTs, and I’ve been playing with the code from http://mads-hartmann.com/ocaml/2015/01/05/gadt-ocaml.html. How would I write the *eval* function so that it uses syntax like “ let get (type el) (x:el t) i : el = match x with ….” ?
<Drup> natrium1970: you can't
<Drup> :/
<nullcat> #drupsaiditsnotok
<Drup> it's not that it's not ok, it's that the syntax doesn't exist :(
<natrium1970> What is it about their example (Janestreet) that make it compile and mine not?
Gama11_ has quit [Remote host closed the connection]
<Drup> natrium1970: your function is recursive
<natrium1970> Oh.
<Drup> so, there are actually two notation
<Drup> 'a . ....
<Drup> that is for polymorphic recursion
<Drup> and "(type x) ..." which you used, to introduce an abstract type
<Drup> and "type x . ..." do both at once
<paarth> myself not knowing category theory and being conscious of sounding like a fool: I'm looking at the algebraic effects that we were talking about yesterday and so far my brain tells me this looks like tagging function application with effect state a la state monads
<paarth> is that sane/stupid?
<Drup> paarth: it's rather accurate, bur your comparison is weird, because in monads, it's precisely not a function application that is tagged, but a value.
seanmcl has joined #ocaml
<paarth> Drup, TBH I didn't know that was a limitation people placed on monads. Does that restriction conflict at all with the idea of functions and data as being interchangeable?
<natrium1970> Any idea why inside *eval*, it’s Eq(a, b) -> (eval a) = (eval b), but Lt (a, b) -> a < b (without eval)?
<Drup> natrium1970: because it's wrong ? :D
<natrium1970> It seems to work fine as-is.
<Drup> well, it will type, because polymorphic comparison
<nullcat> i think the author wrote it wrong...
<natrium1970> I tried to make an example that would fail, but I couldn't.
<Drup> it depends what you mean by fail
<natrium1970> Give a wrong answer or runtime error.
<Drup> something with a If
maurer has quit [Ping timeout: 252 seconds]
<natrium1970> I tried this: printf "%b\n" (eval (Lt (If (Value (Bool true), Value (Int 1), Value (Int 2)),
<natrium1970> If (Value (Bool true), Value (Int 3), Value (Int 4) ) ) ) )
<Drup> exploiting than GValue _ < GIf _
maurer has joined #ocaml
<Drup> 5 < if(true, 2, 2)
<Drup> I think that would be true
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Drup> paarth: it's not really a limitation
swgillespie has joined #ocaml
<Drup> paarth: if you are interested, I think could look at 1) arrows 2) the talk about how the effect system of Idris work
<Drup> +you
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
emias has quit [Ping timeout: 264 seconds]
<natrium1970> Drup: Thank you. Your example causes it to return a wrong answer (i.e. 5 < 2 evaluates to true). In more general question I had is whether there is a function that ensures that the comparison will be non-polymorphic, especially for int?
madroach_ has quit [Ping timeout: 264 seconds]
<Drup> not in the stdlib
<Drup> well
jonludlam has quit [Ping timeout: 265 seconds]
nullcat has joined #ocaml
<Drup> if the type of the comparison is fully known at compile time, it will use a specialized version
madroach has joined #ocaml
<Drup> so "4 < x" will always be fast
<natrium1970> I found an example that was running much slower than expected the other day because the compiler was not able to infer that.
<Drup> yes, you have to be careful since the compiler doesn't inline (for now)
<natrium1970> I don’t suppose that there’s an easy way to get the compiler to tell me what type information it was able to get so that I can know for sure.
<zozozo> checking the type with merlin would work I think
ernst_ has joined #ocaml
zapu has quit [Ping timeout: 240 seconds]
ernst has quit [Ping timeout: 256 seconds]
<sh0t> guys if i declare in my parser.mly, something like %token <float vector> VECTORFLOAT i get: Error: Unbound type constructor vector
Anarchos1 has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<sh0t> but vector is defined in vector.ml as type 'a vector = { mutable size: int; vec : 'a array; }
<sh0t> and I do open Vector in parser.mly
<Drup> you can include ocaml code between {% ... %}