adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Upcoming OCaml MOOC: https://huit.re/ocamlmooc | OCaml 4.03.0 release notes: http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ygrek has quit [Ping timeout: 260 seconds]
veggie_ has quit [Ping timeout: 245 seconds]
petroav has joined #ocaml
kamog has quit [Remote host closed the connection]
<petroav> Hey everyone! I'm taking the ocaml mooc at the moment and I'm having some trouble. I'd really appreciate some help. I'm having trouble understand a compiler error.
<petroav> The code I'm working on can be found here https://gist.github.com/petroav/86f35fbe9fb7168d98b7a9242809f341
<petroav> I'm not even sure how to interpret the compiler error? Is the expected type for the function signature or is it just for the expression?
unbalancedparen has joined #ocaml
okuu has joined #ocaml
pierpa has quit [Remote host closed the connection]
conrad4 has joined #ocaml
brunoro has joined #ocaml
conrad4 has quit [Ping timeout: 252 seconds]
brunoro has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 250 seconds]
agarwal1975 has quit [Quit: agarwal1975]
pierpa has joined #ocaml
<Bluddy[m]> The term highlighted with ^^^ is where the problem is
alienbot has joined #ocaml
<Bluddy[m]> notice that sub_trie is held within `Some`, so it's data
<Bluddy[m]> but if you look at lookup_aux, it takes a `t` argument
<Bluddy[m]> and when you match on `t`, you use `match (t word idx)`, ie. you're taking the `t` argument and applying it as a function to `word` and `index`
<Bluddy[m]> sorry, `idx`
<Bluddy[m]> so is `t` a function, or is it a constant? that's what the compiler is confused about
rgrinberg has joined #ocaml
<Bluddy[m]> petroav: ping
sh0t has quit [Quit: Leaving]
al-damiri has joined #ocaml
silver_ is now known as silver
alienbot has quit [Ping timeout: 244 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 245 seconds]
brunoro has joined #ocaml
alienbot has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
silver has quit [Read error: Connection reset by peer]
wu_ng has joined #ocaml
wu_ng has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
alienbot has quit [Ping timeout: 250 seconds]
Heasummn has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
wu_ng has joined #ocaml
sh0t has quit [Remote host closed the connection]
shakalaka has quit [Quit: bye.]
shakalaka has joined #ocaml
FreeBirdLjj has joined #ocaml
conrad4 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
govg has quit [Ping timeout: 256 seconds]
conrad4 has quit [Ping timeout: 256 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
unbalancedparen has quit [Quit: WeeChat 1.6]
FreeBirdLjj has joined #ocaml
govg has joined #ocaml
pierpa has quit [Ping timeout: 244 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 245 seconds]
brunoro has joined #ocaml
<petroav> Bluddy[m], Yes, that's it! The compiler thought I was invoking t as a function on those two arguments when in fact I'm just trying to pattern match. When I changed the line to match (t, word, idx) my code passed the type checker.
<petroav> Bluddy[m], really appreciate you taking the time to help me :)
<Bluddy[m]> sure thing. that's part of what this IRC is for
brunoro has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 260 seconds]
petroav has quit [Ping timeout: 260 seconds]
jao has quit [Ping timeout: 265 seconds]
conrad4 has joined #ocaml
sgronblo_ is now known as sgronblo
rgrinberg has quit [Ping timeout: 265 seconds]
conrad4 has quit [Ping timeout: 250 seconds]
voglerr has joined #ocaml
Heasummn has quit [Ping timeout: 256 seconds]
voglerr has quit [Ping timeout: 244 seconds]
conrad4 has joined #ocaml
conrad4 has quit [Ping timeout: 250 seconds]
brunoro has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
brunoro has quit [Ping timeout: 265 seconds]
conrad4 has joined #ocaml
dreadedfrog_wut has joined #ocaml
AlexRussia has quit [Ping timeout: 252 seconds]
conrad4 has quit [Ping timeout: 245 seconds]
govg has joined #ocaml
cfdr has joined #ocaml
dreadedfrog_wut has quit [Ping timeout: 245 seconds]
dreadedfrog_wut has joined #ocaml
malina has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 265 seconds]
alfredo has joined #ocaml
noddy has quit [Ping timeout: 250 seconds]
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
jnavila has joined #ocaml
noddy has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
mengu has quit [Remote host closed the connection]
AlexRussia has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
MobLurker has joined #ocaml
<MobLurker> Hey, new to ocaml here.
<MobLurker> I have some code that isn't working like I expect it.
<MobLurker> It's throwing a compiler error around line 30, saying that the pattern matching isn't kosher.
FreeBird_ has joined #ocaml
<MobLurker> Basically, from what I can tell, it's not passing the entire list of arguments through the function chain, instead just passing apply_rules first_non_terminal to the output and ignoring everything else.
FreeBirdLjj has quit [Read error: Connection reset by peer]
<MobLurker> Can anyone help me out?
conrad4 has joined #ocaml
<zozozo> MobLurker: you should enclose your inner match with with "begin match ... with .. end"
conrad4 has quit [Ping timeout: 250 seconds]
rkkjkkljlkjlkj has joined #ocaml
<zozozo> also, the exact error would be helpful
<MobLurker> Error: This pattern matches values of type 'a option
<MobLurker> but a pattern was expected which matches values of type
<MobLurker> 'b -> 'c -> 'd -> 'e -> 'f
rkkjkkljlkjlkj has quit [Client Quit]
<MobLurker> I've never seen the syntax you're suggesting before. Can you give me an example?
<zozozo> hm.. try and annotate generate_a_derivation and apply_rules with their type
<MobLurker> I'm really new to ocaml and didn't even know that was possible.
<zozozo> begin expr end is the same as (expr) so for instance:
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
<zozozo> match x with | Some_pattern -> do_something | Some_other_patter y -> begin match y with A -> 0 | B -> 1 end | Again_another_pattern -> bla
<MobLurker> So is that identical to just putting it parens?
<zozozo> yes
<MobLurker> Okay, thanks.
<MobLurker> So to clarify, for type annotations, does it generally look like
<MobLurker> let function_name: 'a -> 'b -> 'c .... -> 'end_type = fun a b c ...
<zozozo> MobLurker: I think I spotted the actual error: on line 16 when you apply generate_a_derivation, you have a starting parentheses at the end of the line, which makes the whole block of lines 17-25 a single argument instead of the 5 you expect to give it
<MobLurker> .... wait how
<MobLurker> I'm not sure I understand.
<zozozo> you basically wrote : generate_a_derivation (argument1 argument2 argument3 argument4 argument5)
<MobLurker> Does that get treated as a tuple, even without the comma?
<zozozo> so the whole thing in parentheses wount as a single expression, so a single argument to generate_a_derivation
<zozozo> meaning that the compiler thus expects arguments1 to be a function of 4 arguments
<zozozo> whose return type will match that of the first argument of generate_a_derivation
<MobLurker> oh
<MobLurker> okay
<MobLurker> that makes sense... ish....
<MobLurker> It's pretty obvious that my first language was something C style, so this is very different syntax to me
<zozozo> ^^
<MobLurker> okay, thanks. That clears stuff up.
mengu has quit [Ping timeout: 260 seconds]
<MobLurker> So I probably have a similar catagory of problem on line 30, then
<zozozo> yup
<MobLurker> as well as 20. Okay.
<MobLurker> Thank you so much for the help!
tristero has quit [Ping timeout: 244 seconds]
<MobLurker> i appear to have another problem with the code, but IU
<MobLurker> I'll take a crack at it before asking again. Thanks though!
tristero has joined #ocaml
mengu has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #ocaml
brunoro has joined #ocaml
<infinity0> is ocaml 4.04 likely to be released before nov 3?
<infinity0> to get it into debian in time for the next stable version, i'd need to upload it before that date, because there are deadlines for various processes
brunoro has quit [Ping timeout: 250 seconds]
<companion_cube> does debian have 4.03?
<infinity0> nope, for a similar reason (requires some process i didn't have time to do yet)
<infinity0> does 4.04 require 4.03 to compile?
<adrien> the ocaml compiler bootstraps itself
AlexDenisov has joined #ocaml
<adrien> I take it you're working together with nicoo
<infinity0> how? we can't download 4.03 during the build, on debian build machines
<infinity0> no, haven't seen him. the debian ocaml mailing list was silent when i asked for help with 4.03
MobLurker has quit [Quit: Leaving]
<adrien> it doesn't need to download anything additional
<adrien> nicoo: free highlight :P
<nicoo> Arg
<nicoo> adrien: Thanks
<nicoo> infinity0: I have an experimental (not as in the release suite) package for ocaml 4.04
zpe has joined #ocaml
<infinity0> did you build that on top of the 4.03 stuff i already pushed to git?
<infinity0> i packaged ocamlbuild too btw
<nicoo> The bit that is needed is packaging ocamlbuild (which is not part of the standard distribution anymore), and then doing a package transition (warning: transition freeze is SOON)
<infinity0> which was necessary. it's in git too
<nicoo> infinity0: Nope, that was in August and I didn't write to the mailing list mostly because I got pretty ill and didn't have time/spoons for finishing before transition freeze
<nicoo> OK, seems your version is further along anyhow
mengu has quit [Remote host closed the connection]
<infinity0> 4.03 is finished, i didn't start 4.04 yet because it's not released yet, so i don't know what you mean when you say you packaged it
<nicoo> I'm being confused, meant 4.03
freusque has joined #ocaml
<nicoo> infinity0: The bootstrap works by building a C bytecode interpreter, and then using the bytecode-compiled OCaml compiler (shipped as part of the release process) to build the compiler
<nicoo> IIRC
<nicoo> Ah, misunderstood the backlog
Ravana has quit [Quit: Goodbye for now!]
dreadedfrog_wut has quit [Ping timeout: 245 seconds]
govg has joined #ocaml
ygrek has joined #ocaml
AlexRussia has quit [Ping timeout: 252 seconds]
mengu has joined #ocaml
Muzer has quit [Read error: Connection reset by peer]
Simn has joined #ocaml
voglerr has joined #ocaml
voglerr_ has joined #ocaml
voglerr has quit [Read error: Connection reset by peer]
govg has quit [Ping timeout: 252 seconds]
voglerr_ has quit [Read error: Connection reset by peer]
voglerr has joined #ocaml
Muzer has joined #ocaml
brunoro has joined #ocaml
voglerr_ has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
<infinity0> wait so i forgot the original question, is it worth waiting for 4.04
voglerr has quit [Ping timeout: 252 seconds]
mengu has quit [Remote host closed the connection]
MobLurker has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
AlexRussia has joined #ocaml
conrad4 has joined #ocaml
<MobLurker> hi all
<MobLurker> i'm trying to learn how to do type annotations and... well
<MobLurker> this is a mess.
<MobLurker> Clearly there is a better way, and I suspect that this involves type declarations, but I can't find any good documentation on how to do this.
<zozozo> it would seems that defining some types might be clearer
conrad4 has quit [Ping timeout: 265 seconds]
<MobLurker> I figured as much, but I can't seem to figure out how to do it.
<zozozo> also, while tuples are useful, it can be nice to define structs (with named fields) instead
<MobLurker> It's a requirement of the assignment I'm doing.
FreeBirdLjj has quit [Remote host closed the connection]
<zozozo> for isntance, you can have the following: "type (a, 'b) t = 'a * ('a -> 'b list)"
FreeBirdLjj has joined #ocaml
<zozozo> (that's just a random example, not something directly applicable to your code here)
dhil has joined #ocaml
<MobLurker> So is the idea that i first declare a list of generic types I wish to use in the type itself, then write how it works?
jwatzman|work has joined #ocaml
<zozozo> well, you can indeed use type aliases (as in my example above), to make the types clearer
<MobLurker> so something a la type ('nonterminal, 'terminal) derivation
<MobLurker> = ('nonterminal * (('nonterminal, 'terminal) symbol list)) list
<MobLurker> ?
<MobLurker> er
<MobLurker> type ('nonterminal, 'terminal) derivation
<MobLurker> = ('nonterminal * (('nonterminal, 'terminal) symbol list)) list
<zozozo> though I'd till recommand using structs instead of tuples, for the code clarity
<zozozo> yup
brunoro has joined #ocaml
<MobLurker> kk
zv has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
octachron has joined #ocaml
govg has joined #ocaml
zv has joined #ocaml
AlexDeni_ has joined #ocaml
AlexDenisov has quit [Read error: Connection reset by peer]
Simn has quit [Quit: Leaving]
voglerr_ has quit [Remote host closed the connection]
cfdr has quit [Ping timeout: 260 seconds]
voglerr has joined #ocaml
nicoo has quit [Remote host closed the connection]
mengu has joined #ocaml
voglerr has quit [Ping timeout: 260 seconds]
mengu has quit [Ping timeout: 256 seconds]
AlexDeni_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
govg has quit [Ping timeout: 252 seconds]
<MobLurker> Can someone explain this error to me
<MobLurker> Error: This expression has type ('a, 'b) t_derivation * 'b list
<MobLurker> (('nonterminal, 'terminal) t_derivation * 'terminal list) option
<MobLurker> ('nonterminal, 'terminal) t_acceptor_output =
<MobLurker> but an expression was expected of type
<MobLurker> Why does the compiler decide that the two patterns don't match?
<MobLurker> Here's the full code
<johnelse> MobLurker: The compiler is expecting an option type - it's the same as if you tried to pass an int to a function expecting an int option
<MobLurker> shit, didn't see that
FreeBirdLjj has joined #ocaml
<johnelse> yeah, I missed it the first couple of times I read it :)
<MobLurker> thanks
voglerr has joined #ocaml
cxas has joined #ocaml
mengu has joined #ocaml
demonimin has quit [Remote host closed the connection]
voglerr has quit [Ping timeout: 260 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wu_ng has quit [Ping timeout: 260 seconds]
djellemah_ has joined #ocaml
voglerr has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
_andre has joined #ocaml
Guest26 has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
MobLurker has quit [Quit: Leaving]
<infinity0> Running tests from 'tests/regression/pr3612' ...
<infinity0> /tmp/camlobj9e7671.c:4:27: fatal error: caml/mlvalues.h: No such file or directory
<infinity0> #include <caml/mlvalues.h>
<infinity0> anyone get this
<infinity0> fails during automated testing but not when i run it manually
<infinity0> this file is the only file in the testsuite that includes mlvalues.h from a testsuite directory 3 levels deep, don't know why this should make it fail though
conrad4 has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
conrad4 has quit [Ping timeout: 252 seconds]
nicoo has joined #ocaml
djellemah_ has quit [Ping timeout: 252 seconds]
kakadu_ has joined #ocaml
voglerr_ has joined #ocaml
voglerr has quit [Ping timeout: 245 seconds]
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Ping timeout: 252 seconds]
petroav has joined #ocaml
brunoro has joined #ocaml
dhil has quit [Ping timeout: 265 seconds]
voglerr has joined #ocaml
voglerr_ has quit [Read error: Connection reset by peer]
brunoro has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #ocaml
yomimono has joined #ocaml
brunoro has joined #ocaml
AlexRussia has quit [Ping timeout: 256 seconds]
mengu has joined #ocaml
zpe has quit [Remote host closed the connection]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
ia0 has quit [Quit: reboot]
mengu_ has joined #ocaml
mengu has quit [Ping timeout: 265 seconds]
ia0 has joined #ocaml
ia0 has quit [Client Quit]
ygrek has joined #ocaml
ia0 has joined #ocaml
AlexDenisov has joined #ocaml
petroav has quit [Ping timeout: 260 seconds]
AlexDenisov has quit [Client Quit]
FreeBirdLjj has quit []
FreeBirdLjj has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Client Quit]
zpe has joined #ocaml
AlexDenisov has joined #ocaml
agarwal1975 has joined #ocaml
AlexRussia has joined #ocaml
dwillems has joined #ocaml
freusque has quit [Ping timeout: 250 seconds]
shinnya has joined #ocaml
ygrek_ has quit [Ping timeout: 260 seconds]
conrad4 has joined #ocaml
fraggle-boate has quit [Remote host closed the connection]
ggole has joined #ocaml
conrad4 has quit [Ping timeout: 256 seconds]
fraggle-boate has joined #ocaml
FreeBirdLjj has joined #ocaml
mengu_ has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Changing host]
mengu has joined #ocaml
govg has joined #ocaml
sfri_ has quit [Read error: Connection reset by peer]
mengu has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
sfri has joined #ocaml
dhil has joined #ocaml
demonimin has joined #ocaml
chindy has joined #ocaml
<chindy> when using merlin and emacs how can i execute a makefile that is in the same directory as the .merlin file aka not in src for example
letaris has joined #ocaml
mengu has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
cxas has quit [Quit: Page closed]
letaris has quit [Remote host closed the connection]
letaris has joined #ocaml
fraggle-boate has quit [Remote host closed the connection]
fraggle-boate has joined #ocaml
chindy has quit [Ping timeout: 260 seconds]
<sgronblo> I guess there is no way to use record definitions as functions that would take all the required values of that record? Sort of like how you can create values of variants in haskell.
<letaris> sadly not
<letaris> there might be a preprocessor extension that can write the function for you
<Enjolras> there is ppx_deriving_make for instance
<letaris> If you have a lot of default values and you only need to override a few of them you could define an "empty" record and then use a functional update to override only the fields you want to change
<infinity0> is there a way to get ocaml to dump how it calls gcc somewhere?
<Enjolras> type foo = { bar: int; blah: float [@default 42.] } [@@deriving make]
<Enjolras> it will generate make_foo : bar:int -> ?blah:float -> unit -> foo
<Enjolras> (provided you installed ppx_deriving and use it in build system)
MercurialAlchemi has quit [Ping timeout: 250 seconds]
<infinity0> ah, -verbose
Denommus has joined #ocaml
zpe has quit [Remote host closed the connection]
mengu has quit []
chindy has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
noddy has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
orbifx-m has joined #ocaml
Simn has joined #ocaml
conrad4 has joined #ocaml
conrad4 has quit [Ping timeout: 256 seconds]
voglerr_ has joined #ocaml
voglerr has quit [Read error: Connection reset by peer]
govg has quit [Quit: leaving]
Denommus` has joined #ocaml
noddy has joined #ocaml
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Denommus has quit [Ping timeout: 260 seconds]
voglerr_ has quit [Remote host closed the connection]
jao has joined #ocaml
agarwal1975 has joined #ocaml
orbifx-m has quit [Ping timeout: 250 seconds]
chindy has quit [Ping timeout: 244 seconds]
al-damiri has joined #ocaml
voglerr_ has joined #ocaml
alfredo has quit [Quit: Textual IRC Client: www.textualapp.com]
AltGr has joined #ocaml
copy` has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
beginner_ has quit [Remote host closed the connection]
veggie_ has joined #ocaml
cross has joined #ocaml
jnavila has quit [Quit: It was time]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jwatzman|work has quit [Quit: jwatzman|work]
okuu has quit [Quit: Unyu~. Fix config.]
kakadu_ has quit [Quit: Konversation terminated!]
freusque has joined #ocaml
shakalaka has quit [Quit: bye.]
Guest26 has joined #ocaml
shakalaka has joined #ocaml
dhil has joined #ocaml
conrad4 has joined #ocaml
voglerr_ has quit [Remote host closed the connection]
voglerr has joined #ocaml
voglerr_ has joined #ocaml
voglerr has quit [Read error: Connection reset by peer]
Guest26 has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Guest26 has joined #ocaml
voglerr_ has quit [Ping timeout: 260 seconds]
voglerr has joined #ocaml
ggole has quit [Ping timeout: 260 seconds]
voglerr has quit [Ping timeout: 245 seconds]
dwillems has quit [Quit: Ex-Chat]
conrad4 has quit [Ping timeout: 260 seconds]
octachron has quit [Quit: Page closed]
AlexDenisov has joined #ocaml
shakalaka has quit [Remote host closed the connection]
shakalaka has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
voglerr has joined #ocaml
voglerr has quit [Ping timeout: 250 seconds]
Guest26 has quit [Quit: Textual IRC Client: www.textualapp.com]
freusque has quit [Quit: WeeChat 1.4]
freusque has joined #ocaml
freusque has quit [Remote host closed the connection]
petroav has joined #ocaml
struktured has quit [Ping timeout: 265 seconds]
shakalaka has quit [Quit: bye.]
shakalaka has joined #ocaml
chindy has joined #ocaml
yomimono has quit [Ping timeout: 256 seconds]
petroav has quit [Ping timeout: 260 seconds]
orbifx has joined #ocaml
chindy_ has joined #ocaml
shakalaka has quit [Quit: bye.]
shakalaka has joined #ocaml
th5 has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
noddy has quit [Ping timeout: 245 seconds]
pierpa has joined #ocaml
dhil has quit [Ping timeout: 250 seconds]
orbifx has quit [Ping timeout: 260 seconds]
<chindy> How can i get the type of an expression in utop ?
<theblatte> just entering the expression will evaluate + give you the type
dhil has joined #ocaml
<reynir> There's #typeof "foo", but I'm not sure how it works
<theblatte> the other day I wanted to display what a type was but failed
slash^ has joined #ocaml
<chindy> say i want the type of "+" ... it just says syntax error... oviously, but i want it to say val + : int -> int -> int
<Armael> write (+)
<chindy> ahh ... i'm retarded... haha thanks a lot
<chindy> okay so aparently for (**) it just shows nothing
<Armael> write ( ** ) :p
<Armael> (**) is in fact an empty comment
<chindy> haha
petroav has joined #ocaml
brunoro has joined #ocaml
noddy has joined #ocaml
<chindy> so assuming i override the operator ( ** ) with a fucntion composition, how can i force ocaml to use it for exponentiation again ?
<flux> chindy, well, there are two approaches
<Armael> you can use its full path explicitly, eg Pervasives.(a ** b)
<flux> chindy, you can either bind the original function to some other name and restore it afterwards: let exp = ( ** ) ... let ( ** ) = exp
<flux> or you can do what armael said (can also be used for rebinding the definition)
brunoro has quit [Ping timeout: 260 seconds]
<chindy> what is the "design decision" behind NOT letting people have polymorphic operators and Overloading while at the same time allowing people to Override Pervasives functions ?
Denommus` has quit [Ping timeout: 260 seconds]
<chindy> to me it seems like this decision combines the worst of both worlds.
_andre has quit [Quit: leaving]
TheLemonMan has joined #ocaml
<Drup> chindy: consider a language when you have overloading on +, what is the type of "let f x = x + x" ?
<Drup> overloading, as provided by most languages, doesn't work well with full inference. Some languages provide similar mechanisms via typeclasses, but that leads to other issues when you have a module system such as ocaml's (see !implicits )
<Drup> !implicits
<chindy> exit
<chindy> woops wrong window
<Drup> companion_cube: your boat is failing me
<Drup> bot*
brunoro has joined #ocaml
veggie_ has quit [Ping timeout: 244 seconds]
<chindy> @Drup, i see the problem... i just dont understand why one would include overriding Pervasive's operators... its so confusing when you look into some code base and someone overrode ( ** )
<companion_cube> apparently there is no rule for it
<companion_cube> I added one for multicore
<Drup> chindy: operators are just functions, there is no special rule for them
<flux> though I would agree it's bad taste to redefine them..
<flux> I mean it's ok for modules that aren't expected to be open'ed
<flux> ie. Int32.(of_int 4 ** of_int 3)
<Drup> chindy: it's very nice to be able to use a different meaning locally
djellemah_ has joined #ocaml
brunoro has quit [Ping timeout: 245 seconds]
<Drup> chindy: do you have an example of someone redefining it locally ?
<Drup> (in a manner that is confusing)
kakadu has joined #ocaml
<chindy> well I am currently reading through the book of John Harrison "Practical Logic" where he uses Ocaml and overrides ( ** ) as function composition
<chindy> if you assum ** : float -> float -> float this , "let cls’ = map (filter ((not) ** defined fn ** negate)) cls" is pretty confusing
petroav has quit [Ping timeout: 260 seconds]
octachron has joined #ocaml
<Drup> that's pretty terrible, honestly :/
veggie_ has joined #ocaml
dhil has quit [Ping timeout: 265 seconds]
orbifx has joined #ocaml
octachron has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
<octachron> Sometimes I miss unicode operators: wouldn't "∘" be nice for function composition?
slash^ has quit [Read error: Connection reset by peer]
orbifx has quit [Ping timeout: 256 seconds]
orbifx has joined #ocaml
<Drup> octachron: same here, but then I remember the few time I used haskell and agda, and I realize it's probably for the best.
<octachron> Drup, it is true that resisting to the temptation to use more and more operators would be hard
<reynir> I remember spending a lot of time figuring out how to enter various unicode characters when I first used agda
<octachron> ( or more exotic bracket/parenthesis (⟨bra|ket⟩ are nice after all) )
<bitbckt> this is kind of a fun middle ground: https://github.com/tonsky/FiraCode
<Drup> reynir: that's approximatly the time I discovered XCompose
<Armael> you can alternatively have support from your text editor to pretty-print stuff if you like that
<reynir> Hmmm
<Armael> I guess that's what some people do in coq, with company-coq
brunoro has joined #ocaml
<bitbckt> ligatures maintain spacing, where editor support may not.
struktured has joined #ocaml
yomimono has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
Willem has joined #ocaml
Willem has quit [Client Quit]
<Drup> bitbckt: unsurprisingly, none of my tools work with this :p
<bitbckt> :)
octachron has quit [Read error: Connection reset by peer]
veggie_ has quit [Ping timeout: 265 seconds]
bacam has quit [Quit: reboot]
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
orbifx1 has joined #ocaml
orbifx has quit [Ping timeout: 260 seconds]
bacam has joined #ocaml
<orbifx1> I suppose partial application doesn't mean that a function gets partially evaluated too?
Algebr has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
octachron has joined #ocaml
brunoro has joined #ocaml
veggie_ has joined #ocaml
<flux> orbifx1, well, it can mean, but I suppose most of the time it's not really apparent to the user if that's happening on the background..
brunoro has quit [Ping timeout: 250 seconds]
<flux> orbifx1, for example: let hashify h = function f -> .. can be called hashify (Hashtbl.create 42) to "partially evaluate" it, or if can be callde hashify (..) cos to "completely" evaluate it
jao has quit [Remote host closed the connection]
octachron has quit [Read error: Connection reset by peer]
Algebr has quit [Remote host closed the connection]
veggie_ has quit [Read error: Connection reset by peer]
veggie_ has joined #ocaml
brunoro has joined #ocaml
soupault has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
madroach has quit [Ping timeout: 252 seconds]
madroach has joined #ocaml
soupault has quit [Remote host closed the connection]
jao has joined #ocaml
djellemah_ has quit [Ping timeout: 244 seconds]
soupault has joined #ocaml
<orbifx1> flux: will it even do it automatically, because of compilation optimisation?
<orbifx1> also are there any modules for handling email strings? (just validating them etc)
nomicflux has joined #ocaml
AltGr has left #ocaml [#ocaml]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
noddy has quit [Ping timeout: 260 seconds]
struktured has quit [Ping timeout: 256 seconds]
chindy has quit [Remote host closed the connection]
th5 has quit []
jao has quit [Remote host closed the connection]
petroav has joined #ocaml
sh0t has quit [Quit: Leaving]
noddy has joined #ocaml
soupault has quit [Ping timeout: 245 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
julian__ has joined #ocaml
<companion_cube> anyone tried to combine mrelin and youcompleteme?
<companion_cube> seems like the second ignores the first
chindy_ has quit [Ping timeout: 252 seconds]
jao has joined #ocaml
brunoro has joined #ocaml
Sorella has quit [Quit: Updating details, brb]
Sorella has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
<orbifx1> yomimono: not full email message parsing, just the address
<yomimono> sorry, that's all I got :(
<yomimono> (although I'm surprised the address parsing isn't easily separable)
cakeplus has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Simn has quit [Quit: Leaving]
<orbifx1> I think I probably just need to use uri
ygrek has joined #ocaml
letaris has quit [Quit: Leaving]
yomimono has quit [Ping timeout: 244 seconds]
agarwal1975 has quit [Quit: agarwal1975]
brunoro has joined #ocaml
orbifx1 has quit [Ping timeout: 256 seconds]
benmachine has quit [Remote host closed the connection]
brunoro has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 252 seconds]
<petroav> Hey everyone! If I have a (char * int) list, can I replace the int component of a particular tuple in that list? If so how can I do that?
ygrek has quit [Ping timeout: 260 seconds]
<Bluddy[m]> petroav: How are you identifying the particular tuple? By the char?
<petroav> yes
<Bluddy[m]> let replace search_char new_int my_list = List.map (fun (x,y) -> if x = search_char then (x, new_int) else (x,y)) my_list
<petroav> I see. So there's no way to do it in place? You're essentially reconstructing the list, right?
artart78 has quit [Ping timeout: 268 seconds]
kakadu has quit [Remote host closed the connection]
julian__ has quit [Ping timeout: 245 seconds]
<Bluddy[m]> that's what functional programming is about. You create new data. List isn't mutable, and each member points to the next (immutably), so there's no way to go in and change only one member. Of course, it's OCaml, so you have the option of making an (char * int ref) list
<Bluddy[m]> In this case, you can iterate through the list, and change the integer when you get to the right point
<Bluddy[m]> But this is less idiomatic
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 250 seconds]
<petroav> Bluddy[m], got it, great answer! This is my first experience with functional programming so I'm afraid my brain has been poisoned with mutable state so that's the first thing I think of.
groovy2shoes has quit [Quit: Leaving]
nomicflux has quit [Quit: nomicflux]