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
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
MrScout_ has joined #ocaml
thomasga has quit [Quit: Leaving.]
badkins has quit [Ping timeout: 246 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
moei has joined #ocaml
skinkitten has quit [Quit: Leaving]
skinkitten has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
uucico has joined #ocaml
skinkitten has quit [Quit: Leaving]
<uucico> is there a general-purpose print function that can print arbitrary things, similar to what the ocaml interactive interpreter does to print the computed value of whatever expression the user types in?
<def`> no
<def`> you need types to do something like that, and types are erased in ocaml :(
<uucico> ah, didn't realize that. that's too bad, then, but makes sense..
Thooms has quit [Quit: WeeChat 1.0.1]
lambdahands has quit [Ping timeout: 244 seconds]
Simn has quit [Quit: Leaving]
arj has quit [Quit: Leaving.]
darkf has joined #ocaml
darkf has quit [Changing host]
darkf has joined #ocaml
antkong has joined #ocaml
rand000 has quit [Quit: leaving]
lambdahands has joined #ocaml
BitPuffin has quit [Ping timeout: 276 seconds]
antkong has quit [Ping timeout: 264 seconds]
manizzle has quit [Read error: Connection timed out]
manizzle has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jao has quit [Ping timeout: 244 seconds]
MrScout_ has quit [Remote host closed the connection]
jwatzman|work has quit [Quit: jwatzman|work]
sdegutis has joined #ocaml
<sdegutis> Does OCaml have something like Java's interfaces?
oriba has quit [Quit: oriba]
<sdegutis> Oh no wait that's something else.
joness has joined #ocaml
<joness> ocaml installer on windows is retarded as hell.. it completely overwrites PATH environment variable, instead of just adding itself to the list
zwer_q is now known as zwer
<sdegutis> Drup: thx
<Drup> sdegutis: module systems is where ML like languages really shine :p
<sdegutis> I want to declare an interface so that any type that implements a greet method taking a string (plus the implicit self argument) conforms.
<Drup> sdegutis: yes, you write the signature of a module containing a type and a greet function and you make every module conform to this signature
<sdegutis> This is the hardest language I've ever learned.
<sdegutis> Or at least attempted.
<sdegutis> Does OCaml's sum types allow associated values?
<Drup> what is that ?
<Drup> oh, what swift calls associated values ? :p
<sdegutis> Oh yeah, looks like it does.
<Drup> of course it does, it doesn't really deserve to be called "sumtypes" without it.
<Drup> sdegutis: you should read RWO, it's a better introduction to the language
<sdegutis> I'll try that again.
<sdegutis> Why does OCaml think this takes an int and returns an int? let square x = x * x ;;
<sdegutis> Is it purely because the * operator/function/whatever is only defined on ints?
pyon has quit [Quit: fix]
<Drup> yes
<Drup> operators are not overloaded in ocaml
pyon has joined #ocaml
ontologiae has quit [Ping timeout: 265 seconds]
<sdegutis> Reasonable.
<sdegutis> Oh cool, functions always take 1 argument?
<sdegutis> (only)
<blech_> that's a slightly more complicated question
<blech_> have you been exposed to currying?
<sdegutis> Sure.
<sdegutis> Most languages have it.
<sdegutis> So a multi-parameter function is automatically turned into a curried flow of functions with 1-arity?
<sdegutis> That's neat.
<Drup> from a semantic and typechecking point of view, yes
<ousado> conceptually yes, but it's being optimized where appropriate
<Drup> it's compiled more effeciently
<blech_> so if you've got mult x y the type of that function is int -> int -> int
<sdegutis> Very very cool.
<sdegutis> I don't care about optimizations and stuff behind the scene.
<sdegutis> If the language tells me that I can trust it's a curried function, then I'll take it.
<Drup> sdegutis: well, you asked about how OCaml was comparing to C speed wise
<sdegutis> Also, that's probably why I didn't like RWO.
<sdegutis> Yes but if you said yes then I trust that the compiler is smart.
psy_ has quit [Remote host closed the connection]
<Drup> ok
natrium1970 has joined #ocaml
jabesed has quit [Read error: Connection reset by peer]
jabesed has joined #ocaml
<joness> > sum [x | x <- [1..1000], x `rem` 3 == 0]
<natrium1970> I was looked at some code, and apparently it used to compile, but it no longer does. http://pastebin.com/acmwZbsD (Original page http://flyingfrogblog.blogspot.com/2007/12/immutable-stacks-in-ocamlf-and-scala.html)
<natrium1970> The problem is lies with the is_empty function. Could someone explain what changed in OCaml?
<Drup> natrium1970: there was a regression in how generalization was done (I don't remember when)
<Drup> natrium1970: add the argument on empty
<sdegutis> There must be a better way of writing this function!
<sdegutis> let sum_if_true test first second = (if test first then first else 0) + (if test second then second else 0)
AlexRussia has quit [Ping timeout: 265 seconds]
<natrium1970> Yes, I figured out how to make it work. Do you mean that the behavior in the current OCaml compiler (4.02) is wrong for not compiling it, or the older compiler was wrong for accepting it?
<Drup> natrium1970: I would say the new behavior is wrong because it breaks compat, but it's not new with 4.02, I think, it was done in 4.00
<Drup> you could ask on the mailing list the details, it's related to details of the typechecker and I don't know enough to answer
zwer has quit [Remote host closed the connection]
<natrium1970> Thank you.
zwer has joined #ocaml
<Drup> sdegutis: there are other way, but not really better
<sdegutis> Okay thanks.
<sdegutis> So far OCaml is better than Go in every way.
<Drup> how would you like to write it ?
<sdegutis> Drup: you're right, it's fine
bytbox has joined #ocaml
joness has quit [Quit: IRCGate CGI:IRC User (Ping timeout)]
joness has joined #ocaml
kapil__ has joined #ocaml
bytbox has quit [Remote host closed the connection]
<sdegutis> Is saying 'a literally equivalent to saying T in other languages?
<Drup> yeah
<Drup> well, not really, but it's a good enough approximation for now
swgillespie has joined #ocaml
<sdegutis> How's it different Drup?
<Drup> depends to which generics you are thinking of, Java-like or something else ?
<sdegutis> Swift's
<sdegutis> But you don't know Swift.
<sdegutis> Whoa! OCaml has Clojure's destructuring!
<Drup> what's Clojure's destructuring ?
<Drup> (can you link me to the part of Swift's doc with some T in it ? :p)
enitiz has quit [Ping timeout: 245 seconds]
<sdegutis> Drup: and destructuring in Clojure means you can bind based on the shape of the structure, although it's really hard to explain if you're not familiar with dynamically typed languages or Lisps
<natrium1970> Polymorphic data structures and functions look like nothing I’ve seen elsewhere, probably because of type inference. Functors remind me of Modula-3 generics.
<sdegutis> Drup: this explains it pretty quickly: http://blog.jayfields.com/2010/07/clojure-destructuring.html
reem has quit [Remote host closed the connection]
<Drup> so yes,it's the same as this kind of generics
<Drup> and it's called polymorphism. It shouldn't be called generics ...
<sdegutis> Drup: meh
<sdegutis> I don't disagree, I just don't feel as strongly about it ;)
<Drup> let me be picky about programming language, it's my thing :D
<natrium1970> I thought dynamic typing was neat until I had a program that worked fine on test data and blow up on someone else’s data.
<sdegutis> natrium1970: indeed
<Drup> sdegutis: so, you meant "let f { x ; y } = x + y" for "destructuring" ?
<sdegutis> Drup: the only thing worth being picky about is religion :P
<sdegutis> Drup: I don't know, because I don't know what that does.
<Drup> :D
<sdegutis> Drup: All I saw so far was let-binding destructuring of tuples into variables.
<sdegutis> Drup: But I'm assuming (hoping) this same principle works on all other data types.
<Drup> yeah
<sdegutis> Drup: And that it allows nesting.
<Drup> it's actually exactly the same as pattern matching
<sdegutis> Soooo niiiiceeeee.
<Drup> let <foo> = ... in ...
<sdegutis> I could see getting used to OCaml.
<Drup> <foo> can be any pattern
* sdegutis is excited
<Drup> :)
bbloom has quit [Quit: Textual IRC Client: www.textualapp.com]
<sdegutis> Labeled arguments seem to break the concept of currying.
<sdegutis> (I am on the "Lists" section of https://realworldocaml.org/v1/en/html/a-guided-tour.html right now.)
<sdegutis> (I just read List.map languages ~f:String.length;;)
<natrium1970> That book and the library it uses “Core” just love labelled parameters.
<Drup> sdegutis: what do you mean by "break" ?
taion809 has joined #ocaml
<sdegutis> Drup: well if you have int -> int -> int, and you pass the second one first -- oh wait, you can't
<Drup> sure you can
<Drup> fun x -> f x 3
<sdegutis> I meant *without* passing the first one.
<sdegutis> Oh right.
<sdegutis> But that's not what I meant ;)
<sdegutis> But yes you're right.
<Drup> (note that it's not currying, it's partial application)
<Drup> (currying is transforming a function of type int -> int -> int to int * int -> int)
<Drup> (or the opposite, I never remember which direction it is)
<sdegutis> Sure.
<sdegutis> I'm only half-way down the "A Guided Tour" chapter.
<sdegutis> After this there's still 11 more chapters :'(
<sdegutis> Does OCaml automatically use Option when you call into C libraries?
<sdegutis> (To represent that a pointer may be None or Some)
<Drup> No, that's your job to give a sensible OCaml type to C functions
<Drup> giving an option type to a pointer is not always appropriate, depending of the library you are binding
<sdegutis> Thanks Drup.
<sdegutis> Can you pass 3 to a function taking int option, instead of Some 3?
<Drup> no
<sdegutis> :'(
<Drup> but you can use optional arguments to do something like that
<sdegutis> Well I'm not so concerned about arguments.
<sdegutis> Just in general where int option is expected.
<sdegutis> e.g. also int option list.
<Drup> There is no such thing as automatic coercion in ocaml :p
MrScout has joined #ocaml
<sdegutis> well yay i guess
<Drup> (which in turns allows the type inference to be complete, btw)
<blech_> on the plus side you never have to deal with null
ygrek has joined #ocaml
MrScout has quit [Remote host closed the connection]
<sdegutis> blech_: wooooooo
marynate has joined #ocaml
lambdahands has quit [Ping timeout: 245 seconds]
<sdegutis> Drup: wooooo
sdegutis has quit [Quit: Leaving...]
marynate has quit [Quit: Leaving]
badkins has joined #ocaml
badkins has quit [Read error: No route to host]
bytbox has joined #ocaml
badkins has joined #ocaml
marynate has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
marynate has quit [Read error: Connection reset by peer]
marynate has joined #ocaml
q66 has quit [Quit: Leaving]
psy_ has joined #ocaml
lambdahands has joined #ocaml
swgillespie has joined #ocaml
enitiz has joined #ocaml
bytbox has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 246 seconds]
lambdahands has quit [Ping timeout: 245 seconds]
bytbox has joined #ocaml
badkins has quit [Remote host closed the connection]
antkong has joined #ocaml
lambdahands has joined #ocaml
sdegutis has joined #ocaml
<sdegutis> Do you often find yourself writing custom sum types for functions to represent all the different states it can return?
keen__________39 has quit [Read error: Connection reset by peer]
keen__________39 has joined #ocaml
MrScout has joined #ocaml
MrScout has quit [Read error: Connection reset by peer]
enitiz has quit [Ping timeout: 245 seconds]
yaewa has joined #ocaml
moei has quit [Ping timeout: 246 seconds]
MrScout has joined #ocaml
AlexRussia has joined #ocaml
moei has joined #ocaml
yaewa has quit [Ping timeout: 244 seconds]
yaewa has joined #ocaml
moei has quit [Ping timeout: 244 seconds]
natrium1970 has quit [Quit: natrium1970]
nullcat_ has joined #ocaml
antkong has quit [Quit: antkong]
shinnya has quit [Ping timeout: 264 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
zwer has quit [Remote host closed the connection]
zwer has joined #ocaml
rand000 has joined #ocaml
marynate has quit [Quit: Leaving]
araujo has quit [Quit: Leaving]
badkins has joined #ocaml
slash^ has joined #ocaml
badkins has quit [Ping timeout: 245 seconds]
lambdahands has quit [Ping timeout: 276 seconds]
MrScout has quit [Ping timeout: 245 seconds]
jneen is now known as jneen|zzz
badon has joined #ocaml
tane has joined #ocaml
swgillespie has joined #ocaml
_5kg has quit [Ping timeout: 246 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kakadu has joined #ocaml
nullcat_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
arj has joined #ocaml
arj has left #ocaml [#ocaml]
MercurialAlchemi has joined #ocaml
kandu has joined #ocaml
_5kg has joined #ocaml
mort___ has joined #ocaml
AltGr has left #ocaml [#ocaml]
chinglish has joined #ocaml
antkong has joined #ocaml
ingsoc has joined #ocaml
contempt has quit [Ping timeout: 272 seconds]
contempt has joined #ocaml
ingsoc1 has joined #ocaml
ingsoc has quit [Ping timeout: 245 seconds]
skinkitten has joined #ocaml
leowzukw has joined #ocaml
mort___ has quit [Quit: Leaving.]
antkong has quit [Ping timeout: 244 seconds]
shinnya has joined #ocaml
jonludlam has quit [Quit: Coyote finally caught me]
antegallya has joined #ocaml
antegallya has quit [Ping timeout: 245 seconds]
Haudegen has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
<companion_cube> sdegutis: it happens, yeah
joness has quit [Quit: IRCGate CGI:IRC User (Session timeout)]
antegallya has joined #ocaml
bytbox has quit [Remote host closed the connection]
Simn has joined #ocaml
bytbox has joined #ocaml
testcocoon has quit [Ping timeout: 246 seconds]
bytbox has quit [Ping timeout: 265 seconds]
terry852 has joined #ocaml
<jeroud> Is there a tool for indenting menhir parsers?
<jeroud> I have emacs using ocp-indent, but my .mly files are being mangled.
<def`> never heard of a tool for that :'
<def`> I do it manually in vim, using ocp-indent for ocaml parts, and some vim macros/shortcuts for menhir specific syntax
testcocoon has joined #ocaml
<Leonidas> sdegutis: yes. or if there's a lot of possibilities, then polynorphic variants
<jeroud> Ah. :-(
Haudegen has quit [Ping timeout: 246 seconds]
Haudegen has joined #ocaml
yaewa has quit [Quit: Leaving...]
moei has joined #ocaml
jonludlam has joined #ocaml
leowzukw_ has joined #ocaml
leowzukw has quit [Ping timeout: 246 seconds]
keen__________40 has joined #ocaml
keen__________39 has quit [Ping timeout: 256 seconds]
nojb has joined #ocaml
bytbox has joined #ocaml
AlexRussia has quit [Ping timeout: 272 seconds]
jonludlam has quit [Ping timeout: 272 seconds]
dsheets has joined #ocaml
zwer_e has joined #ocaml
ingsoc1 has quit [Quit: Leaving.]
zwer has quit [Ping timeout: 250 seconds]
govg has quit [Quit: leaving]
dsheets has quit [Ping timeout: 246 seconds]
nojb has quit [Quit: nojb]
madroach has quit [Ping timeout: 264 seconds]
vanila has joined #ocaml
madroach has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
badon has quit [Disconnected by services]
badon_ has joined #ocaml
madroach has joined #ocaml
badon_ has quit [Remote host closed the connection]
badon_ has joined #ocaml
badon_ is now known as badon
ggole has joined #ocaml
badon has quit [Ping timeout: 250 seconds]
madroach has quit [Ping timeout: 264 seconds]
tane has quit [Quit: Verlassend]
sdegutis has quit [Quit: Leaving...]
antegallya has quit [Ping timeout: 256 seconds]
ontologiae has joined #ocaml
ingsoc has joined #ocaml
mort___ has joined #ocaml
terry852 has quit [Read error: Connection reset by peer]
terry852 has joined #ocaml
enitiz has joined #ocaml
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
pyon has quit [Ping timeout: 246 seconds]
madroach has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
pyon has joined #ocaml
Thooms has joined #ocaml
jave has joined #ocaml
q66 has joined #ocaml
jave has quit [K-Lined]
Sim_n has joined #ocaml
ousado has quit [Ping timeout: 240 seconds]
antegallya has joined #ocaml
BitPuffin has joined #ocaml
vanila has quit [Remote host closed the connection]
Simn has quit [Ping timeout: 276 seconds]
mort___ has quit [Quit: Leaving.]
Thooms has quit [Ping timeout: 265 seconds]
badkins has joined #ocaml
uucico has quit [Ping timeout: 246 seconds]
Thooms has joined #ocaml
pyon has quit [Quit: fix]
pyon has joined #ocaml
destrius has joined #ocaml
tane has joined #ocaml
leowzukw_ has quit [Quit: Lost terminal]
mcc has joined #ocaml
sdegutis has joined #ocaml
<sdegutis> What are constructors commonly named for custom types in OCaml?
<def`> Hmm, any name that reflect the concepts you are working on is fine :P
mort___ has joined #ocaml
<sdegutis> Oh.
<sdegutis> I saw create() in the Real World OCaml book and wondered if that's what people usually use.
<mrvn> make is common
<sdegutis> Wait, you can make new operators in OCaml?
<sdegutis> I just read "let (!) r = r.contents" in RWO.
<mrvn> everything begining with an operator char is an operator
<whitequark> let (>_<) = 1
<whitequark> (sadly, not, but I wish it would be possible)
<mcc> is _ an operator?
<whitequark> no, it's not an operator character
<mcc> ok
<whitequark> I was trying to be funny
<sdegutis> So you can make your own operators?
<mrvn> # let (><) = 1;;
<mrvn> val ( >< ) : int = 1
<def`> :)
<mrvn> sdegutis: yes
<whitequark> sdegutis: yeah, any value with a name consisting only of operator characters is an operator
<sdegutis> So cool.
<whitequark> its arity, fixity and associativity depends on the first character
<sdegutis> Oh.
<sdegutis> Neat.
<mrvn> let (+++++++++++++) x y = x + y (* realy, realy, realy the sum of 2 ints *)
<whitequark> let (=^-^=)
<sdegutis> I think this is my new favorite language.
<flux> let (++) x y z = x + + yz (* ;-) *)
<mcc> it is a pretty darn cool language
<whitequark> now *that* is valid ocaml, mcc :]
<sdegutis> And I've only read (most of) chapter 1.
<sdegutis> I am excited to rewrite my OS X window manager in OCaml.
<whitequark> i even have that operator used somewhere
<whitequark> mcc: oh, btw, do you still have windows troubles?
<mrvn> whitequark: Is that the local minimum operator?
<mcc> whitequark: yes, i had someone complain about windows troubles earlier this week, and i did not get a chance to talk to them, instead i launched off to oklahoma...
<whitequark> mrvn: it's supposed to be a cat smiley
<sdegutis> What's wrong with OCaml's standard library?
<mcc> whitequark: i haven't tried to build anything on windows yet myself.
<blech_> sdegutis, I felt the same way when I first learned it
<whitequark> sdegutis: tiny
<sdegutis> Like Lua's?
<sdegutis> I'm cool with that.
<whitequark> a bit bigger than Lua's
<sdegutis> Even better.
<sdegutis> I'll just hand-roll the functions I need for now if it doesn't have them.
<blech_> you can read through the entire standard library in an afternoon
<mcc> whitequark: but the upshot was, however one goes about installing packages on ocaml is manual/undocumented enough a random uninitiate couldn't figur eit out, which is too bad cuz i want ppl building my project to be easy...
<sdegutis> blech_: source or interface?
<mcc> hey, i have an ocamlbuild question
<blech_> sdegutis, the bit about ocaml becoming a favorite language
<sdegutis> blech_: I meant can you read through the entire stdlib's source or docs in one afternoon?
<blech_> docs for sure, though I wouldn't be surprised if you could do the source too
<mcc> so i have in my _tags "<*>: package(sedlex, containers)" ... however, i want to start using my own personal fork of sedlex, not the system one, and i'd like this to be in some kind of sensible way that doesn't require the user to break their system
<dmbaturin> sdegutis: StandardML allows creating infix constructors and operators with arbitrary names, but user-defined infixness and associativity don't work well with the module system.
<mcc> ideally, i think, i'd like to make my sedlex version be a subrepo (i think git users call this a submodule) of my main repository, and tell _tags to load sedlex out of this local folder rather than out of the standard library
<ggole> I wouldn't care to understand printf, personally
<mcc> what is the sensible way to do this?
<mcc> dmbaturin: how so?
<ggole> Although now I think about it, the last time I looked was before the GADT rewrite.
<ggole> Might be less Objy now.
<sdegutis> dmbaturin: I don't know what StandardML is.
<mcc> dmbaturin: does SML not have modules?
<mcc> sdegutis: it is the version of ML people liked to use before OCaml became popular.
<sdegutis> So I don't have to care or know about it, right?
<mcc> sdegutis: standardML, ocaML
<mcc> sdegutis: nope! just expect anyone who learned ML in the 90s to mention it occasionally.
<blech_> and IIRC you toss caml light somewhere in there
<sdegutis> I can just learn OCaml and be fine?
<mcc> people seem to be standardizing on ocaml very hard, yes.
<mcc> hey whitequark, if your unicode patch gets accepted, will i be able to make unicode operators? how will the fixity work?
ontologiae has quit [Ping timeout: 244 seconds]
<ggole> Being aware of the history isn't without value, but you won't need to know anything about SML to program in OCaml.
<dmbaturin> mcc: It does, there are just problems with importing infixness and associativity without opening the module; I think it's the reason ocaml made it defined by the first character.
<mcc> dmaturin: makes a lot of sense
<whitequark> mcc: it won't
<mcc> whitequark: 'k. do you think that might be something that can come later?
<sdegutis> OCaml is making me feel like Clojure is just a simple toy project.
<whitequark> it doesn't look like the patch will be accepted
<sdegutis> And it makes me wonder why I'd ever want to use Ruby again.
<whitequark> sdegutis: typed clojure is nice.
<mcc> clojure is deployable in ways ocaml is not afaict...
<dmbaturin> mcc: Also, I learnt SML _after_ ocaml because I was curious what the other ML is like. :)
<mcc> whitequark: i wanna define a • operator that brings back SML's o operator (haskell .)
<whitequark> mcc: arguably, building three static binaries on CI is "deployable"
<whitequark> mcc: well.
<mcc> whitequark: i guess i should just start hunting for a sensible character to use for that.
<sdegutis> whitequark: Typed Clojure feels like a frankenstein project.
<sdegutis> whitequark: adding pseudo static typing to a dynamic typed language feels so weird
<mcc> whitequark: also, oh, why are they going to not accept the unicode patch? :O
<sdegutis> mcc: sure, Clojure has JVM, but meh
<whitequark> mcc: ask gasche
<sdegutis> compile and run is sufficient deployment for me
<whitequark> mcc: regarding the operator, hm, I'm currently reusing the ocaml's parser
<whitequark> let me look at it a bit closer
mort___ has quit [Quit: Leaving.]
<mcc> sdegutis: also the CLR, which is more important to me. if you want to take ocaml to the CLR you have to port it to F# last i heard
<mcc> what i really care about is Unity.
* mcc deploys to weird places.
<sdegutis> mcc: meh, I just deploy to unix so I'm fine
<mcc> You'd think a language developed by french people would be more enthusiastic about getting to use ç
<sdegutis> My personal website's payment handler is a small Ruby/Sinatra program I think.
<sdegutis> (to handle Stripe payments)
<whitequark> mcc: ocaml currently interprets filenames as latin-1.
<whitequark> and identifiers too.
<whitequark> this will be fixed in 4.03.
<mcc> whitequark: ah. so french is covered?
<sdegutis> I like Real World OCaml a lot so far, but I won't be using Core any time soon so it's frustrating that the book uses Core so pervasively.
<whitequark> mcc: yes, but it's broken
<whitequark> because no reasonable OS uses latin-1
<mcc> odd
<mcc> haha
<whitequark> and on OS X I don't think you even *can* do it on HFS+
<whitequark> so it's broken on OS X and non-French Windows installs, and essentially all modern Linuxes.
<sdegutis> Why doesnt OCaml use UTF8?
<mcc> i don't see why not, it's just bytes right?
<sdegutis> is it cuz its so old?
<whitequark> well, casefolding.
<sdegutis> oh
<whitequark> it tries to casefold utf-8, too
<sdegutis> uh
<whitequark> and fails
<mcc> ooo…
<mcc> which screws you on module names?
<whitequark> yes.
<mcc> 'k
<whitequark> almost all this crap was removed in 4.03
<mcc> haha
<whitequark> I sent the patches :]
<whitequark> so
<whitequark> ocaml-m17n can exist as a package.
<flux> though personally I won't find being limited to ASCII -too- limiting with module names, even if my native language does have öä :)
<whitequark> it's a single-line change, in principle.
<mcc> which is why it will possibly not be accepted?
<mcc> because they're saying make it a package.
<whitequark> uhm
<whitequark> see the discussion in http://caml.inria.fr/mantis/view.php?id=6692
<mcc> okay.
<whitequark> my personal view is that m17n is not worse, and indeed probably better (as it reuses the parser) than camlp4, and camlp4 was found acceptable
<whitequark> thus m17n would also be acceptable
<whitequark> and it handles essentially all edge cases in unicode, too
* mcc nods
<whitequark> anyway, to answer your original question
<whitequark> it would be trivially simple to define another operators with same priority as some preexisting operators
<whitequark> i.e. · with the priority of @
terry852 has quit [Read error: Connection reset by peer]
terry852 has joined #ocaml
<mcc> whitequark: would that mean you'd have to pick priority/arity/assoc for all those symbols ahead of time?
<whitequark> I honestly have no idea how to extend it nicely, you're welcome to leave suggestions
<mcc> OK.
<mcc> whitequark, by the way, did you see my question a few minutes ago about using a custom sedlex in Emily? maybe i should just pin my local sedlex in opam and let the repo be broken until my patches are accepted or rejected...
<whitequark> I did not
<whitequark> pinning is what people usually do
<whitequark> wrt sedlex, pester Drup until he yields
<whitequark> maybe I should just take over sedlex maintenance myself, I use it a lot
<dmbaturin> mcc: I was about to build emily. Is it "broken" already or will be soon and current snapshot should work?
IbnFirnas has quit [Read error: Connection reset by peer]
IbnFirnas has joined #ocaml
<mcc> dmbaturin: just build stable.
<mcc> or, well, you don't need to do that.
<mcc> dmbaturin: there is a "master" branch and a "stable" branch (bookmarks on bitbucket). "master" is development, "stable" is "last released version" (I'll document this soon)
<mcc> whitequark: well, even if he took the patch, i'm gonna be playing with the other sedlex patch a bit before i push it
<mcc> dmbaturin: let's just say if i break the build i'll wait to push to the repository until it's fixed again.
<mcc> dmbaturin: so you don't need to worry
<mcc> if this ever becomes a real open source project i should only be adding to master via pull request anyway :P
<dmbaturin> mcc: In git I usually tag "logical milestones". Does hg have tags?
<mcc> hg has tags. what do you mean "logical"?
<mcc> (there *is* a github clone-- i'm only using hg features that hg-git can map to git concepts)
<blech_> mcc: I think they mean arbitrary points rather than merges or such?
<dmbaturin> Well, points when something I was going to make work finally works. :)
<mcc> oh, that's interesting
<mcc> so mercurial has something called a "bookmark" which is like a movable tag. conceptually it works exactly like git branch heads, but the UI is a little more lightweight, so i tend to use them a little more casually than git users seem to use branches maybe.
<dmbaturin> So if I want someone else to try that I can suggest to checkout specific tag,
<mcc> if you use hg-git (i do), the bookmarks are literally converted to branches
<dmbaturin> I probably should learn about hg some day.
<whitequark> mcc: wait, you use hg-git? wouldn't that defeat the point of using hg
<mcc> whitequark: don't understand the question
<whitequark> hg-git has the interface of what?
<whitequark> user-facing
<mcc> hg-git is a mercurial plugin which allows you to push and pull to git repositories from hg. it does not change the interface to hg at all.
<whitequark> oh, disregard the question
<mcc> ( and my patch that WOULD have slightly extended the interface was never accepted :P )
<mcc> whitequark: there was a second module called hgit, i think, written by the same maintainer, that you might have been thinking of
<mcc> i don't think it was ever finished
<whitequark> NOT CONFUSING NAMING AT ALL
<mcc> yes, i'm not happy with this.
<mcc> especially because hg-git is the name of the project but hggit is the name of the plugin from the perspective of the mercurial plugin loader.
<blech_> there's a hyphen. What's the problem? They even tossed in a g for you
<blech_> for (g)ood measure
<mcc> so you check out hg-git the project and there is a folder inside named hggit, and when you submit patches the maintainer rambles about how he's about to dump the whole thing for hgit...
kapil__ has quit [Quit: Connection closed for inactivity]
waneck has joined #ocaml
<mcc> oh, and you can imagine how difficult it is to have an in-person conversation with someone in which you attempt to mention hg-git
<mcc> i usually just call it "the git-mercurial bridge"
<mcc> otherwise it's "well, i used hig git…"
<mcc> anyway.
struktured has joined #ocaml
<ggole> Sounds like a hiccup.
darkf has quit [Quit: Leaving]
andreypopp__ has quit []
andreypopp__ has joined #ocaml
terry852 has quit [Ping timeout: 264 seconds]
<dmbaturin> At least you do have opportunities to discuss such things with people in person. ;)
<mcc> Only when I need to embarrassedly explain to people at work why I cannot help them with their git problem.
<mcc> whitequark: so you're familiar with sedlex internals... can you help me understand the difference between marked_pos and marked_val? marked_pos is "if we backtrack, we'll go to here", marked_val is for some kind of feature where the end user can mark a special place for backtracking?
<mcc> i'm asking in part because it looks like "refill" adjusts the positions of pos and marked_pos but not marked_val, which seems… like a bug
<whitequark> so, "pos" is the stream position
<whitequark> and "val" is the saved lexer state at that position
<mcc> oh! but it's an int?
<mcc> so it's actually a codepoint?
<whitequark> um, I don't think it's a codepoint
<whitequark> it's the number of state in the internal DFA, I think
<mcc> i see.
<mcc> maybe i'll… go ahead and give that a type or something.
tanguy` has joined #ocaml
<ggole> val is such a descriptive word.
<whitequark> lol
<ggole> No really, it could describe almost anything.
Thooms has quit [Ping timeout: 265 seconds]
<def`> especially in a functional language :P
IbnFirnas has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
jneen|zzz is now known as jneen
pyon has quit [Ping timeout: 245 seconds]
<MercurialAlchemi> ugh, you can really OCaml's codebase is not that young
mcc has quit [Quit: This computer has gone to sleep]
justinfront has joined #ocaml
axiles has joined #ocaml
pyon has joined #ocaml
<justinfront> Error: Multiple definition of the extension constructor name Error. Is there a switch or something that I need, I think I must be using newer ocaml with older code?
<ggole> justinfront: which version are you using?
antegallya has quit [Ping timeout: 245 seconds]
<justinfront> The OCaml toplevel, version 4.03.0+dev5-2014-10-15
<justinfront> I am getting an error with zip.ml ( specifically the one in the haxe repository ) but just checked the original at that has the same line https://github.com/Leonidas-from-XIV/camlzip/blob/master/src/zip.ml#L76
mcc has joined #ocaml
<ggole> This may have changed in 4.03.
<ggole> Just a moment, I'll check.
<justinfront> if I change it to Error2 then it works but unsure if that ok
<Leonidas> (that is just a git mirror of the original camlzip, because I can't be bothered to use SVN)
<ggole> Hmm, repeating the constructor works for my 4.03
<ggole> But my 4.03 is a bit old. I'd say you are looking at a very recent change.
<mcc> whitequark: sorry to bother again-- marked_val is initialized to 0 at lexbuf creation, then when "start" is called it's set to -1. I'm wandering around the code but I cannot find any indication what the meaning of -1 is for a state.
<mcc> whitequark: errrr.... i asked that question but now i have to disappear. sorry.
* mcc is hanging around a hotel lobby >_>
mcc has quit [Client Quit]
<ggole> justinfront: you should be able to simply delete the redundant exception definition, since they are the same
<ggole> Unless you're relying on uniqueness or something
<justinfront> if I delete the first one line 18 I get an error else where
<ggole> No, remove the later one
<ggole> On 76
<justinfront> ok thanks
_5kg has quit [Ping timeout: 240 seconds]
sdegutis has quit [Quit: Leaving...]
<justinfront> It can't seem to find camlp4o command not found
<ggole> Did you install camlp4?
struktured has quit [Ping timeout: 245 seconds]
ingsoc has quit [Quit: Leaving.]
<justinfront> Ok just getting it from git.
<justinfront> thanks it used to be in ocaml before?
<Drup> whitequark: let me be overworked for a few days before merging patches, would you ?
<ggole> justinfront: yeah, that changed recently
<ggole> justinfront: are you using opam?
<justinfront> from memory I don't think Nicolas likes opam but I might be muddling it from something else but I don't think haxe complier uses that?
<justinfront> File "camlp4/boot/Camlp4.ml", line 14857, characters 34-42:
<justinfront> Error: Unbound constructor Labelled
<justinfront> Command exited with code 2.
<justinfront> make: *** [byte] Error 10
<justinfront> Justins-MacBook-Pro:camlp4
<Drup> justinfront: you are using ocaml trunk, don't be surprised if some things are broken.
<ggole> Yeah, latest release might be a better idea
<justinfront> I am not surprised just sometimes get fed up with macports and in the past I found ocmal from git easier
<Drup> you can get ocaml from git if you want, just use stable versions
<justinfront> seems separating ocaml and camlp4 means that they are not unit tested together?
<justinfront> I could try making ocaml again I looked at the line it looks much the same as the line after
ontologiae has joined #ocaml
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
struktured has joined #ocaml
<Leonidas> camlp4 was separated out so it can be safely be dumped and deprecated :)
eyyub has joined #ocaml
<justinfront> ocamlopt -pp camlp4o -g -I libs/extlib -I libs/extc -I libs/neko -I libs/javalib -I libs/ziplib -I libs/swflib -I libs/xml-light -I libs/ttflib -I libs/ilib -I libs/objsize -c parser.ml
<justinfront> sh: camlp4o: command not found
mcc has joined #ocaml
<justinfront> so I could modify the code to use something else
<justinfront> ?
<Drup> or go and fetch camlp4
<Drup> (or use opam and be done with it)
<justinfront> I tried the git it does not make
<mcc> Hey Drup, do you have any thoughts on my sedlex pull request?
<justinfront> I am just trying to build the haxe source
<Drup> mcc: I was waiting for the week end to review, I just woke, so I'm going to look at it :)
<mcc> drup: oh! ok :)
<mcc> sorry to pester.
<MercurialAlchemi> how the hell can you have "let rec foo x = ..." and then "let foo x = foo x;..."
<Drup> MercurialAlchemi: what's the issue ?
<justinfront> so if camlp4 is dying why is there http://camlp5.gforge.inria.fr/
<MercurialAlchemi> well, first it's confusing
<MercurialAlchemi> secondly, it's confusing enough that utop seems to give up on it
<Drup> justinfront: camlp5 is the *ancestor* of camlp4 (yes, it's confusing)
<justinfront> oh ah.
<mcc> do you think there will ever be a camlp3
<Drup> justinfront: really, you should install with opam, stop banking your head against the wall
<Drup> ganing*
<MercurialAlchemi> mcc: hopefully not
<Drup> grrmbl.
<Drup> banging*
_5kg has joined #ocaml
<justinfront> so is campl4 used in haxe for creating the AST ?
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<Drup> You should ask haxe specific question on the haxe channel, I think most people here are not familiar with it
<justinfront> fair enough just fustrated that git ocaml I built not long ago does not seem to be compatible with campl4 git which are both required currently.
<mcc> the people in the haxe channel see helpful in my experience
mcc has quit [Quit: /quit]
<justinfront> sure, I can get it another way just often prefer building it myself but not done it since changing machines.
Hannibal_Smith has joined #ocaml
_5kg has quit [Ping timeout: 245 seconds]
_5kg has joined #ocaml
leowzukw has joined #ocaml
mort___ has joined #ocaml
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
vanila has joined #ocaml
MrScout has joined #ocaml
jave has joined #ocaml
reem has joined #ocaml
struktured has quit [Ping timeout: 246 seconds]
SHODAN has quit [Quit: No Ping reply in 180 seconds.]
SHODAN has joined #ocaml
mort___ has quit [Quit: Leaving.]
Submarine has joined #ocaml
Submarine has joined #ocaml
AlexRussia has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
BitPuffin has quit [Quit: See you on the dark side of the moon!]
BitPuffin has joined #ocaml
Haudegen has joined #ocaml
eyyub1 has joined #ocaml
MrScout has quit [Ping timeout: 255 seconds]
eyyub has quit [Ping timeout: 244 seconds]
<Leonidas> justinfront: or you could just install caml 4.02.1 and camlp4 4.02.1 and it would just work.
<Leonidas> no idea why you desperately try to make your life complicated
MrScout has joined #ocaml
MrScout has quit [Ping timeout: 264 seconds]
reem has quit [Remote host closed the connection]
reem has joined #ocaml
lambdahands has joined #ocaml
justinfront has quit [Ping timeout: 252 seconds]
eyyub2 has joined #ocaml
jonludlam has joined #ocaml
eyyub1 has quit [Ping timeout: 264 seconds]
nullcat has joined #ocaml
mort___ has joined #ocaml
_5kg has quit [Ping timeout: 246 seconds]
tanguy` has quit [Ping timeout: 255 seconds]
mariusae has quit []
reem has quit [Remote host closed the connection]
mariusae has joined #ocaml
pyx has joined #ocaml
pyx has quit [Client Quit]
oriba has joined #ocaml
ebzzry has joined #ocaml
lambdahands has quit [Ping timeout: 245 seconds]
swgillespie has joined #ocaml
thomasga has joined #ocaml
struktured has joined #ocaml
tanguy` has joined #ocaml
jao has quit [Ping timeout: 264 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
AlexRussia has quit [Ping timeout: 264 seconds]
_5kg has joined #ocaml
ggole has quit []
mort___ has quit [Quit: Leaving.]
<oriba> just trying to use opam
<oriba> my first steps dont look very successful
<oriba> how do I list the packages that are available in the repositories?
<oriba> opam list only shows downloaded stuff
<oriba> for example, how do I install a ocaml compiler?
<Drup> question 1) opam list -a
<thizanne> opam switch 4.02
<Drup> question 2) opams switch list
<Drup> -s
<thizanne> +install
<Drup> compilers are (for now) not packages
<oriba> and how do I install a compiler?
<vanila> i thought i installed other ocaml versions using opam
slash^ has quit [Read error: Connection reset by peer]
<oriba> ah, I have to use "opam switch" instead of "opam install"... I thought first install, then switch
AlexRussia has joined #ocaml
Sim_n is now known as Simn
ingsoc has joined #ocaml
<oriba> yay, thats nice, I now have ocaml 4.02.1 on a server, where they have ocaml 3.12.1 installed :-)
leowzukw_ has joined #ocaml
ebzzry has quit [Remote host closed the connection]
leowzukw has quit [Ping timeout: 246 seconds]
<oriba> oh, really easy to install things... thats nice
<oriba> but one package I need is not available :-(
<oriba> too bad
<oriba> can system-installs and local installs be mixed?
ingsoc has quit [Quit: Leaving.]
<Drup> not really
ebzzry has joined #ocaml
<oriba> hmhh
<Drup> first because, as you said, your system install is with 3.12 and the local with 4.02
<oriba> ah, hmhh#
<oriba> maybe native code...
<oriba> maybe I should compile to native at my laptop and try if it runs on the server ;-)
leowzukw_ has quit [Quit: Lost terminal]
<oriba> shared libs problem..... shit
<oriba> the lib installed by hand installs itself into opam-dir! :-)
taion809 has left #ocaml ["ᕕ( ᐛ )ᕗ Byeeee"]
<oriba> but can't be found :-(
Antoine59 has quit [Ping timeout: 245 seconds]
lambdahands has joined #ocaml
Antoine59 has joined #ocaml
lambdahands has quit [Ping timeout: 246 seconds]
lambdahands has joined #ocaml
justinfront has joined #ocaml
S11001001 has quit []
S11001001 has joined #ocaml
ontologiae has quit [Ping timeout: 240 seconds]
tanguy` has quit [Ping timeout: 264 seconds]
keen__________41 has joined #ocaml
rock_neurotiko has joined #ocaml
keen__________40 has quit [Ping timeout: 252 seconds]
rock_neurotiko has quit [Read error: Connection reset by peer]
<Leonidas> when I have a function that returns `Foo or `Bar, how can I specify in the signatur file that only `Foo and `Bar are allowed but not more? I thought [`Foo | `Bar] would work, but that seems to work even when it cannot return `Bar
<mrvn> # let (f : [< `Bar | `Foo ] -> [`Bar | `Foo ]) = function `Foo -> `Foo | `Bar -> `Bar;;
<mrvn> val f : [< `Bar | `Foo ] -> [ `Bar | `Foo ] = <fun>
<mrvn> works fine
Hannibal_Smith has quit [Ping timeout: 252 seconds]
mcclurmc_ has joined #ocaml
<Drup> Leonidas: that's normal
mcclurmc has quit [Ping timeout: 252 seconds]
<Leonidas> mrvn: this can't return bot_error, but when I say [ topic_error | bot_error ] it gets accepted just fine.
<Leonidas> *topic_result
<mrvn> Leonidas: and the problem is?
<Leonidas> mrvn: I would like it to error if I say [ topic_error | bot_error ] in the sig as this is just wrong.
<Drup> Leonidas: it's how poly variants work. think of a polymorphic variant as (inclusion relations on) sets of variants. The return of your function is clearly inside the set [ topic_error | bot_error ].
<Leonidas> Drup: so there is no difference between [> foo | bar ] and [ foo | bar ]?
<mrvn> yes there is.
<mrvn> [> means it can be bigger
<Drup> there is a difference, baz is inside the first but not the second.
justinfront has quit [Ping timeout: 240 seconds]
vanila has quit [Quit: Leaving]
<Leonidas> so there is no way to say, "I know exactly which polymorphic variants are the result", please warn me if the code and the signature disagree?
<Drup> it will warn you for some kind of disagreement, but not "lack of variant returned".
<Leonidas> okay
<Leonidas> that's a bit disappointing
antegallya has joined #ocaml
jonludlam has quit [Quit: Coyote finally caught me]
jonludlam has joined #ocaml
bobpoekert has quit []
bobpoekert has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
anemator has joined #ocaml
Haudegen has joined #ocaml
anemator has quit [Client Quit]
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 276 seconds]
swgillespie has joined #ocaml
antkong has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
Majmun has joined #ocaml
Majmun has left #ocaml [#ocaml]
Kakadu has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 245 seconds]
reem has joined #ocaml
chouser has joined #ocaml
<chouser> Anyone care to help me get the right syntax to define a parameterized type with more than one parameter?
<chouser> I was hoping: type 'a 'b foo = { x : 'a; y : 'b} ...but no
<Drup> chouser: "type ('a,'b) foo ..."
<chouser> Drup: perfect. thanks! Coulda sworn I tried that, but apparently not. :-P
<chouser> Also, is there any way to define mutually-recursive types?
<def`> type t = ... and u = ...
<chouser> Wow, I should have come hear earlier. Thanks!
<chouser> Does that work with module parameters as well?
<Drup> yes
<Drup> oh, wait, module parameters ? what do you mean ?
<chouser> It's possible what I want to do doesn't make sense. I'm very new to this.
eyyub2 has quit [Ping timeout: 255 seconds]
<chouser> But I'm thinking something like: module MyMap = Map.Make (Foo) and Foo = FooMap of MyMap.t
<chouser> or should that be: type Foo = FooMap of MyMap.t
antkong has quit [Ping timeout: 255 seconds]
<Drup> that doesn't really make sens.
<Drup> first, Foo should be foo, since it's a type.
<chouser> ah yes, right.
<Drup> second, Map.Make takes a module, not a type, so you need a bit more
<Drup> third, this is a map that takes map as parameters ? You have a bit of a recursivity issue there :p
<chouser> oh right, comparison functions and such.
<chouser> yes, the idea is very much recursive. A map whose keys are maps.
<Drup> but the same type of maps ?
jabesed has quit [Ping timeout: 256 seconds]
<Drup> well, you can always start with empty maps, but still, it's weird :D
<chouser> Yes. Well, actually a variant that might be the same kind of map.
<chouser> But I've got to get my struct for Map.Make right first. If I can't figure it out from there, I'll be back. :-)
<chouser> oh, that comparison function is going to demand a total ordering across my whole variant. Hm.
<Drup> (you can cheat and use "compare" at first)
antegallya has quit [Ping timeout: 264 seconds]
<chouser> hm! I'll try that
<chouser> brilliant!
eyyub2 has joined #ocaml
lambdahands has quit [Ping timeout: 264 seconds]
AlexRussia has quit [Ping timeout: 245 seconds]
AlexRussia has joined #ocaml
AlexRussia has quit [Client Quit]
<def`> chouser: recursive modules allow you to do recursive maps
AlexRussia has joined #ocaml
<chouser> Hm, ok. I might not need that.
eyyub2 has quit [Remote host closed the connection]
lordkryss has joined #ocaml
<chouser> Thanks you all for your help, I really appreciate it. I'll be back later.
rand000 has quit [Quit: leaving]