companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.05.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.05/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
freefunc3 has joined #ocaml
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<freefunc3> why is `fun (s:ListStack) -> ListStack.push 1 s` not compiling
<freefunc3> I understand all the other
<freefunc3> but this one leave me dumbfounded; we tell the compiler that s is of type ListStack so worst case it should fail if 'a is not int, no?
kerrhau has quit [Quit: bye!]
<lyxia> ListStack is not a type
<lyxia> int ListStack.t is a type
<freefunc3> thanks again man, it sincerely helps!
<freefunc3> ok, that whole functor thing is starting to make sense to me
kerrhau has joined #ocaml
shinnya has quit [Ping timeout: 255 seconds]
Algebr has joined #ocaml
webshinra has quit [Ping timeout: 240 seconds]
enterprisey has joined #ocaml
jbrown has quit [Ping timeout: 255 seconds]
webshinra has joined #ocaml
kerrhau_ has joined #ocaml
stux|RC has quit [Ping timeout: 240 seconds]
mfp__ has quit [Ping timeout: 255 seconds]
marcux has quit [Quit: leaving]
marcux has joined #ocaml
Algebr has quit [Ping timeout: 255 seconds]
stux|RC has joined #ocaml
govg has quit [Ping timeout: 248 seconds]
Algebr has joined #ocaml
jonasen has joined #ocaml
<Khady> how am I supposed to use merlin-locate-ident in emacs? It seems to be looking for the ident under the cursor rather than the one I input
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xa0 has joined #ocaml
Algebr has quit [Ping timeout: 240 seconds]
govg has joined #ocaml
marcux has quit [Ping timeout: 260 seconds]
kerrhau has quit [Ping timeout: 248 seconds]
Associat0r has quit [Ping timeout: 255 seconds]
Simn has joined #ocaml
jonasen has joined #ocaml
samrat has joined #ocaml
Associat0r has joined #ocaml
Associat0r has quit [Changing host]
Associat0r has joined #ocaml
cbot has quit [Quit: Leaving]
infinity0 has quit [Ping timeout: 255 seconds]
infinity0 has joined #ocaml
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mbuf has joined #ocaml
jonasen has joined #ocaml
groovy2shoes has quit [Excess Flood]
groovy2shoes has joined #ocaml
groovy2shoes has quit [Excess Flood]
groovy2shoes has joined #ocaml
enterprisey has quit [Read error: Connection reset by peer]
dakk has joined #ocaml
jonasen_ has joined #ocaml
jonasen has quit [Read error: Connection reset by peer]
nicoo has quit [*.net *.split]
alexelcu has quit [Remote host closed the connection]
alexelcu has joined #ocaml
alexelcu has quit [Remote host closed the connection]
alexelcu has joined #ocaml
AltGr has joined #ocaml
nicoo has joined #ocaml
samrat has quit [Ping timeout: 248 seconds]
enterprisey has joined #ocaml
tbarabosch has joined #ocaml
samrat has joined #ocaml
tbarabosch has quit [Quit: Asta la vista]
tbarabosch has joined #ocaml
marcux has joined #ocaml
andreas__ has joined #ocaml
mbuf is now known as mbuf|BRB
Simn has quit [Ping timeout: 255 seconds]
Simn has joined #ocaml
dhil has joined #ocaml
dakk has quit [Ping timeout: 246 seconds]
gargawel has joined #ocaml
enterprisey has quit [Read error: Connection reset by peer]
marcux has quit [Ping timeout: 258 seconds]
ygrek has joined #ocaml
freusque has joined #ocaml
TheLemonMan has joined #ocaml
samrat has quit [Ping timeout: 264 seconds]
argent_smith has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 255 seconds]
MercurialAlchemi has joined #ocaml
freefunc3 has quit [Ping timeout: 260 seconds]
mfp__ has joined #ocaml
jonasen_ has quit [Ping timeout: 240 seconds]
copy_ has joined #ocaml
copy[m] is now known as copy[m]1
copy[m]1 is now known as copy__
jonasen has joined #ocaml
ziyourenxiang has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
kakadu has joined #ocaml
johnelse has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
tbarabosch has quit [Remote host closed the connection]
al-damiri has joined #ocaml
dhil has joined #ocaml
<smondet[m]> Khady: for me `merlin-locate-indent` asks for an indent with a prompt?
_andre has joined #ocaml
nahra` has quit [Remote host closed the connection]
nahra` has joined #ocaml
nahra` has quit [Remote host closed the connection]
dakk has joined #ocaml
SwimmerLine has joined #ocaml
mfp__ has quit [Ping timeout: 240 seconds]
bitbckt has quit [Ping timeout: 246 seconds]
SwimmerLine has quit [Quit: Page closed]
bitbckt has joined #ocaml
jbrown has joined #ocaml
copy_ has quit [Quit: Connection closed for inactivity]
freefunc3 has joined #ocaml
<freefunc3> Hi again friends,
<freefunc3> So I'm starting to get the subtleties of functors and how they work. My questions now are more about design and functional patterns
<freefunc3> I have this skelton code: https://pastebin.com/UUhCWg5R
<freefunc3> sorry this code: https://pastebin.com/39LsmEiS
johnelse has joined #ocaml
<freefunc3> On one hand, I want to make the user ignorant about the underlying implementation (and enable later development without breaking changes)
<freefunc3> in addition to that, I'd like to avoid code duplication
<freefunc3> so my plan was to have all the functions live in the Make functor
<freefunc3> some would be implemented
<freefunc3> others would just be alias of functions implemented in the argument module (Format)
<freefunc3> (just like L31)
<freefunc3> The thing I am uncomfortable with is that some functions that I was planning to implement in the Make functor are actually only implementable if you know about the actual underlying type of the argument
<freefunc3> I am the developer so I know that information, but it feels to me that it's a code smell
<freefunc3> e.g I want to implement a "size" function
<freefunc3> I know that the two formats (BigEndian and LittleEndian) both use the type string
mbuf|BRB has quit [Quit: Leaving]
<freefunc3> so my size function would be using String.length
<freefunc3> it doesn't feel right but I can't think of any alternative that doesn't make me duplicate that function in both Format modules
micro_ has joined #ocaml
sepp2k has joined #ocaml
<kakadu> def`: hi. I'm trying to compile merling for multicore OCaml. I copied some files but I get an error about unbound Lexer module? should it be something from merlin's source tree or from compiler-libs?
<kakadu> File "src/ocaml/typer/typing/cmt_format.ml", line 224, characters 21-35:
<kakadu> Error: Unbound module Lexer
mfp has joined #ocaml
<Leonidas> I'm trying to implement some kind of type based converter combinator https://gist.github.com/Leonidas-from-XIV/5fc4a34a0edcee615a526e2ed2c4943c
<Leonidas> But I don't know how I would implement this decode function. The spec type looks like it is doing the right thing, accumulating arguments but I don't quite know how to make it call the int_of_string etc functions correctly
MercurialAlchemi has quit [Ping timeout: 258 seconds]
<octachron> Leonidas, you should deconstruct the raw string list at the same time as the spec lists and then just apply f : "(f @@ decode_elem x y)" with y the head of the raw string list
malina has joined #ocaml
dakk has quit [Read error: Connection reset by peer]
zolk3ri has joined #ocaml
dakk has joined #ocaml
freusque has quit [Quit: WeeChat 1.7.1]
dhil has quit [Ping timeout: 240 seconds]
ontologiae has joined #ocaml
sz0 has joined #ocaml
ontologiae has left #ocaml [#ocaml]
ontologiae has joined #ocaml
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has quit [Ping timeout: 248 seconds]
ontologiae has quit [Quit: WeeChat 0.4.2]
<def`> kakadu: from merlin's source tree
<zolk3ri> https://ocaml.org/learn/tutorials/garbage_collection.html <- Has this been written by an OCaml developer?
<kakadu> def`: should this Lexer module be somehow created from lexer_raw.ml or it is something else?
<def`> kakadu: sorry, I mean Lexer_raw is merlin's lexer.
<def`> Lexer is from compiler-libs and is not used by merlin.
<Drup> Leonidas: dinosaure did something similar called "farfadet"
<kakadu> def`: Ah, thanks. btw, what is supposed approach to see compilation commands in OCamlMakefile? `make VERBOSE=1` seems not to work
* kakadu is probably no linking the file with compiler-libs.common so this Lexer module is not found
pmetzger has joined #ocaml
jonasen has joined #ocaml
FreeBirdLjj has joined #ocaml
slash^ has joined #ocaml
ygrek has quit [Ping timeout: 255 seconds]
nahra has joined #ocaml
<def`> kakadu: no, merlin is not using compiler-libs
<def`> the dependency on Lexer is removed
<def`> it is using its own modules for most features, you will have to port the parser and fix the typechecker.
<def`> (I recommend starting by copy-pasting from an existing typer, maybe typer_402 if that's the version you are starting from)
<def`> you can make a diff between orig/ocaml_402 and src/ocaml/typer_402 to see the difference between upstream (compiler-libs) and merlin
<def`> (this is quite hard, learning by tweaking the existing merlin is maybe a bit easier)
ShalokShalom_ has joined #ocaml
<def`> whenever you modify the lexer and/or the parser, run `make preprocess` to update the generated files
dakk has quit [Read error: Connection reset by peer]
<kakadu> I understood that issue with Lexer, thanks.
<kakadu> def`: Do you have someplans to describe all of this somewhere in the wiki?
<kakadu> I managed to understand that original compiler files need to be fixed manually (for example, this Pconst_string constructor which was called Const_string when it was in Asttypes.ml) but I could get away a thought "WTF, what am I doing"
ShalokShalom has quit [Ping timeout: 264 seconds]
ShalokShalom_ is now known as ShalokShalom
bombastus has joined #ocaml
<dinosaure> Leonidas: yes, if you want to see: https://github.com/oklm-wsh/Farfadet
dhil has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
ziyourenxiang has quit [Ping timeout: 240 seconds]
superherointj has joined #ocaml
jnavila has joined #ocaml
benq has joined #ocaml
dhil has quit [Ping timeout: 258 seconds]
cbot has joined #ocaml
superherointj2 has joined #ocaml
luukAntwerp has quit [Quit: Konversation terminated!]
zaquest has quit [Ping timeout: 260 seconds]
superherointj has quit [Ping timeout: 240 seconds]
mbuf has joined #ocaml
<freefunc3> Drup: hey, sorry to bother you again, I have made some progress (https://pastebin.com/69z1seg7) in my understanding of functors.
<freefunc3> I have one quick question about Line31: it seems to me that this is bad design / a leaky abstraction
<freefunc3> because I take advantage of my personal knowledge of the underlying type t, to use the function String.length
<freefunc3> I'd like to know what you think. In particular: 1/ if it is ok? 2/ if it isn't, how should I tackle this?
zaquest has joined #ocaml
<freefunc3> thank you! (:
Anarchos has joined #ocaml
micro_ has quit [Quit: leaving]
mbuf has quit [Quit: Leaving]
andreas__ has quit [Quit: Connection closed for inactivity]
AxelAlex has joined #ocaml
lgd has quit [Quit: Quitte]
lgd has joined #ocaml
lgd has quit [Client Quit]
lgd has joined #ocaml
philtor has joined #ocaml
benq has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AxelAlex has left #ocaml [#ocaml]
Simn has quit [Ping timeout: 240 seconds]
micro has joined #ocaml
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
pmetzger has quit [Remote host closed the connection]
pmetzger has joined #ocaml
pmetzger has quit [Ping timeout: 255 seconds]
superherointj2 has quit [Quit: Leaving]
<Leonidas> dinosaure: Drup thanks I'll check it out!
FreeBirdLjj has quit [Remote host closed the connection]
Anarchos has quit [Excess Flood]
Anarchos has joined #ocaml
mengu has joined #ocaml
Algebr has joined #ocaml
wwhite has joined #ocaml
pmetzger has joined #ocaml
<wwhite> hey, I'm a newbie, anyone can help me to understand some "basic" codes ? Mostly syntax things >.<
<Anarchos> wwhite sure
Algebr has quit [Remote host closed the connection]
<Anarchos> wwhite just paste your code somewhere and give the link
inr has quit [Quit: WeeChat 1.9.1]
pmetzger has quit [Ping timeout: 240 seconds]
inr has joined #ocaml
pmetzger has joined #ocaml
pmetzger has quit [Read error: Connection reset by peer]
pmetzger has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
<wwhite> I have some problems to understand the "types" syntax and code syntax on those things :\
kakadu has joined #ocaml
<Anarchos> wwhite what don't you understand ?
kolko has quit [Ping timeout: 248 seconds]
kakadu_ has joined #ocaml
ygrek has joined #ocaml
kakadu has quit [Ping timeout: 260 seconds]
kolko has joined #ocaml
philtor has joined #ocaml
<wwhite> difference between sumbetween and sumbtw for example :\
ygrek has quit [Ping timeout: 255 seconds]
<Anarchos> wwhite let me see
<Anarchos> wwhite the first takes a couple as only argument
Simn has joined #ocaml
<Anarchos> wwhite the second takes two arguments
<wwhite> what about sum ? (there are two...)
<wwhite> how do I understand that type declaration ??
slash^ has quit [Read error: Connection reset by peer]
shinnya has joined #ocaml
AltGr has left #ocaml [#ocaml]
<octachron> wwhite, do you understand the type of times?
Anarchos has quit [Remote host closed the connection]
Anarchos has joined #ocaml
<wwhite> uhm, honestly is not that clear :(
<octachron> so starting from there, "int -> int" reads as: a function taking an int argument and returning an int
<octachron> then "int -> int -> int" can be read in two equivalent way:
pmetzger has quit [Ping timeout: 248 seconds]
<octachron> first: a function taking two int arguments and returning an int, for instance "times 2 3" returns "6"
<wwhite> yeah, I know that.
<octachron> but, it can also be reads as "int -> (int -> int)": a function taking one int argument and returning "a function taking one ints argument and returning an int"
<wwhite> that's confusing ...
<zolk3ri> Funception!
<octachron> as an example: "times 2" is the function taking one argument and multiplying it by two
<octachron> or if I define "let times_2 = times 2" then "times_2 3" returns 6
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<octachron> It is confusing right now, let's come back to the type of sum: `sum` is a function that takes two arguments and returns an int.
<octachron> If it is*
<octachron> what is the type of the first argument?
pete_8 has joined #ocaml
<wwhite> sorry but I need to go
<wwhite> hopefully we can do something more tomrrow :(
wwhite has quit [Quit: leaving]
<pete_8> Hi! Does the following relative of "map" have a name?: [1; 2; 3; 4] -> [[f 1; 2; 3; 4]; [1; f 2; 3; 4]; [1; 2; f 3; 4]; [1; 2; 3; f 4]].
<companion_cube> not that I know of
<pete_8> ok
pmetzger has joined #ocaml
<flux> I think a lower level combinator would be: [1; 2; 3; 4] [a; b; c; d] -> [[a; 2; 3; 4]; [1; b; 3; 4]; [1; 2; c; 4]; [1; 2; 3; d]]
<flux> still seems pretty useless.. :-)
pmetzger has quit [Ping timeout: 240 seconds]
<Drup> freefunc3: it sounds ok to me
<Drup> I mean, t is a string, that's exposed in the API, so you have the right to use it
<Drup> if you don't want that, make it abstract and provide the lenght function in F
<Drup> but otherwise, it's fine
pmetzger has joined #ocaml
pmetzger has quit [Ping timeout: 240 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
pete_8 has quit [Ping timeout: 255 seconds]
pete_8 has joined #ocaml
<pete_8> sorry was afk
pmetzger has joined #ocaml
<pete_8> flux: yea, thats possably a more useful function
<pete_8> flux: why pretty useless? you see some obvious way to avoid it?
johnelse has quit [Ping timeout: 240 seconds]
<pete_8> flux: my use case is where i need to construct a bunch of "variants" of an object
<pete_8> flux: these variants are obtained by holding all aspects of the structure fixed except one... and I need to collect all the variants
DrWhax_ is now known as DrWhax
<pete_8> flux: is there a better way to view this problem?
jnavila has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
benq has joined #ocaml
cbot_ has joined #ocaml
cbot has quit [Ping timeout: 246 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
enterprisey has joined #ocaml
freefunc3 has quit [Ping timeout: 260 seconds]
enterprisey has quit [Remote host closed the connection]
pmetzger has quit [Ping timeout: 255 seconds]
mengu has quit [Remote host closed the connection]
snhmib has joined #ocaml
pmetzger has joined #ocaml
pmetzger has quit [Ping timeout: 255 seconds]
Simn has quit [Read error: Connection reset by peer]
pmetzger has joined #ocaml
marcux has joined #ocaml
johnelse has joined #ocaml
malina has quit [Remote host closed the connection]
pmetzger has quit [Ping timeout: 248 seconds]
mengu has joined #ocaml
malina has joined #ocaml
argent_smith has quit [Quit: Leaving.]
mengu has quit [Ping timeout: 260 seconds]
mengu has joined #ocaml
sepp2k has quit [Quit: Leaving.]
mengu has quit [Ping timeout: 255 seconds]
kakadu_ has quit [Remote host closed the connection]
snhmib has quit [Ping timeout: 240 seconds]
malina has quit [Remote host closed the connection]
enterprisey has joined #ocaml
superherointj has joined #ocaml
pmetzger has joined #ocaml
<superherointj> Hello. I'm living Ocaml-install-hell-on-Windows. What is the recommended method to install Ocaml/Opam on Windows?
pete_8 has quit [Ping timeout: 248 seconds]