ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Logs at http://irclog.whitequark.org/ocaml
shinnya has quit [Ping timeout: 240 seconds]
shinnya has joined #ocaml
Algebr` has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
<Algebr`> Why does ocaml call ADT variants?
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jprakash has joined #ocaml
<Drup> it's not really an ocaml thingy, it's just the other name of it. I'm not sure of the origin
dapz has joined #ocaml
<Algebr`> Is there an ocaml equation to haskell's point free style?
dapz has quit [Client Quit]
<Drup> I suppose you mean equivalent
<Drup> point free style is not really a thing in ocaml
<Algebr`> yea, oops meant to say equivalent.
<Drup> the ocaml community is not as fan of intellectual riddles as the haskell community.
<Algebr`> yes, seems very pragmatic
<Drup> you can still use partial application and the @@ operator
<Drup> there is no . operator, and flip is not in the standard library
<pippijn> . operator is % in batteries, I think
<Drup> yes
<Drup> I'm unsure why they didn't include it at the same time as @@
<Algebr`> what's batteries? some alternative extension to stdlib?
<Drup> yes
<Algebr`> Is this an alternative to Jane street's Core.Std?
<Drup> yeah
<Drup> quite a different style, though
<dmbaturin> I want to make a brainfuck compiler as an ocaml excercise. What is the idiomatic approach to keeping state between translate function calls to keep track of brackets; or, better, elminate the need for state?
<Drup> use a stack ? :)
<Drup> there is an imperative stack in the standard library, if you want a functional one, well, just use a list
<dmbaturin> Well, I guess. The question is, where should I produce the side effect.
<dmbaturin> Wrap the stateless translate function into an impure one?
<Drup> you don't have to use side effects, you could pass along a state (as a record)
<dmbaturin> Or pass the state list as an argument in the tail call?
<Drup> I can't give you any answer, it depends on your preference
<Drup> and of the rest of the design
<Drup> In something as simple as a brainfuck interpretor, I would probably go the stateless route
<Drup> when I did a graphical logo interpreter, which is pretty much the same thing, I used a state
<dmbaturin> Ok, I'll make something and link it here for everyone to laugh at. :)
<Drup> (mostly because graphical backends are stateful anyway)
<Drup> For the interested, here are the video of the previous OUPS meetup : http://weby.kokakiwi.net/video/MeetupOcaml/webm/ (they are in english this time :p)
ollehar has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
djur has quit [Ping timeout: 246 seconds]
zpe has quit [Ping timeout: 240 seconds]
huza has joined #ocaml
<dmbaturin> What is the easiest way to read individual characters from a stream>
<dmbaturin> ?
<Drup> a stream ?
<Drup> You mean Stream.t for the standard library ? Stream.next then, but don't use this thing
<dmbaturin> Well, from a file in this case, no matter how exactly.
<Drup> "input_char" then
<dmbaturin> It's like input_line, but for chars? Cool, thanks.
shinnya has quit [Ping timeout: 256 seconds]
jprakash has quit [Ping timeout: 240 seconds]
huza has quit [Ping timeout: 260 seconds]
shinnya has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
jprakash has joined #ocaml
jprakash has quit [Client Quit]
q66 has quit [Quit: Leaving]
philtor_ has joined #ocaml
johnnydiabetic has joined #ocaml
divyanshu has joined #ocaml
philtor_ has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
divyanshu has quit [Ping timeout: 240 seconds]
zpe has quit [Ping timeout: 256 seconds]
<dmbaturin> Drup: If I need to do close_in in a function, how do I return something from it?
<dmbaturin> From the function, that is.
divyanshu has joined #ocaml
<Drup> I'm not sure to see your issue
<dmbaturin> Drup: Well, if I do "close_in myfile; some_value" at the end, it will return some_value, right?
<Drup> yes
<dmbaturin> Ah, ok, cool.
divyanshu has quit [Ping timeout: 245 seconds]
<dmbaturin> "Syntax error" is frustrating sometimes.
divyanshu has joined #ocaml
<Drup> yeah
<Drup> the location is quite precise usually, so with a correct editor, it goes ok
<dmbaturin> Should I try the emacs mode for ocaml, whatever it was called?
<Drup> what is your usual editor of choice ?
<dmbaturin> Vim.
<Drup> then use Vim
<Drup> (and merlin, because merlin is nice)
shinnya has quit [Read error: No route to host]
<dmbaturin> Nice. I thought emacs is "the official editor of the ocaml community" and resistance is futile. :)
shinnya has joined #ocaml
ebzzry_ has joined #ocaml
ebzzry has quit [Ping timeout: 245 seconds]
sorabji has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ygrek has joined #ocaml
ebzzry_ has quit [Ping timeout: 260 seconds]
jao has quit [Ping timeout: 245 seconds]
englishm has joined #ocaml
zpe has joined #ocaml
johnnydiabetic has quit [Ping timeout: 250 seconds]
zpe has quit [Ping timeout: 250 seconds]
ebzzry_ has joined #ocaml
johnnydiabetic has joined #ocaml
johnnydiabetic has quit [Remote host closed the connection]
onr has left #ocaml [#ocaml]
badon has quit [Excess Flood]
sorabji has joined #ocaml
badon has joined #ocaml
tidren has joined #ocaml
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
tidren has quit [Remote host closed the connection]
badon has quit [Ping timeout: 250 seconds]
badon has joined #ocaml
axiles has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
WraithM has joined #ocaml
_0xAX has joined #ocaml
hhugo has joined #ocaml
Simn has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
Kakadu has joined #ocaml
platz has joined #ocaml
testcocoon has quit [Ping timeout: 240 seconds]
Antoine59 has quit [Ping timeout: 240 seconds]
platz has left #ocaml [#ocaml]
testcocoon has joined #ocaml
hhugo has quit [Quit: Leaving.]
_5kg has joined #ocaml
_5kg has quit [Client Quit]
_5kg has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
parcs has quit [Ping timeout: 250 seconds]
hhugo has joined #ocaml
Submarine has joined #ocaml
<def`> dmbaturin: you should also give a try to ocp-indent (optionally with ocp-indent-vim mode)
<dmbaturin> def`: Thanks, will have a look.
<dmbaturin> http://bpaste.net/show/plQz72aHrjA1ZuEoaABd/ The BF to C compiler works.
Antoine59 has joined #ocaml
parcs has joined #ocaml
_0xAX has quit [Remote host closed the connection]
michael_lee has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
fraggle_ has quit [Remote host closed the connection]
englishm_ has joined #ocaml
pgomes has joined #ocaml
pgomes has quit [Client Quit]
englishm has quit [Ping timeout: 264 seconds]
fraggle_ has joined #ocaml
gal_bolle has joined #ocaml
iZsh has quit [Quit: ZNC - http://znc.in]
iZsh has joined #ocaml
derek_c has joined #ocaml
<derek_c> how do you run a file from toplevel?
<derek_c> i mean a script
gal_bolle has quit [Ping timeout: 264 seconds]
<Kakadu> #use "file.ml"
pminten has joined #ocaml
arquebus has joined #ocaml
<derek_c> Kakadu, how do you find the "core" module in a script?
<derek_c> it's complaining Error: Unbound module Core
<derek_c> I'm trying to run a script with `ocaml <script>`
Submarine has quit [Remote host closed the connection]
hhugo has quit [Quit: Leaving.]
Eyyub has quit [Ping timeout: 260 seconds]
hhugo has joined #ocaml
hhugo has quit [Client Quit]
derek_c has quit [Ping timeout: 264 seconds]
azynheira has joined #ocaml
NoNNaN has quit [Ping timeout: 264 seconds]
alpounet has joined #ocaml
no0y has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
Gonzih has joined #ocaml
morphles has joined #ocaml
gal_bolle has joined #ocaml
<morphles> Can I have arithmetinc/matematical polymorphic functions like in haskell? Say "let sq = fun x = x * x" As I understand this will be int only, if I wan't float I have to use *. But maybe there is some way to have polymorphic function? And most importantly return type polymorphism?
<whitequark> no (not yet)
<morphles> Thats a pitty. Somehow long time ago I read about ocalm and though it also had typeclasses like haskell, but it seems typeclasses are rather rare
tobiasBora has joined #ocaml
<whitequark> it will have implicits soon
<Unhammer> whitequark, is there an url or something on that? ddg is not being helpful :)
<Unhammer> oh nevermind http://openmirage.org/blog/welcome-to-our-summer-hackers explained it :)
WraithM has quit [Ping timeout: 245 seconds]
derek_c has joined #ocaml
pminten has quit [Ping timeout: 250 seconds]
gal_bolle has quit [Ping timeout: 250 seconds]
derek_c has quit [Quit: Leaving]
arquebus has quit [Quit: Konversation terminated!]
zpe has joined #ocaml
<Unhammer> is there some common idiom for "line-parsing" with one line lookahead in ocaml? e.g. I have input "groupname⏎entry1⏎entry2⏎groupname2⏎entry3⏎entry4⏎" and want to call a function for each group, so when reading input I have to consume the first line of the next group in order to know that this group has ended
<Unhammer> if I were writing a quick awk script the loop would say "{if($0~/group/){dostuff(g); g=""}; g=$0}" but I assume there's some nice functional way of doing it as well …
divyanshu has joined #ocaml
<Kakadu> Unhammer: Sounds good for parser-combinators
<Unhammer> http://sprunge.us/jbNS ← what I ended up doing, a bit longer code than the awk heh
BitPuffin has quit [Ping timeout: 250 seconds]
divyanshu has quit [Ping timeout: 264 seconds]
<def`> Unhammer: about merlin, I managed to reproduce the memory leak with emacs, it is fixed in latest master, we should make a release soon
divyanshu has joined #ocaml
<Unhammer> oh, awesome, thank you def` :-)
<Unhammer> now I can have firefox open while coding =P
divyanshu has quit [Client Quit]
slash^ has joined #ocaml
ggole has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
morphles has quit [Ping timeout: 245 seconds]
Anarchos has joined #ocaml
araujo has quit [Quit: Leaving]
mcclurmc has joined #ocaml
divyanshu has joined #ocaml
Eyyub has joined #ocaml
gal_bolle has joined #ocaml
jerith has quit [Quit: leaving]
jerith has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
tobiasBora has quit [Ping timeout: 245 seconds]
huza has joined #ocaml
aymeric has joined #ocaml
aymeric is now known as Aym_C
ygrek has joined #ocaml
divyanshu has quit [Ping timeout: 240 seconds]
manizzle has quit [Ping timeout: 255 seconds]
Aym_C has quit [Quit: Lost terminal]
slash^ has quit [Read error: Connection reset by peer]
<whitequark> hmmmm
<whitequark> all open types carry the constructor name inside them, right?
<whitequark> how do I get it back?
<def`> whitequark: this can be of some help http://yawdp.com/~def/exn_en.txt
<def`> whitequark: but afaik, there is no public api for this
<def`> (search for "Name of the constructor")
<whitequark> yeh
<def`> (this public api would not be typeable, so it's quite unsafe, but would make sense in Obj)
<whitequark> I want exceptions and open types in [@@deriving Show]
<whitequark> probably not yet though
<def`> so everything you need to know is probably somewhere inside these notes
<whitequark> yeah
<whitequark> I actually looked at Printexc already
<whitequark> it has more or less same code
<def`> ok
* whitequark sighs
<whitequark> OASIS is so very suboptimal for packaging ppx-intense stuff
<whitequark> due to really dumb *Opt: and BuildDepends: and inflexible META generator
<whitequark> I'm considering switching to topkg
<whitequark> well, topkg+ocamlbuild
divyanshu has joined #ocaml
tobiasBora has joined #ocaml
<tobiasBora> Does anyone know how to force the evaluation of a BatEnum ? I would like to convert a file in Enum, filter it, and write the result in the same file, but because some lazy operations the file is opened and troncated at the very beginning so I get only an empty file.
<tobiasBora> I found a first solution which is convert into list, then convert back into enum, but that sound ugly...
<ggole> Write to a new file and rename at the end
<ggole> This will also prevent lossage in the case of powerout, crash, rogue sysadmin/OOM randomly killing processes, etc
<whitequark> your competitors putting a screwdriver through a power bus in a datacenter
<whitequark> (this actually happened to someone I know)
q66 has joined #ocaml
<ggole> Was that an "oops :o" or an "oops >:)"
<tobiasBora> Ahah ^^ Ok thank you I will do that !
<whitequark> the latter
<whitequark> it was completely deliberate
<ggole> Nice
<whitequark> after the UPS, too
<ggole> Was this in .ru by any chance?
<whitequark> sure
<ggole> I figured. Uh, no offense.
<whitequark> none taken
BitPuffin has joined #ocaml
BitPuffin has quit [Client Quit]
divyanshu has quit [Ping timeout: 240 seconds]
alpounet has quit [Remote host closed the connection]
alpounet has joined #ocaml
Thooms has joined #ocaml
hhugo has joined #ocaml
divyanshu has joined #ocaml
BitPuffin has joined #ocaml
zpe has quit [Remote host closed the connection]
BitPuffin has quit [Ping timeout: 256 seconds]
dsheets has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
shallowest is now known as hlupe
tobiasBora_ has joined #ocaml
tobiasBora has quit [Ping timeout: 240 seconds]
ollehar has joined #ocaml
q66 has quit [Remote host closed the connection]
gal_bolle has quit [Ping timeout: 240 seconds]
dsheets has quit [Ping timeout: 245 seconds]
q66 has joined #ocaml
dsheets has joined #ocaml
divyanshu has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
darkf has quit [Quit: Leaving]
Hannibal_Smith has joined #ocaml
ollehar has quit [Ping timeout: 250 seconds]
gal_bolle has joined #ocaml
divyanshu has quit [Ping timeout: 260 seconds]
divyanshu has joined #ocaml
gal_bolle has quit [Ping timeout: 256 seconds]
<adrien> bah
<adrien> self TOFO
<adrien> TODO*
<adrien> revert patch in #6411 for my own uses
divyanshu has quit [Ping timeout: 250 seconds]
divyanshu has joined #ocaml
q66 has quit [Quit: Leaving]
divyanshu has quit [Ping timeout: 245 seconds]
<whitequark> wth is Caml Light?
<adrien> 90s
<Anarchos> whitequark it is the previous version of OCaml, with a concurrent GC.
<Anarchos> but without objects.
<whitequark> I see
<adrien> nbo
<adrien> no
<adrien> caml super light had the concurrent gc
<adrien> not caml light
Eyyub has quit [Ping timeout: 250 seconds]
q66 has joined #ocaml
<Anarchos> adrien special light, not superlight.
<Anarchos> adrien and indeed the caml light GC was monothreaded, but a direct simplification of the Doligez's concurrent GC.
dsheets has quit [Ping timeout: 260 seconds]
<adrien> rigt, sorry :)
<adrien> me stupid sometimes
dsheets has joined #ocaml
<adrien> but the point being that the simplification was wanted
tane has joined #ocaml
gal_bolle has joined #ocaml
dsheets has quit [Ping timeout: 255 seconds]
dsheets has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
dsheets has joined #ocaml
divyanshu has joined #ocaml
<jpdeplaix> whitequark: I get this error with the latest LLVM :/ http://paste.isomorphis.me/osb
ollehar has joined #ocaml
gp83 has joined #ocaml
<gp83> Hi, I've noticed that in OCaml type_expr's, types often are `linked' using the Tlink constructor. Does anyone know of a good source of documentation on why this is done? I'm guessing it is a byproduct of a unification process when typing the program, but it'd be great to read about the process (especially why the links aren't `removed')
<gp83> (maybe `compressed' is a better verb than `removed')
<ggole> Utterly uninformed guess: allows printing the original name of the type as well as an alias?
<whitequark> jpdeplaix: LLVM/bindings version mismatch
<jpdeplaix> ok
<def`> there is a beginning of an explanation in Btypr.repr
<jpdeplaix> thanks
<def`> gp83: ^
<def`> Btype.repr*
<rks`> (I didn't check ocaml's sources to see if it matches, i'm just guessing)
dsheets has quit [Ping timeout: 250 seconds]
dsheets has joined #ocaml
<ggole> One of the first toy type checkers I ever wrote used something like that trick
gp83 has quit [Ping timeout: 246 seconds]
<ggole> Except that instead of "reallocating" it just kept counting upwards
<ggole> It was most amusing to discover that this is the moral equivalent of good old allocate-and-never-free.
shinnya has joined #ocaml
hhugo has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
zpe has joined #ocaml
dsheets has quit [Ping timeout: 250 seconds]
dsheets has joined #ocaml
hhugo has joined #ocaml
englishm_ has quit [Read error: Connection reset by peer]
englishm has joined #ocaml
<whitequark> I *really* like topkg
<ggole> What does it do?
englishm has quit [Read error: Connection reset by peer]
<whitequark> invokes ocamlbuild and generates a *.install file for OPAM
<whitequark> basically all the things that I *really* need from OASIS, without all the rigidity I do *not* need, in a single 300-line ml file
<whitequark> you can take a look at my usage in https://github.com/whitequark/ppx_deriving
<ggole> Nifty
<whitequark> yep. I'll convert everything to use it
huza has quit [Quit: WeeChat 0.3.8]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
WraithM has joined #ocaml
<Algebr`> I can't get the type signature for |>
<Algebr`> how is |> different from just ;?
<Kakadu> (|>);; in toplevel
<Algebr`> I have tried that but get an error
<Algebr`> in both utop and regular ocaml
<Kakadu> I have tried not exectly what I write
<Kakadu> not exactly*
<Algebr`> I understand that, I'm telling you I get an error. Error: Failure: "|> must be applied to two arguments"
<Kakadu> do you have ( and ) ?
<Algebr`> tried that too
<Kakadu> What is your ocaml version?
<Algebr`> The OCaml toplevel, version 4.01.0
<Kakadu> It works for me in 4.01.0
<rks`> Algebr`: you're using camlp4
<Algebr`> rks`: not sure what that is, some package?
<rks`> (I get the same error when using camlp4, otherwise I can get the signature)
<rks`> Algebr`: it's a preprocessor
<rks`> and apparently you modified your .ocamlinit to load it automatically
<rks`> (I'm guessing)
<Algebr`> ah, yes I did!
<Algebr`> is there an unload in the top level?
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<whitequark> Drup: do you think the disambiguation suffix for deriving plugins should be [@deriving_show.format], [@deriving.show.format] or [@show.format] ?
<whitequark> I'm leaning to the last one so far
<rks`> I like the 2nd one
<Algebr`> What is the difference between |> and just ; ?
<whitequark> rks`: noted
<Algebr`> aren't both for sequencing?
<whitequark> Algebr`: no, let (|>) x f = f x
<whitequark> and also let (@@) f x = f x
<tane> what's the purpose of @@ then? something like $ in haskell?
<rks`> yes
<tane> ok, thanks, didn't knew that :)
<whitequark> grmbl
<whitequark> I want hygiene in ppx_tools
divyanshu has quit [Ping timeout: 250 seconds]
<Algebr`> So the |> is basically like the shell's |?
<whitequark> yeh
BitPuffin has joined #ocaml
BitPuffin has quit [Quit: See you on the dark side of the moon!]
pminten has joined #ocaml
dsheets has quit [Ping timeout: 260 seconds]
philtor has joined #ocaml
typedlambda has quit [Read error: Connection reset by peer]
typedlambda_ has joined #ocaml
typedlambda_ is now known as typedlambda
azynheira has quit [Ping timeout: 245 seconds]
<Algebr`> what does: type t = int String.Map.t say?
<Algebr`> Also, is there there a difference between doing module Foo = Map.Make(String) and module Bar = String.Map?
<zapu> what is $ in haskell?
<Algebr`> apply
pminten_ has joined #ocaml
<zapu> those operators are tricky to google...
<Algebr`> zapu: just go to ghci and do :t ($)
philtor has quit [Ping timeout: 255 seconds]
pminten has quit [Ping timeout: 264 seconds]
<Hannibal_Smith> Or use Hoogle
<zapu> oh, cool
<zapu> makes sense, thanks
philtor has joined #ocaml
hhugo has quit [Quit: Leaving.]
<whitequark> Algebr`: it (the first statement) makes an alias
<whitequark> asfor the second one, I don't think there's a String.Map in stdlib
<whitequark> it may be in Core
BitPuffin has joined #ocaml
tidren has joined #ocaml
q66_ has joined #ocaml
q66 has quit [Ping timeout: 240 seconds]
pminten_ has quit [Ping timeout: 255 seconds]
<def`> it's not an alias (alias doesn't apply to functors)
<Unhammer> can merlin tell me the module of a certain function?
<def`> Unhammer: you can use locate of you built cmt files
<Unhammer> like if I've done "open Pcre" and have point at "pmatch", I want Pcre back (would like to make a wrapper that then takes me to the .mli of Pcre and searches for the definition of pmatch)
<Unhammer> ooh
<Unhammer> :)
<Algebr`> What does the suffix _exn usually mean?
<flux> that the function throws an exception
<Unhammer> it raises an exception Algebr`
<def`> Algebr`: Map.Make(String) is like calling a functiok returning a new module
<flux> sadly that's the only tool ocaml provides for tracking it ;)
<Unhammer> (vs using an option or empty list or what have you)
<Algebr`> so Map.of_alist_exn could possibly raise an exception?
<flux> maybe. refer to its documentation.
<Algebr`> flux: I can't get that info via the type signature?
<flux> I think the case of duplicate keys could be interesting
<mrvn> Maybe if there are duplicates in the list?
<flux> algebr`, no
<Drup> whitequark: deriving.show.format *and* show.format (or *and* format)
<flux> only arguments and return values are typed in the signature
<mrvn> exceptions in the types are on several peoples wishlist but it's not so simple to implement
<Drup> whitequark: it shouldn't be hard to automate the fact that ppx_deriving_host translate deriving.* things in * for the deriving command, or something
<Drup> (or just provide an helper function for that)
q66_ is now known as q66
pjdelport has joined #ocaml
<whitequark> I have a helper function, yes
<Algebr`> def`: so Map.Make(String) is like calling a function that makes a new module, is String.Map a shortcut for that?
<whitequark> also, it's just Ppx_deriving now, since I migrated from OASIS
<def`> Algebr`: String.Map is just a constant whose value is the result of a previous call to Map.Make(String)
<def`> Algebr`: so Map.Make has a runtime effect and is slightly less efficient
philtor has quit [Ping timeout: 240 seconds]
<def`> also, while the types are compatible (for applicative functors), values can be different
<def`> (any side effect done during the construction will be observable)
<Drup> Map.Make as a runtime effect, wat ?
<def`> Drup: a value is allocated
<Drup> ah, yeah, ok, *once*
hhugo has joined #ocaml
<def`> not once
<def`> that's the difference between refering to String.Map and always using Map.Make
<Drup> ok, right, but you *never* "always use Map.Make, it's silly, you do "module MapS = Map.Make(String)" and you go with that ...
<Drup> you made it sounds like functors are computationally expensive, which they are not.
rand000 has joined #ocaml
<def`> the questiob of Algebr` was the distinction between String.Map and Map.Make(String)
<def`> the difference precisely this effect
<def`> (when referring only to types, e.g. Map.Make(String).t no computation is done)
divyanshu has joined #ocaml
<Drup> grmbl, I was going to try and find the line where "module String.Map = Map.Make(String)" but I can't find in core because it's a maze ~~
<Drup> (I hear someone screaming "Boost" in the background)
WraithM has quit [Ping timeout: 245 seconds]
Submarine has quit [Remote host closed the connection]
morphles has joined #ocaml
<Drup> whitequark: the one things that annoys me with topkg is the need for opam (or at least opam-install)
englishm has joined #ocaml
<def`> Drup: second point, while any sane implementation shouldn't have side effects, other functors might
<def`> of Map.Make*
<whitequark> I don't really care about non-opam though
<Drup> def`: indeed
englishm_ has joined #ocaml
<whitequark> well, I suppose I care about Debian, but that should be able to use opam-install
<def`> Drup: this can bite you, especially less obvious ones
<def`> (e.g for an exception E that is not a rebind, F(A).E != F(A).E)
<Drup> def`: I tried to use batteries with js_of_ocaml, I remember ~~
<def`> I prefer not to know the details :)
<Drup> whitequark: meh :/
<Drup> whitequark: I heard you said you cared about windows, though.
<whitequark> Drup: mhrmpf
englishm has quit [Ping timeout: 240 seconds]
<def`> Drup: inconsistency is ok for human beings :)
hhugo has quit [Quit: Leaving.]
<whitequark> Drup: I have a feeling that interpreting opam install files is really not hard
<Drup> whitequark: it probably isn't, sure
<Drup> (it's basically a list of instructions)
<Drup> I'm more affraid of the whole env setup and path spagetti
<Drup> (which oasis un-spaghetti for you on windows)
philtor has joined #ocaml
<Drup> def`: Sure, that doesn't prevent me to point it out when I see it :D
<whitequark> hmmm
<whitequark> I dunno, but I really can't use OASIS for ppx_deriving
<whitequark> too rigid
<Drup> yes, I'm not surprised about that
<Drup> we had an issue with eliom too, oasis can't do what we wanted
<whitequark> Daniel pointed me to samoht/assemblage
<whitequark> as topkg successor
<Drup> I've seen the repository
<Drup> didn't investigate
<Drup> one day we will have a good and integrate build system, but doesn't seem to be there yet.
hhugo has joined #ocaml
<Drup> shouldn't "pp" be called "fprintf" ?
<whitequark> um?
<Drup> oh no, nevermind.
pminten has joined #ocaml
<whitequark> I should probably offer both [@printer] and [@format]
<whitequark> the latter being shorthand for the fprintf thing
tidren has quit [Remote host closed the connection]
<whitequark> because it'll be a common use case, I guess?
<whitequark> not sure
tidren has joined #ocaml
<Drup> hey, you stole bunzli's css for ocamldoc x)
<whitequark> with permission :p
<Drup> whitequark: I think the interface as a whole is in the right place now
<whitequark> Drup: hm, what do you mean?
<Drup> that I find the interface and the various feature good and I don't have any remarks anymore :D
<whitequark> ah, I see
<Drup> "just" need to write lot's of derivings :)
<whitequark> no, that's the easy part
<Drup> depends on the derivings
<whitequark> I can write derivings when I'm bored, it involves no intellectual work
<whitequark> whatsoever
<whitequark> thinking about an API for "the entire ocaml ecosystem" though...
<Drup> :D
<whitequark> but yeah, I'm mostly satisfied with it
<whitequark> I only need to add the option parser
<Drup> I need to read the paper on how deriving Traverse and Monad are implemented in Haskell
<Drup> it's not completly trivial
<whitequark> what's that?
<Drup> Traverse ? map and fold
englishm has joined #ocaml
<whitequark> ummmm
<whitequark> for arbitrary structures?
<Drup> yep.
<Drup> "not completly trivial"
<def`> well, for polynomial functors
<whitequark> Drup: why would you want that?
<whitequark> and how/
<def`> I doubt the algorithm handle negative occurences correctly
WraithM has joined #ocaml
<Drup> def`: in haskell, it does
<def`> (miltiple solution, not necessarimy decidable, etc)
* whitequark hears the ivory tower alert
<Drup> whitequark: "type 'a tree = Node of 'a tree * 'a * 'a tree | Leaf [@@deriving map]"
<Drup> you are asking why I want that ?
<Drup> because it's pure boilerplate, for example ? :D
<whitequark> ohhhh
<whitequark> map of polymorphic vars
WraithM has quit [Ping timeout: 250 seconds]
<Drup> what did you expect ? x)
<whitequark> I had no idea
<Drup> anyway, it's on the todo list, not for now
<ggole> Hmm, could you do an iter for a given type?
hhugo has quit [Quit: Leaving.]
<Drup> probably, it's almost the same
<ggole> Eg type foo = Foo of zonk | Bar of int * zonk [@@deriving iter zonk]
tobiasBora_ has quit [Ping timeout: 240 seconds]
<Drup> except that the order of the iter might be unspecified, wich limit the utility somehow
<ggole> I guess that's a bit marginal, but I've written that boilerplate a few times before
<Drup> like everyone ...
<whitequark> I'm not sure I'm interested in Traverse, never really encountered that problem
<whitequark> so far?
<Drup> you're not defining enough data structures :D
<ggole> Why would the order be unspecified?
<whitequark> lexical order, no?
<ggole> That's what I would expect
tani has joined #ocaml
<Drup> ggole: Bar of zonk * zonk, which zonk do I traverse first, do I do DFS or BFS ?
<ggole> First one first :)
<ggole> zonk is not t, so there is no ordering problem
<Drup> Sure, we can fix one arbitrarily
<Drup> oh, in your example, zonk is not t.
<Drup> (in my mind it was)
<ggole> Sorry, I didn't make it quite clear
<Drup> whitequark: I have defined a few typechecker/compiler front end and writing the map/fold/iter for the AST is pure PITA
<whitequark> I see
tane has quit [Ping timeout: 240 seconds]
<Drup> (and completly trivial too)
<ggole> Much more so when you have a fat AST with ~thirty constructors :/
<ggole> Yeah
<ggole> I tend to use emacs macros.
<ggole> It's worrying when your editor provides more useful abstraction than your language.
* ggole mumbles his usual about abstraction over constructors
_0xAX has joined #ocaml
<Drup> ggole: go on and implement gasche's fabulous idea on views :p
<ggole> With binding?
<ggole> That might be going a bit far: I haven't made up my mind on that
<Drup> I don't remember the details, there is gagalium blog post about it
<whitequark> Drup: fabulous
<Drup> \o/
<ggole> Yeah, I've seen it
<ggole> whitequark: don't disappoint me: tell me that isn't a script
<whitequark> ggole: it is
<whitequark> but I used to type this by hand
* ggole crushed
<whitequark> I was just too lazy right now :3
<pippijn> any opinions on CeCILL-C?
<whitequark> funny name
<pippijn> I'm thinking of releasing the clang-ocaml bindings under that license
<whitequark> pippijn: I think that's wrong
<whitequark> bindings should generally be released under same license as whatever they bind to
<whitequark> i.e. BSD in this case
<pippijn> hmm
<pippijn> makes sense
tani has quit [Quit: Verlassend]
<pippijn> whitequark: thanks, that makes the choice rather easy
<pippijn> and I now have a good argument for that choice
<whitequark> you're welcome
<pippijn> (against inria)
<Drup> ugh, inria and licensing ...
philtor has quit [Ping timeout: 256 seconds]
<Algebr`> "and" is syntax, correct? its not a function
<Algebr`>
<ggole> Yep
<Drup> and it's not the "and" logical operator
<whitequark> Drup: just replace it with caml_alloc...
<Algebr`> What is the purpose of and then? I'm seeing it come up in rules for ocamllex
<Drup> let x = 3 and y = 4 in ...
<ggole> It demarcates which bindings mutually recur
<ggole> let rec f x = g (x + 1) and g y = y
<Drup> ggole: and swapping :p
<ggole> There are analogues at the type and module level too
<ggole> (Although mutually recurring modules have some funny rules.)
<ggole> caml_alloc would miss most allocations though
<whitequark> hm
<whitequark> doesnt caml_alloc1..caml_allocN call caml_alloc?
<whitequark> oh
<whitequark> no
<ggole> Yeah, but ocamlopt-compiled code just twiddles the register directly without going through that symbol
<ggole> For large allocs you'll get it
<whitequark> I believe it still does jump to caml_alloc1
englishm has quit [Quit: Leaving.]
<whitequark> and friends
englishm_ is now known as englishm
philtor has joined #ocaml
<ggole> Only for large allocations
<whitequark> but I'm not sure that you can override that symbol with LD_PRELOAD
<whitequark> caml_alloc1 is 1 word...
<ggole> Look at the assembly emitted for let x = x + 1.0
<ggole> ...or something that allocs a fixed-size object, anyway
<whitequark> I see
<ggole> A full function call for every alloc would be pretty heavy considering how extravagantly OCaml allocates.
<whitequark> well, a single call/ret pair, not much so
<ggole> And ditch every register around it?
morphles has quit [Ping timeout: 240 seconds]
<ggole> (Maybe you use a special convention though.)
<whitequark> no, just as a call to caml_allocN wouldn't do it
<whitequark> ocaml uses such a special convention.
<ggole> Yeah, that would cut down the cost a lot
<ggole> ...I wonder if the code size reduction could actually increase speed in some programs.
<ggole> Ah, -compact actually does that.
* ggole nods
<whitequark> -Os :)
<ggole> Ideally magical profiling pixies would pick the right choice at each site...
<whitequark> LLVM sorta has this infra
<whitequark> but it's rotting
<whitequark> → it's probably not that useful
<ggole> Seems like it would be hard to do a good job
<whitequark> it feeds back the results from an edge profiler
<whitequark> and then uses standard cold-call heuristics
<companion_cube> Drup: traverse is more than 'map and fold', isn't it? there's a functor involved
<companion_cube> err, an applicative
<Drup> you mean, Haskell's functor ?
<companion_cube> yes
<Drup> yeah, "map"
<companion_cube> (backlog on deriving "traverse" instances)
<companion_cube> no
<ggole> whitequark: do they make inlining decisions on that info, or anything like that?
<companion_cube> ah, you meant fold with an inner map?
tane has joined #ocaml
<Drup> I mean map as ('a -> 'b) -> 'a t -> 'b t
<whitequark> ggole: I think it's supposed to
<companion_cube> because the point of Traverse is that you have ('a -> 'b f) -> 'a t -> 'b t f if f:applicative and t:traversable
<companion_cube> and this is extremely cool
<Drup> that's a fold :p
<companion_cube> that's not a simple fold -_-
<Drup> (slightly disguised, but not much)
<companion_cube> I don't see how
<Drup> and anyway, I'm not going to try to fake type classes and haskell functors in ocaml, no point
<companion_cube> no, never said that
<companion_cube> but still, Traverse is more than a fold
<Drup> generating map and fold is useful enough.
pminten has quit [Remote host closed the connection]
<whitequark> def`: pls need implicits, when
<whitequark> eh. nevermind, you probably won't get the joke
<whitequark> (was trying to imitate people begging for jailbreaks)
<ggole> plz
<ggole> The saddest three characters on the internet.
<companion_cube> plz y no typeclss
<whitequark> ^ :D
<ggole> Let's have typeclasses, modules, Scala-style implicits *and* an object system! \o/
<companion_cube> \o/
<companion_cube> implicits are enough to implement typeclasses though
* whitequark looks at this (real) tweet
<whitequark> "Parametricity & how the typechecker can be ur friend"
<whitequark> >ur
<whitequark> ಠ_ಠ
<ggole> If you can be bothered to type "parametricity", surely you can splurge on a y and an o.
<whitequark> I think it's the 140 char limit
<whitequark> but the result deeply, deeply bothers me
<companion_cube> y u bothered brothered?
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
<companion_cube> looks like a recent anime
<whitequark> it is
<whitequark> Hitsugi no Chaika
<def`> whitequark: thankd for the joke explanatuon :). it's coming....
tidren has quit [Ping timeout: 264 seconds]
<companion_cube> I must have watched the first episodes
tristero has quit [Quit: tristero]
BitPuffin has quit [Ping timeout: 260 seconds]
michael_lee has quit [Quit: Ex-Chat]
<Drup> whitequark: the plot seems boring to tears x)
<whitequark> Drup: I didn't watch it though
* whitequark is re-watching Utena and *monogatari right now, which are as postmodern as it ever gets...
<Drup> heh :p
Hannibal_Smith has quit [Quit: Sto andando via]
* Drup is rewatching all of star trek next generation. :D
<whitequark> I got bored at the third season
<whitequark> it's probably the first thing that I dropped because I was literally falling asleep at mere sight
<Drup> x)
<whitequark> um.
<whitequark> "ptype_params: (core_type * variance) list;"
<whitequark> (* ('a1,...'an) t; None represents _*)
<whitequark> how exactly is 'a1..'an core_type?!
<Drup> Ptyp_constr
<whitequark> hm?
<whitequark> Ptyp_var, I presume
<whitequark> but why not just put a string there?
<whitequark> oh, I suppose because of Ptyp_any...
tidren has joined #ocaml
tidren_ has joined #ocaml
tidren has quit [Ping timeout: 260 seconds]
tidren_ has quit [Ping timeout: 240 seconds]
tristero has joined #ocaml
zpe has quit [Remote host closed the connection]
Eyyub has joined #ocaml
dsheets has joined #ocaml
<whitequark> Drup: added parametric type to Show!
<whitequark> I think Show is finished now.
<whitequark> take a look, write Eq, or something :3
<Drup> nice :)
<whitequark> let me give you access...
<whitequark> Done
<Drup> thanks
<Drup> I'm working on ocp-browser right now, so won't implement any ppx_deriving
Thooms has quit [Ping timeout: 260 seconds]
rand000 has quit [Ping timeout: 256 seconds]
morphles has joined #ocaml
tobiasBora_ has joined #ocaml
Eyyub has quit [Ping timeout: 240 seconds]
_0xAX has quit [Remote host closed the connection]
<whitequark> ok
troutwine has joined #ocaml
tobiasBora_ has quit [Read error: No route to host]
tobiasBora_ has joined #ocaml
<algoriddle> Sorry about the following idiotic question: I have two modules, a.ml and b.ml(i). A module uses some functions from B module. If I compile these, it's all fine. I use emacs with utop. I load a.ml into emacs, then send the contents to utop. It complains that it doesn't know about the definitions in b.ml(i). Can I get utop to load b.ml(i)?
<ggole> Sure, with #load
<ggole> Specifically, compile b.ml (and if it exists, b.mli) and then #load "b.cmo"
<algoriddle> ah, ok, that's the part I was missing
<algoriddle> thank you
<ggole> By the way, be careful sending text to the toplevel in emacs
<ggole> It's quite easy to end with up a stale definition
hhugo has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
<Algebr`> Say I have a Map, what's the easiest way to print it out?
<Algebr`> would something like Map.iter print_endline <myMap> work?
Thooms has joined #ocaml
tobiasBora_ has quit [Ping timeout: 250 seconds]
<Drup> not exactly, since Map.iter except a function that takes two arguments
<Drup> (the key and the value)
<Drup> print_endline takes one
<Drup> but you should be able to figure out something using Printf easily :)
<companion_cube> cough sequence cough
<Drup> companion_cube: stop being stealthy :p
alpounet has quit [Remote host closed the connection]
<companion_cube> ^^
<Drup> (and it's more of a CCPrint problème, here, but Core has something similar anyway, iirc)
alpounet has joined #ocaml
Eyyub has joined #ocaml
Thooms has quit [Ping timeout: 264 seconds]
<ggole> printf "<abstr>"
<ggole> Good enough for the toplevel!
tidren has joined #ocaml
alpounet has quit [Ping timeout: 256 seconds]
alpounet has joined #ocaml
tidren has quit [Ping timeout: 245 seconds]
troutwine is now known as troutwine_away
philtor has quit [Ping timeout: 260 seconds]
rand000 has joined #ocaml
Algebr` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
troutwine_away is now known as troutwine
tidren has joined #ocaml
alpounet has quit [Remote host closed the connection]
hhugo has quit [Quit: Leaving.]
troutwine is now known as troutwine_away
zpe has joined #ocaml
derek_c has joined #ocaml
<derek_c> what does the >>= operator do?
<companion_cube> it's not a builtin operator, but a user function
<companion_cube> so it depends on where it comes from
zpe has quit [Ping timeout: 245 seconds]
alpounet has joined #ocaml
Algebr` has joined #ocaml
<derek_c> companion_cube, I suspect it's define in Lwt, but I'm not sure...
<companion_cube> ah
<companion_cube> Lwt.(>>=) : 'a Lwt.t -> ('a -> 'b Lwt.t) -> 'b Lwt.t
<companion_cube> so, if you write a >>= fun x -> b, it means "once a completes, apply the function (fun x -> b) to its result" and the final result is b
<derek_c> companion_cube, oh, that sounds useful
<derek_c> companion_cube, thanks!
<companion_cube> that's extremely useful, yes
divyanshu has quit [Quit: Computer has gone to sleep.]
<companion_cube> you never block waiting for a value of type 'a Lwt.t
<companion_cube> rather, you use (>>=) to register your computation, that will run once the future completes
<Algebr`> Confused by this: [ `Duplicate_key of string | `Ok of 'a StringMap.t ], 1) this says its a list of Either Duplicate_key or Ok? 2) You can define variants on the fly with `? What is the type of Ok/Duplicate_key?
<companion_cube> it's not a list, it's a polymorphic variant
<companion_cube> that is indeed defined on the fly
<companion_cube> both `Duplicate_key "yolo" and `Ok some_string_map are valid values of this type
<Algebr`> companion_cube: but what exactly is the type of Duplicate_key?
divyanshu has joined #ocaml
<companion_cube> `Duplicate_key here is a variant constructor
azynheira has joined #ocaml
<companion_cube> (`Duplicate_key "yolo") is of type [ `Duplicate_key of string ]
<companion_cube> look for "polymorphic variants" in OCaml's manual
<Algebr`> companion_cube: is this something like haskell's data Maybe a = Nothing | Just a?
<companion_cube> in this case, it's somehow isomorphic to Haskell's Either type
tidren has quit [Remote host closed the connection]
tidren has joined #ocaml
<Drup> Algebr`: I linked you the relevant part of the manual the last time you asked the question, but I think you disconnected suddendly
<Algebr`> ah, yes, I was having connection troubles.
morphles has quit [Ping timeout: 255 seconds]
<Algebr`> so I can match on them too, would it be like match <somthing that gives [`Duplicate | `Ok] with | Duplicate -> <somelogic> | Ok -> <someLogic>
<companion_cube> you need the `
<Drup> it would be "with `Duplicate -> .. | `Ok -> ...
<companion_cube> match x with `Duplicate_key s -> ...
tidren has quit [Ping timeout: 260 seconds]
<Algebr`> is there an something analagous to ghci's :i in utop?
<Drup> remind me, what does it do ?
<Algebr`> like gives info on types, where they are defined
<Algebr`> and what their definition is
<companion_cube> in this case no type is defined
<Drup> I don't think so, then
<Algebr`> companion_cube: how can you have a variant without a type?
<companion_cube> it's purely structural
<companion_cube> like object types
FreeArtMan has joined #ocaml
<ggole> Variants belong to sets of types, really
<ggole> (Polymorphic variants, I mean.)
WraithM has joined #ocaml
alpounet has quit [Remote host closed the connection]
troutwine_away is now known as troutwine
alpounet has joined #ocaml
azynheira has left #ocaml ["Leaving"]
<algoriddle> hmmm, I #load a module's cmo into utop, no error, yet the module remains "unbound", any idea why that might be?
philtor has joined #ocaml
tobiasBora_ has joined #ocaml
alpounet has quit [Ping timeout: 264 seconds]
tane has quit [Quit: Verlassend]
divyanshu has quit [Quit: Textual IRC Client: www.textualapp.com]
derek_c has quit [Ping timeout: 245 seconds]
omqal has joined #ocaml
axiles has quit [Remote host closed the connection]
WraithM has quit [Ping timeout: 240 seconds]
girrig_ is now known as girrig
<companion_cube> algoriddle: I think you need to load a .cma
troutwine is now known as troutwine_away
englishm has quit [Ping timeout: 255 seconds]
Kakadu has quit [Quit: Konversation terminated!]
<algoriddle> thanks, i tried that too, same result. is there a way to make utop or ocaml more verbose? it doesn't say anything when i execute "#load".
<companion_cube> weird
<algoriddle> or a way to list all modules currently loaded?
<algoriddle> oh, I got it: it couldn't find some other file, i guess the cmti, perhaps
<algoriddle> cmi
<algoriddle> it needs both the cmo and the cmi, does that sound right?
<companion_cube> to me it needs .cma :>
<algoriddle> does the cma include the cmi as well?
<ggole> How are you compiling the files?
<ggole> ocamlbuild?
<algoriddle> corebuild, which i assume calls ocamlbuild
<companion_cube> you might need #directory commands
<companion_cube> if it looks for the .cmi ?
<ggole> Try #cd "_build" and then try again
<algoriddle> ok, yes, it works for the cmo/cmi now
<ggole> If that works, you need to add _build to the search path of utop with, say, -I on startup
<companion_cube> or use #directory
<algoriddle> although i wish it said something when it couldn't find the cmi
<algoriddle> ok, will look into those
<algoriddle> but i tried the cma loading on the compiler's ocamlcommand.cma
<ggole> I'm guessing that you did ocamlbuild foo.cmo
<ggole> Er, corebuild. Whatever.
<algoriddle> yes, sort of
<ggole> It might be easier to define a toplevel.mltop, from which you can ask whateverbuild to create a toplevel.top that contains all your junk.
<algoriddle> i actually compiled the main executable.byte and as a byproduct it generated the cmo/cmis for the dependent module
<algoriddle> yes, i see that is a common practice
<algoriddle> i will look into that
<algoriddle> but there's another thing here
<algoriddle> when i tried the cma loading, i was playing with this compiler library called ocamlcommand.cma
<algoriddle> which is part of the compiler package, but it's an internal library
<algoriddle> i see there are some interesting modules there, for example, loading cmt files and so on
<algoriddle> but none of this is exposed outside of the compiler
<algoriddle> so people (ocp-index, merlin) just copy all these files to their projects
<algoriddle> which is a bit bizarre, but anyway
<algoriddle> but i wanted to load this cma into the toplevel, but again, it just silently fails
<algoriddle> but a cma wouldn't require a separate cmi, right?
<algoriddle> so I'm still a bit stumped why i can't load the .cma into utop
<algoriddle> and so i'm wondering if there's a way to list what modules are loaded or to make the toplevel in any way more verbose or to log what it's doing
<ggole> Silently fails how?
Denommus has joined #ocaml
<Denommus> hi
Algebr` has quit [Remote host closed the connection]
<Denommus> can you recommend me a FRP library (I have preference for signal function instead of classic FRP)?
ollehar has quit [Ping timeout: 250 seconds]
<Drup> React
tobiasBora_ is now known as tobiasBora
<algoriddle> silently fails as in no error, but the modules in the cma are not available
philtor has quit [Ping timeout: 250 seconds]
<Denommus> does OCaml have a package manager?
<Denommus> I mean, is OPAM widely used?
<jpdeplaix> yes
<Denommus> great
<ggole> I'd guess that's a directory problem again
<algoriddle> is there a way to list the contents of a cma? just to make sure i'm looking at the right thing
<Drup> ocamlobjinfo
<ggole> I don't know anything about this library, but it's possible that you should be using #require
<Drup> algoriddle: the thing you are looking at right now is the exact reason why I don't even use #load for testing, I just install the library with ocamlfind and use #require
<algoriddle> ok, thanks
<algoriddle> ocamlobjinfo shows that i'm looking at the right cma (it includes the module i need: Cmt_format)
<algoriddle> ok, so i will try the #require method then
<algoriddle> (now i just need to figure out how to install a library with ocamlfind)
<Drup> which build systems are you using
<Drup> ?
<algoriddle> this particular library is part of the ocaml distribution, an internal library of the compiler from the look of it
<algoriddle> i just want to play with the code that reads the cmt(i) files
<Drup> it should be in compiler-libs then
Simn has quit [Quit: Leaving]
<Drup> execute "ocamlfind list | grep compiler-libs" in your terminal to see them
<Drup> you can #require them after that
<algoriddle> it is, oh my
<algoriddle> i got it, thanks
<Drup> no problem
<ggole> I don't see anything related to "command", though
FreeArtMan has quit [Ping timeout: 260 seconds]
<algoriddle> compiler-libs.common is the one i'm talking about
<algoriddle> it has a module called Cmt_format that i was looking for
<Drup> :)
<algoriddle> then why do merlin and ocp-index not use these libraries
<Drup> ask def` :D
<ggole> -_-
<algoriddle> both of those projects made a copy of these modules
manizzle has joined #ocaml
<Drup> I think it was not available on ocaml 3.12
<Drup> (not sure)
<def`> algoriddle: we hace our own version of the type-checker, official one + patchset
<def`> for this reason we can't rely on compiler provided one
<algoriddle> ok, but for reading the cmt files, you must use the version that's in the compiler, i would think
<def`> (official one is completely stateful and we have a set of modifications big enough that it is cheaper to fork rather than work around officiel lib)
<algoriddle> but that's ok, there might be a complex chain of dependencies here, that you have to worry about
<algoriddle> in any case, to read the cmt files, i can safely go with the compiler-libs version, can't I?
<def`> yes, that's why we support only 4.00, 4.01 and 4.02 in alpha
<def`> you can
<algoriddle> ok, thank you. and thanks for everyone for being so helpful.
philtor has joined #ocaml
<def`> np, you're welcome :)
<Denommus> I tried to make a simple game in a FRP library in Haskell (even trying to make my loop function being strictly evaluated), but the memory consumption was too big. Would OCaml be any better in this regard? Would strictness help?
<companion_cube> "maybe" ? :D
<Denommus> heh, ok
<companion_cube> I don't know if it wil be better, but at least it should be more predictable
<Denommus> maybe I could update the reference of the state in my top-level function, instead of generating a new state every interaction
<Denommus> did I say interaction? I meant iteration
<Drup> Don't fear the state.
<def`> Denommus: I found it much easier in ocaml, but still getting FRP right is hard
<Drup> (would make a good blog title)
<def`> maybe it'snjust of matter of taste, I should give a second try in haskell
tidren has joined #ocaml
NoNNaN has joined #ocaml
ggole has quit []
<Denommus> def`: there's a FRP game engine for Haskell. It's quite cool and easy. The only problem is memory consumption. I tried to bring it down, without success
<def`> Denommus: yep in this respect, it was really easy to predict behaviors in ocaml
<Drup> on the memory consumption side, React behaves ok
<Drup> except when you use it in javascript, you have a small leak there
<Drup> (because crappy javascript doesn't have proper weak pointers)
<def`> (worst, there are weaktable proposal in es6, but it's just private symbols, not enough to implement weakpointers :()
ollehar has joined #ocaml
philtor has quit [Ping timeout: 260 seconds]
<Denommus> meh
<Denommus> speaking of which, is there a ocaml compiler for JS or anything of the sorts? That would be interesting
<companion_cube> yes
<companion_cube> js_of_ocaml
<Drup> hey, I wouldn't say "in javascript" for an ocaml library otherwise :D)
<def`> support is really good, whole language is covered
<def`> (except weak pointers :))
<Denommus> cool
<Drup> there is an emulation for weak pointers
philtor has joined #ocaml
<Drup> using non weak ones
<Drup> (so, it leaks, obviously, but at least it works)
<Drup> (and it doesn't leak too much)
tidren has quit [Remote host closed the connection]
Gonzih has quit [Ping timeout: 240 seconds]
rand000 has quit [Quit: leaving]
tidren has joined #ocaml
derek_c has joined #ocaml
philtor has quit [Ping timeout: 245 seconds]
tidren has quit [Remote host closed the connection]
philtor has joined #ocaml
t4nk892 has joined #ocaml
<t4nk892> Hi guys, my name is Steve and I´m doing a project using OCaml. I´m a beginner so sorry for my ignorance on the subject, but I really need some help after having googled this for about a day and the interwebs have not turned up much :) How do I change a String Map into a list of [(key, value), ...] using Map.fold?
<t4nk892> if someone could push me in the right direction that´d be great
mort___ has joined #ocaml
<Drup> you sure you want to do it with fold ? (It's an exercise, I presume ?)
<Drup> Otherwise, Map.bindings do what you want
tidren has joined #ocaml
derek_c has quit [Ping timeout: 250 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<t4nk892> not sure i want to do it with fold, that´s just something I thought would help
<t4nk892> how would I do it with Map.bindings?
<Drup> what is the name of your map module ?
<t4nk892> module MMap = Map.Make (String);;
tidren has quit [Remote host closed the connection]
NoNNaN has quit [Ping timeout: 264 seconds]
<Drup> then "MMap.bindings my_little_map"
<Drup> it's still a good exercise to define it with a fold yourself, though :p
<companion_cube> learning how to do it with fold is interesting
<t4nk892> hehe thank you so much that worked perfectly :)
<t4nk892> using bindings
<t4nk892> i´m going to try implementing with fold myself, I tried to find an example online but nothing came up
tidren has joined #ocaml
bo1 has left #ocaml [#ocaml]
derek_c has joined #ocaml
gal_bolle has quit [Ping timeout: 264 seconds]
philtor has quit [Ping timeout: 255 seconds]
arquebus has joined #ocaml
ollehar has quit [Ping timeout: 250 seconds]
t4nk892 has quit [Ping timeout: 246 seconds]
troutwine_away is now known as troutwine
tidren has quit [Remote host closed the connection]
demonimin has quit [Ping timeout: 256 seconds]
englishm has joined #ocaml
englishm_ has joined #ocaml
t4nk946 has joined #ocaml
englishm has quit [Ping timeout: 240 seconds]
troutwine is now known as troutwine_away
philtor has joined #ocaml
darkf has joined #ocaml
philtor has quit [Ping timeout: 245 seconds]
philtor has joined #ocaml
tidren has joined #ocaml
Armael has quit [Quit: WeeChat 0.4.2]
Armael has joined #ocaml
Armael has quit [Client Quit]
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
Armael has joined #ocaml
arquebus has quit [Quit: Konversation terminated!]
troutwine_away is now known as troutwine
troutwine is now known as troutwine_away
troutwine_away is now known as troutwine
troutwine is now known as troutwine_away
philtor has quit [Ping timeout: 260 seconds]
NoNNaN has joined #ocaml