flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.03.0 announced 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
keteim has quit [Ping timeout: 264 seconds]
keteim has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amnn has joined #ocaml
amnn has quit [Client Quit]
<zRecursive> Is there any body running npam on Windows ?
connorjacobsen has joined #ocaml
jimt is now known as Jim7J1AJH
devol_ has joined #ocaml
devol has quit [Ping timeout: 250 seconds]
mistermetaphor has joined #ocaml
connorjacobsen has quit [Remote host closed the connection]
mistermetaphor has quit [Ping timeout: 264 seconds]
cnu- has joined #ocaml
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
walter|r has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
d0nn1e has quit [Ping timeout: 276 seconds]
d0nn1e has joined #ocaml
jonasen has joined #ocaml
scarygelatin has quit [Quit: Leaving]
connorjacobsen has joined #ocaml
walter|r has joined #ocaml
connorjacobsen has quit [Remote host closed the connection]
pyon has quit [Ping timeout: 240 seconds]
walter|r has quit [Ping timeout: 276 seconds]
Bahman has joined #ocaml
yunxing has joined #ocaml
Jim7J1AJH is now known as jimt
yunxing has quit [Quit: Leaving...]
fluter has quit [Quit: WeeChat 1.2]
zRecursi` has joined #ocaml
zRecursive has quit [Ping timeout: 258 seconds]
FreeBirdLjj has quit [Ping timeout: 276 seconds]
FreeBirdLjj has joined #ocaml
artart78 has quit [Read error: Connection reset by peer]
artart78 has joined #ocaml
artart78 has joined #ocaml
artart78 has quit [Changing host]
pyon has joined #ocaml
sh0t has quit [Ping timeout: 250 seconds]
pyon has quit [Remote host closed the connection]
johnelse has quit [Ping timeout: 244 seconds]
johnelse has joined #ocaml
walter|r has joined #ocaml
pierpa has quit [Ping timeout: 240 seconds]
walter|r has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
Bahman has quit [Quit: ave atque vale]
FreeBirdLjj has joined #ocaml
Bahman has joined #ocaml
MercurialAlchemi has joined #ocaml
fluter has joined #ocaml
manizzle has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
walter|r has joined #ocaml
walter|r has quit [Ping timeout: 272 seconds]
jonasen has joined #ocaml
tmtwd has joined #ocaml
A1977494 has joined #ocaml
unbalancedparen has quit [Quit: WeeChat 1.5]
tmtwd has quit [Ping timeout: 258 seconds]
Algebr has quit [Ping timeout: 260 seconds]
Mercuria1Alchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
walter|r has joined #ocaml
rgrinberg has quit [Ping timeout: 244 seconds]
walter|r has quit [Ping timeout: 276 seconds]
copy` has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
AlexRussia has quit [Ping timeout: 260 seconds]
kdas__ has joined #ocaml
ygrek has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
lewis1711 has joined #ocaml
FreeBirdLjj has joined #ocaml
<lewis1711> why is the type of ("hello") bytes, but the type of (String.to_list "hello") char list? is there even such a thing as a plain "byte"?
struk|desk has quit [Remote host closed the connection]
redpoppies has joined #ocaml
struk|desk has joined #ocaml
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 250 seconds]
groovy2shoes has quit [Remote host closed the connection]
groovy2shoes has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
MercurialAlchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
walter|r has joined #ocaml
walter|r has quit [Ping timeout: 276 seconds]
<flux> lewis1711, no
<flux> lewis1711, the eventual goal is to make string an immutable object
<flux> lewis1711, whereas bytes would be a mutable buffer
<flux> lewis1711, both are still a bag of bytes/chars, though
<lewis1711> flux, right. I guess I am more confused about the byte/char thing
<lewis1711> I'd expect to_list to return a byte list
<lewis1711> but I kind of get the nomenclature
orbifx has joined #ocaml
<companion_cube> `char` is mostly equivalent to a byte
<flux> mostly as in exactly?-o
<flux> or do you refer to platforms that don't have 8-bit bytes :)
<toolslive> I know there are platforms that have 16 bit chars, but a byte is an 8-bit value by definition, no ?
orbifx2 has quit [Ping timeout: 260 seconds]
<lewis1711> there are platforms with 7 bit bytes IIRC
<lewis1711> the pedantic term is "octet"
<companion_cube> I'm not sure of the details; after all, there is no standard
<companion_cube> but in practice it's at least an ascii char, so at least 7 bits
kdas__ has quit [Quit: Leaving]
AltGr has joined #ocaml
<lewis1711> companion_cube, well according to the docs for the Char module " Return the character with the given ASCII code. Raise Invalid_argument "Char.chr" if the argument is outside the range 0--255."
<lewis1711> for the function chr
<companion_cube> yeah
<lewis1711> so it's a pretty safe bet they are 8-bit unsigned bytes
<companion_cube> the implementation uses a full word, though
<companion_cube> but semantically it's 8 bits indeed
connorjacobsen has joined #ocaml
Bahman has quit [Quit: ave atque vale]
connorjacobsen has quit [Ping timeout: 260 seconds]
Simn has joined #ocaml
octachron has joined #ocaml
MercurialAlchemi has joined #ocaml
Algebr has joined #ocaml
octachron has quit [Ping timeout: 250 seconds]
Algebr has quit [Ping timeout: 258 seconds]
MercurialAlchemi has quit [Ping timeout: 258 seconds]
octachron has joined #ocaml
wolfcore has quit [Ping timeout: 244 seconds]
walter|r has joined #ocaml
ril has joined #ocaml
walter|r has quit [Ping timeout: 240 seconds]
wolfcore has joined #ocaml
loky has joined #ocaml
ril has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wolfcore has quit [Ping timeout: 276 seconds]
pyon has joined #ocaml
wolfcore has joined #ocaml
jonasen has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
Algebr has joined #ocaml
jwatzman|work has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
<Leonidas> lewis1711: this text is very confusing. what is the ascii code for, let's pick something between 0--255, say 200?
walter|r has joined #ocaml
larhat has joined #ocaml
<flux> it's the ascii code 200, obviously :)
walter|r has quit [Ping timeout: 240 seconds]
lewis1711 has quit [Quit: Ex-Chat]
<reynir> strctly speaking, 200 is outside the ascii range
jonasen has joined #ocaml
zRecursi` has quit [Remote host closed the connection]
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
<toolslive> in java, a byte is signed iirc
<companion_cube> Leonidas: it used to be latin1
<Leonidas> toolslive: java does not have unsigned types, so, uhm, well.
<toolslive> signed objects ?
<reynir> Uh, I think java's char is unsigned.
dexterph has joined #ocaml
<reynir> (int)(char) -1 → 65535
Algebr has joined #ocaml
amnn has joined #ocaml
Algebr has quit [Ping timeout: 264 seconds]
jbrown has quit [Quit: Leaving]
dhil has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
walter|r has joined #ocaml
FreeBirdLjj has joined #ocaml
jbrown has joined #ocaml
walter|r has quit [Ping timeout: 258 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
<flux> chars aren't numbers to begin with, does speaking of sign make sense?
FreeBirdLjj has joined #ocaml
<companion_cube> they are in C
<toolslive> yes, but making chars numbers was a design mistake.
<flux> but they are integers
<flux> in C
<flux> they are just called 'characters'
<companion_cube> toolslive: like not having booleans
<companion_cube> but that's life
<toolslive> like variable width integers. and a single resource type (fd) for all IO things.... Let's not go into C's design mistakes.
<companion_cube> this ship sailed 45 years ago
<toolslive> So ?
loky has quit [Read error: Connection reset by peer]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
loky has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Algebr has joined #ocaml
Algebr is now known as Guest11892
Guest11892 has quit [Ping timeout: 276 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Orion3k has quit [Ping timeout: 244 seconds]
walter|r has joined #ocaml
AlexRussia has joined #ocaml
AltGr has left #ocaml [#ocaml]
walter|r has quit [Ping timeout: 272 seconds]
sdothum has joined #ocaml
sepp2k has joined #ocaml
Orion3k has joined #ocaml
loky has quit [Ping timeout: 252 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
redpoppies has quit [Ping timeout: 276 seconds]
Algebr has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
walter|r has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
sepp2k has quit [Quit: Leaving.]
walter|r has quit [Ping timeout: 276 seconds]
dsheets has quit [Remote host closed the connection]
dhil has quit [Ping timeout: 240 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jwatzman|work has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jonasen has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
dsheets has joined #ocaml
FreeBirdLjj has joined #ocaml
Algebr has joined #ocaml
AlexRussia has quit [Quit: WeeChat 1.4-dev]
Algebr has quit [Ping timeout: 260 seconds]
beginner has joined #ocaml
<beginner> is it possible to have a ordering of types in ocaml, like a < b < c for types?
<mrvn> objects have inheritance and polymorphic variants are partially ordered
<flux> beginner, what is the end goal? I don't think types can be compared at all, or at least no runtime or compile time decisions can be made upon that information.
<beginner> to encode on the type level the constraint that a function returns the largest, in sense of the ordering type of the input types
<Drup> beginner: what are the types ?
<Drup> (on which you want an ordering)
<beginner> could be a phantom type
<flux> ocaml isn't that hot on type-level evaluation ;-)
<Drup> beginner: polymorphic variants are often used like that
<beginner> is this constraint keyword of any use? Have never used it
walter|r has joined #ocaml
<beginner> Drup: could you elaborate that a bit
<mrvn> beginner: not for what you think I think. :)
<mrvn> you can't write constraint 'a <= b
<Drup> mrvn: sure you can, with polymorphic variants
<Drup> I'm trying to see if I have a simple example of phantom poly var around
<mrvn> Drup: see above
<beginner> mrvn: do you use constraint in your code? and for what, if i might ask
<Drup> beginner: there is a very simple example in companion_cube's CCVector module
walter|r has quit [Ping timeout: 246 seconds]
<companion_cube> \o/
<Drup> hum, actually, it doesn't use ordering
<Drup> nevermind
<Drup> companion_cube: do you have another one ?
<companion_cube> what ordering would I use?
<Drup> I mean, there is tyxml, sure, but it's not a pedagogic example
<companion_cube> oh you mean a subtyping constraint? oO
<Drup> yes
<companion_cube> oh dear
<Drup> beginner: if you want full blown examples, js_of_ocaml and tyxml
<Drup> but they are really really big
<beginner> is there some minimal example, to show the idea?
Simn has quit [Ping timeout: 260 seconds]
<Drup> I'm trying to find one
<beginner> thank you
sepp2k has joined #ocaml
<zozozo> does this count as using subtyping : https://github.com/Gbury/ocaml-cgroups/blob/master/util/converter.mli ?
<zozozo> Drup: ^
<Drup> ah, yes, that's an example
<zozozo> simple enough I hope
<Drup> that's exactly the kind of things I was looking for
<zozozo> beginner: cf my link
<beginner> thanks
pierpa has joined #ocaml
<companion_cube> oh, it's just the constraint on the type?
jwatzman|work has quit [Quit: jwatzman|work]
dsheets has quit [Remote host closed the connection]
jwatzman|work has joined #ocaml
rgrinberg has joined #ocaml
dsheets_ has joined #ocaml
unbalancedparen has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ski__ has joined #ocaml
cannedprimates has joined #ocaml
Algebr has joined #ocaml
AltGr has joined #ocaml
Algebr has quit [Ping timeout: 244 seconds]
ygrek has quit [Ping timeout: 244 seconds]
ski has quit [Quit: leaving]
ski__ is now known as ski
ygrek has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
sh0t has joined #ocaml
walter|r has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
dhil has joined #ocaml
ygrek has quit [Remote host closed the connection]
walter|r has quit [Ping timeout: 240 seconds]
jonasen has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
copy` has joined #ocaml
MercurialAlchemi has joined #ocaml
FreeBird_ has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
Algebr has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
Algebr has quit [Ping timeout: 272 seconds]
Algebr has joined #ocaml
<cr4ven> Hi guys. I was wondering if I could get some assistance with a type issue in a small script. http://pastebin.com/t6ieeN6h <- I can't figure out why a string type is expected as a return value for the fold function. The accumulator is an int, get_change returns an int, and (+) takes two ints and returns an int.
redpoppies has joined #ocaml
<cr4ven> I presume I'm missing something silly, but assistance would be appreciated! (I'm aware there's a missing argument to the printf on line 18 btw. It got cut off when pasting.)
<srax> hum
<srax> fold in Enum.fold take the elelement then acc
<srax> you should reverse them
<srax> (fun acc line -> acc + get_change (explode line))
<srax> -> (fun line acc -> acc + get_change (explode line))
Algebr has quit [Ping timeout: 258 seconds]
<cr4ven> fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
<srax> your code seem to use exlitb, you should read the doc of extlib
<cr4ven> Ah, right, thx. When I googled 'ocaml extlib enum' the ocamlcore.org link was the first documentation result
<flux> though batteries' docs are probably pretty close.. except for module names, new functions, etc :-)
<flux> batteries is basically a successor to extlib
ygrek has quit [Ping timeout: 244 seconds]
Algebr has joined #ocaml
<cr4ven> And they reverse the arguments to the fold function's f argument?! Is there a logic for that?
<flux> in fact, there is! left and right fold have different order of arguments reflecting how the data is built.
<flux> whether it was a good choice is another matter :) (I don't mind)
<cr4ven> Fair enough =)
<flux> iirc jane street core chose to go with perhaps more consistent parameter ordering
<companion_cube> they chose to use labels, rather
<toolslive> List.fold_left => acc is on the left
Algebr has quit [Ping timeout: 244 seconds]
bba has joined #ocaml
lokien has quit [Ping timeout: 250 seconds]
tane has joined #ocaml
Algebr has joined #ocaml
Algebr` has joined #ocaml
walter|r has joined #ocaml
Algebr has quit [Ping timeout: 264 seconds]
Algebr` has quit [Ping timeout: 252 seconds]
walter|r has quit [Ping timeout: 260 seconds]
mistermetaphor has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dexterph has quit [Ping timeout: 250 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Sorella has quit [Quit: Connection closed for inactivity]
pyon has quit [Ping timeout: 244 seconds]
struktured has joined #ocaml
ygrek has joined #ocaml
rgrinberg has quit [Ping timeout: 244 seconds]
lokien has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
dakk has quit [Ping timeout: 252 seconds]
Algebr` has joined #ocaml
mistermetaphor has joined #ocaml
mistermetaphor has quit [Remote host closed the connection]
pyon has joined #ocaml
mistermetaphor has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
bba has joined #ocaml
redpoppies has quit [Quit: redpoppies]
sfcgeorge has joined #ocaml
rgrinberg has joined #ocaml
sfcgeorge has left #ocaml [#ocaml]
struktured has quit [Ping timeout: 260 seconds]
loky has joined #ocaml
loky has left #ocaml [#ocaml]
loky has joined #ocaml
sh0t has quit [Quit: Leaving]
slash^ has joined #ocaml
loky has quit [Read error: Connection reset by peer]
walter|r has joined #ocaml
dsheets_ has quit [Remote host closed the connection]
misterme_ has joined #ocaml
dsheets has joined #ocaml
walter|r has quit [Ping timeout: 244 seconds]
mistermetaphor has quit [Ping timeout: 246 seconds]
sh0t has joined #ocaml
douglascorrea has joined #ocaml
loky has joined #ocaml
octachron has quit [Quit: Page closed]
dhil has joined #ocaml
struktured has joined #ocaml
jave has quit [Ping timeout: 246 seconds]
mistermetaphor has joined #ocaml
misterme_ has quit [Ping timeout: 240 seconds]
jave has joined #ocaml
shinnya has joined #ocaml
struktured has quit [Ping timeout: 244 seconds]
Algebr` has quit [Ping timeout: 276 seconds]
Sorella has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
larhat has quit [Quit: Leaving.]
dhil has quit [Ping timeout: 244 seconds]
walter|r has joined #ocaml
orbifx-m has joined #ocaml
orbifx has quit [Read error: Connection reset by peer]
orbifx2 has joined #ocaml
orbifx has joined #ocaml
dsheets has quit [Remote host closed the connection]
walter|r has quit [Ping timeout: 240 seconds]
orbifx-m has quit [Ping timeout: 258 seconds]
orbifx2 has quit [Ping timeout: 252 seconds]
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
misterme_ has joined #ocaml
Simn has joined #ocaml
mistermetaphor has quit [Ping timeout: 260 seconds]
bba has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
octachron has joined #ocaml
loky has quit [Quit: loky]
connorjacobsen has joined #ocaml
sh0t has quit [Quit: Leaving]
Algebr`` has quit [Remote host closed the connection]
lokien has quit [Ping timeout: 260 seconds]
struktured has joined #ocaml
mattrepl has quit [Quit: ZNC - http://znc.in]
AltGr has left #ocaml [#ocaml]
d0nn1e has quit [Ping timeout: 244 seconds]
jonasen has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
d0nn1e has joined #ocaml
dsheets has quit [Read error: Connection reset by peer]
dsheets has joined #ocaml
struktured has quit [Ping timeout: 246 seconds]
dsheets has quit [Ping timeout: 276 seconds]
walter|r has joined #ocaml
lokien has joined #ocaml
Algebr has joined #ocaml
walter|r has quit [Ping timeout: 244 seconds]
bba has joined #ocaml
acieroid` has quit [Quit: Bye.]
dsheets has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
seangrove has joined #ocaml
TheLemonMan has joined #ocaml
lokien has quit [Ping timeout: 272 seconds]
toolslive has quit [Ping timeout: 264 seconds]
octachron has quit [Ping timeout: 240 seconds]
bba has joined #ocaml
walter|r has joined #ocaml
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ocaml
connorjacobsen has quit [Remote host closed the connection]
walter|r has quit [Ping timeout: 276 seconds]
octachron has joined #ocaml
connorjacobsen has joined #ocaml
k1000 has quit [Ping timeout: 244 seconds]
orbifx1 has joined #ocaml
k1000 has joined #ocaml
connorja_ has joined #ocaml
connorjacobsen has quit [Ping timeout: 260 seconds]
slash^ has quit [Read error: Connection reset by peer]
sepp2k has quit [Quit: Leaving.]
connorja_ has quit [Ping timeout: 244 seconds]
lokien has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Kakadu has joined #ocaml
octachron has quit [Ping timeout: 272 seconds]
dsheets has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 244 seconds]
dsheets_ has joined #ocaml
|meta has joined #ocaml
redpoppies has joined #ocaml
VeiledSpectre has joined #ocaml
octachron has joined #ocaml
dsheets_ has quit [Remote host closed the connection]
octachron has quit [Ping timeout: 264 seconds]
pyon has quit [Ping timeout: 244 seconds]
walter|r has joined #ocaml
AlexRussia has joined #ocaml
dsheets has joined #ocaml
walter|r has quit [Ping timeout: 258 seconds]
connorja_ has joined #ocaml
octachron has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
dsheets has joined #ocaml
dsheets has quit [Remote host closed the connection]
<orbifx1> do you put a space between your semicolon for specifying types?
<orbifx1> foo : bar; (* or *) foo: bar;
<orbifx1> ?
<mrvn> yes
<mrvn> and you mean colon, not semicolon
<mrvn> also: Do you align all the :?
MercurialAlchemi has quit [Ping timeout: 258 seconds]
<mrvn> buzz : int;
<pippijn> I do, usually
<companion_cube> orbifx1: generally not
<mrvn> bar : int;
rgrinberg has quit [Ping timeout: 276 seconds]
<companion_cube> aligning is annoying, also
<orbifx1> mrvn: yes, colon
<pippijn> I find it more readable
<mrvn> "foo: bar" looks like a lable in C
<companion_cube> it makes every change more annoying
<orbifx1> mrvn: up until now I didn't break, but now I'm reconsidering for the label point you mention.
<pippijn> disadvantage: changes that add/remove a field may cause a larger than necessary change in version control
AltGr has joined #ocaml
<pippijn> companion_cube: have it done automatically and it becomes a lot less annoying
<pippijn> but the VCS disadvantage is still there
<pippijn> though git can do diff ignoring whitespace changes
<mrvn> pippijn: do you shrink when you remove or only grow when you add?
<orbifx1> companion_cube: actually it's handing for block changes in Vim
<orbifx1> but that is minor
<pippijn> mrvn: I tend to line up on tabulator intervals
<orbifx1> Are there any proposed styles out there? by some organisation or group on this?
<mrvn> pippijn: have the editor automatically align. no need to do that in the source. Also means you can use a proportional font
<pippijn> so I'll shrink if there are >8 spaces in the smallest gap
Ravana has quit [Ping timeout: 240 seconds]
<companion_cube> pippijn: I'm not sure how to do it automatically
<pippijn> in my haskell code, I shrink always
<companion_cube> but I moved away from this anyway, doesn't bring much benefit
<pippijn> companion_cube: I don't know either, for haskell there is a tool that does it, so I'm happy to keep it doing that
<zozozo> orbifx1: ocamlpro is working on an ocaml linter from what I hear
<mrvn> zozozo: what's there to lint?
<orbifx1> zozozo: what are they doing on this? spaces or no spaces?
<pippijn> in general, I don't find myself adding or removing fields that often, so the pain is small
<zozozo> orbifx1: don't know
<companion_cube> well I do modify records a lot
<Khady> Crytposense and jst have linters too
<orbifx1> What I'm seeing in the ocaml source, they use spaces
<mrvn> In multi line lists or arrays do you have a ; after the last element so adding more will not change that line again?
<orbifx1> So when in doubt.. follow others :P
<zozozo> mrvn: well, for instance prefere begin/end for if/then/else blocks rather than parentheses, ensure parentheses around boolean combinaisons (i.e to not rely solely on priorities)
<pippijn> almost never removing fields, and when I add fields, it's rare for the new one to have a longer name than all other fields
<companion_cube> zozozo: yay, won't use the linter
dsheets_ has joined #ocaml
<pippijn> yeah, that sounds like the kind of linter I wouldn't use
Ravana has joined #ocaml
<companion_cube> mrvn: I like to put the ; at the beginning of the line
<pippijn> the haskell linter actually warns against superfluous ()
<companion_cube> [ foo
<companion_cube> ; bar
<companion_cube> ]
<orbifx1> companion_cube: man :P
<companion_cube> it's pretty neat, really
<pippijn> companion_cube: I do that in haskell, not in ocaml
<mrvn> companion_cube: hmm
<pippijn> because in ocaml there is a clear disadvantage to doing that
<Drup> companion_cube: it's slighly revolting
<companion_cube> really? why?
<pippijn> and an advantage to putting the ; at the end
<orbifx1> it's neat.. the same way it's neat organising all your pencils in alphabetical order :P
Anarchos has joined #ocaml
<zozozo> companion_cube: well, actually, you'll be able to choose which rules to apply with the linter, so you could juste keep the ones you like
<pippijn> the reason is that you're allowed to put a ; at the end of a list, which in haskell is not allowed
VeiledSpectre has quit [Quit: Leaving]
<companion_cube> come on, you align `:` but refuse to use this simpler kind of alignment?
<mrvn> pippijn: how is it at the begining a drawback?
<pippijn> companion_cube: it's impractical
<pippijn> mrvn: [ foo
<pippijn> mrvn: ; bar
<pippijn> mrvn: ]
<pippijn> swap foo and bar
<companion_cube> I don't get why it's impractical
<pippijn> or:
<Drup> companion_cube: I don't align :D
<pippijn> mrvn: [
<pippijn> mrvn: foo;
<pippijn> mrvn: bar;
<pippijn> mrvn: ]
<mrvn> pippijn: ok, point to you
<pippijn> swap foo nad bar
<companion_cube> pippijn: so it happens I change records more often than I swap list elements :p
orbifx has quit [Quit: AtomicIRC: The nuclear option.]
<pippijn> companion_cube: it doesn't make sense to do the former if the latter is possible
<companion_cube> (but ok, point taken, I had forgotten you could have extra ; in lists)
<companion_cube> the latter wastes one line more though :/
orbifx-m has joined #ocaml
<companion_cube> (apart from that, since we're bikeshedding, I love ( ) for if blocks)
<mrvn> companion_cube: it's multi line (which usualy means 5+ for me) so who cares?
<orbifx1> i kinda like that too
<pippijn> the latter allows a simple sort to sort elements of a sorted list literal
<companion_cube> for me it starts at 2 lines
<companion_cube> sorting a list literal oO
<pippijn> the former requires sort to be aware that [ and ; don't contribute to sortedness
<mrvn> companion_cube: ) else ( ?
<companion_cube> mrvn: yep
<orbifx1> on a more sever level: is there a convention for using if-blocks when dealing with Option?
<companion_cube> my eyes don't find begin/end as visible
<mrvn> doesn't that align the ) with the position of the (?
<orbifx1> os it just better to use pattern matching?
<companion_cube> matching
orbifx1 is now known as orbifx
<mrvn> orbifx1: if foo == None then?
<companion_cube> mrvn: what do you mean?
<pippijn> if foo == None is ok
<companion_cube> if foo then (
<companion_cube> bar
<companion_cube> ) else (
<companion_cube> whatever
<companion_cube> )
<orbifx> ok but you can't condition check on the Some case?
<pippijn> correct
<pippijn> well, you could
<pippijn> but if foo == Some bar is not ok
<companion_cube> you should use = anyway
<pippijn> ok
<pippijn> if foo = Some bar is not ok
<mrvn> companion_cube: I feared the ) would get extra indent
<companion_cube> it's ok, but I find it very rarely useful
<companion_cube> mrvn: oh, hmm, I think it's ok
<orbifx> you condition change with if foo = Some _ ?
<mrvn> companion_cube: but no, tuareg mode indents to the begining of the line that had the (
<pippijn> orbifx: that is not a thing
<orbifx> ok :P
<pippijn> pattern != expression
<companion_cube> mrvn: use ocp-indent, is all I can say
<Drup> companion_cube: it doesn't, you can start with [ foo
<Drup> (because ocp-indent does the correct things and aligns properly)
<orbifx> I'right matching it is then
<mrvn> Drup: tuarge too in this case
<Drup> mrvn: but companion_cube doesn't use tuareg :3
<companion_cube> how strange, really
<Khady> is it possible to configure this in ocp-indent?
<Drup> Khady: pretty sure yes
<companion_cube> ocp-indent is pretty great
<Drup> yep
<Khady> I don't remember the list of options, I try to keep the default as much as possible
<companion_cube> there are only a few things I still don't like
<mrvn> how do I activate ocp-indent for emacs?
<companion_cube> the only one I can think of right now is: begin try ... with ... end
<Drup> mrvn: you read the manual :D
<zozozo> companion_cube: begin match ... | exception _ -> ... end ?
<companion_cube> zozozo: -_-
<companion_cube> you know I still want to support older versions
<companion_cube> match | exception is not yet in my vocabulary
<mrvn> Drup: no mention of emacs in the manpage
<zozozo> :(
<orbifx> do records consume more space then a tuple for the same structure?
<zozozo> I find it so useful
<zozozo> orbifx: don't think so
<Drup> orbifx: the same
<Drup> well, not exactly
dsheets_ has quit [Remote host closed the connection]
<Drup> records of floats are more compact than tuples of floats
<Drup> for the rest: exactly the same
<companion_cube> zozozo: I know...
<orbifx> Drup: ok thanks
<mrvn> I did (load-file "/usr/share/emacs/site-lisp/ocp-indent.el") but there is no ocp-mode. Wasn't ocp-indent supposed to replace tuaregmode?
seangrove has quit [Ping timeout: 252 seconds]
<Drup> mrvn: no
<Khady> there is a better way to do it to support opam switches
<Drup> which can be summarized by "opam install user-setup" :D
pyon has joined #ocaml
<Khady> I'm sacred by this tool
dsheets has joined #ocaml
seangrove has joined #ocaml
dsheets has quit [Ping timeout: 246 seconds]
walter|r has joined #ocaml
<orbifx> What was the verdict on if blocks with multiple expressions? () or begin .. end?
dsheets has joined #ocaml
_y has quit [Ping timeout: 250 seconds]
tobiasBora has quit [Ping timeout: 250 seconds]
walter|r has quit [Ping timeout: 264 seconds]
pyon has quit [Ping timeout: 244 seconds]
<Drup> the verdict is that it sucks either way
<Drup> :D
<AltGr> mrvn; the easiest way is to install opam package "user-setup"
<AltGr> (`opam user-setup install` (yes, in that order))
<AltGr> Khady: not a typo, the first character is a special emacs code IIRC. Yummy API
<orbifx> I'll look at what the creators chose
<Khady> AltGr: awesome
Orion3k has quit [Ping timeout: 252 seconds]
<AltGr> Don't be scared, it is reversible and will clearly delimit and track the changes it makes to your files
<RomanZ5> hello, i am trying to create a function that given a stream of characters, it aggregates them into lines (so looks for "\n" to seperate into lines). this is the function http://sprunge.us/VcCh and i am getting the error Error: This expression has type string list -> string option but an expression was expected of type int -> 'a option Type string list is not compatible with type int. could anyone help me see where i've gone wrong
pyon has joined #ocaml
AltGr has left #ocaml [#ocaml]
<RomanZ5> i was using the Stream.from example on https://ocaml.org/learn/tutorials/streams.html as a model and it has Stream.from (next []) as the final statement (expression?) for their function
<Drup> RomanZ5: " | Some "", [] ->" <- the second element in the match is supposed to be an int
<Drup> well, that, or the call to List.rev is wrong
tobiasBora has joined #ocaml
<orbifx> is a record a kind of set?
<orbifx> a subset of sets :P
<orbifx> ?
yunxing_ has joined #ocaml
_y has joined #ocaml
<RomanZ5> Drup: it was the List.rev call, i was meant to List.rev chars not n
<RomanZ5> thanks
RomanZ5 has quit [Changing host]
RomanZ5 has joined #ocaml
redpoppies has quit [Ping timeout: 240 seconds]
Orion3k has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
dsheets_ has joined #ocaml
dsheets__ has joined #ocaml
ygrek has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
dsheets_ has quit [Ping timeout: 276 seconds]
dsheets__ has quit [Ping timeout: 276 seconds]
dakk has joined #ocaml
yunxing_ has quit [Remote host closed the connection]
yunxing_ has joined #ocaml
amnn has joined #ocaml
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
<orbifx> is there an issue if two records have matching field names, if the respective types are matching too?
<Anarchos> how to get rid of "module G" in this signature : http://pastebin.com/U1sRDqZ1
<octachron> orbifx, you may need to disambiguate between the two records more often
<orbifx> octachron: but will this ambigiouty cause any harm in every case? Or is it ok to use them interchangably when their types are the same?
enquora has joined #ocaml
yunxing__ has joined #ocaml
yunxing_ has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 272 seconds]
<octachron> orbifx, type t = { x: unit} and type w = { x: unit} are completely different types
<orbifx> but the compiler won't complain?
groovy2shoes has quit [Ping timeout: 258 seconds]
<orbifx> I understand the risk, I want to understand if the compiler freaks out about it
<orbifx> as it should
walter|r has joined #ocaml
groovy2shoes has joined #ocaml
<octachron> Why should it freak out? Note that there is a series of associated warnings
enquora has quit [Remote host closed the connection]
<RomanZ5> is there a function to turn a list of chars into a string, or must i make one
<struk|desk> RomanZ5: Core.Std.String.of_char_list , but that requires core of course
walter|r has quit [Ping timeout: 246 seconds]
<orbifx> octachron: because given that the types are different, some foot shooting might be happening?
<orbifx> if anyone is in the mood, I'd appreciate some critique on tokenauth: https://github.com/orbifx/tokenauth
<orbifx> I'm trying to make it secure by typing the value of operations.
A19774941 has joined #ocaml
<orbifx> but even style or performance advice would be appreciated
tane has quit [Quit: Verlassend]
benwbooth has joined #ocaml
A1977494 has quit [Ping timeout: 260 seconds]
<RomanZ5> struk|desk: would core not be included ordinarily
<pierpa> why you use Random.self_init in that position?
<pierpa> RomanZ5: core is a library separate from the main ocaml distribution
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
<RomanZ5> oh ok
dsheets has joined #ocaml
<RomanZ5> it should be easy enough to write a function to do that anyway
<pierpa> yes
<octachron> orbifx, it could, but at worse the wrong type could be inferred which would only lead to unexpected type errors.
<orbifx> pierpa: to seed the rand generator?
<pierpa> but the point where you do it is wrong
<pierpa> it's not a library business to globally reinitialize the RNG
<orbifx> should it happen once outside the library? or once inside the library?
<pierpa> should happen once. Usually at the very beginning of the program execution
<companion_cube> in a library, it's best to parametrize by a Random.State.t if you can
<octachron> outside the library, you cannot really produce entropy from inside a library
<orbifx> ok thanks pierpa & companion_cube. I will make an issue cause I'm done for the day
<pierpa> :]
<orbifx> done my day's pomodori :P
rgrinberg has joined #ocaml
dsheets has quit [Remote host closed the connection]
lokien has quit [Ping timeout: 272 seconds]
gildor has joined #ocaml
destrius has quit [Remote host closed the connection]
orbifx has quit [Ping timeout: 246 seconds]
<gildor> any merlin experts here ?
<companion_cube> not really, but ask
<companion_cube> o/ gildor
<gildor> I got the following error: 'Error: Unbound value .[]'
<gildor> but this is actually fine since it is a string
<gildor> i.e v1.[!p]
<octachron> you need a more recent version of Merlin
<companion_cube> maybe it's a problem with 4.03 and old merlin
<companion_cube> or safe-string and old merlin
<octachron> ^ yes, it is a problem with merlin parser
<companion_cube> (I think .[] is now reserved to bytes, not string)
<gildor> installed-version: 2.3.1 [4.03.0]
<octachron> companion_cube, normal version of the parser don't know about (.[])
<octachron> gildor, you need the dev version for 4.03.0
yunxing__ has quit [Remote host closed the connection]
yunxing_ has joined #ocaml
<octachron> companion_cube, the problem appear because merlin parser was forked before the user-defined indexing operators change were reverted in trunk
<Drup> merlin is not 4.03 compatible just yet. just ignore the error for now
<gildor> Drup: ACK
<companion_cube> octachron: funny
* gildor going back to try to remove camlp4 dependency from oasis
A19774941 has quit [Remote host closed the connection]
yunxing_ has quit [Read error: Connection reset by peer]
yunxing_ has joined #ocaml
walter|r has joined #ocaml
walter|r has quit [Ping timeout: 250 seconds]
<rgrinberg> companion_cube: \o/
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
Algebr` has joined #ocaml
octachron has quit [Quit: Leaving]
yunxing_ has quit [Remote host closed the connection]
seangrove has quit [Remote host closed the connection]
seangrove has joined #ocaml
connorja_ has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 244 seconds]
connorjacobsen has joined #ocaml
seangrove has quit [Ping timeout: 240 seconds]
madroach has joined #ocaml
Simn has quit [Quit: Leaving]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
yunxing_ has joined #ocaml
Kakadu has quit [Remote host closed the connection]
walter|r has joined #ocaml
Denommus has joined #ocaml
misterme_ has quit [Remote host closed the connection]
lokien has joined #ocaml
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]