adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Upcoming OCaml MOOC: https://huit.re/ocamlmooc | OCaml 4.03.0 release notes: http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
veggie_ has quit [Ping timeout: 276 seconds]
igitoor has quit [Ping timeout: 250 seconds]
ethnopes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 250 seconds]
d0nn1e has joined #ocaml
d0nn1e has quit [Quit: ZNC - http://znc.in]
d0nn1e has joined #ocaml
d0nn1e has quit [Client Quit]
d0nn1e has joined #ocaml
fluter has quit [Ping timeout: 245 seconds]
nicholasf has joined #ocaml
brunoro has joined #ocaml
jao has quit [Remote host closed the connection]
d0nn1e has quit [Quit: ZNC - http://znc.in]
d0nn1e has joined #ocaml
brunoro has quit [Ping timeout: 256 seconds]
fluter has joined #ocaml
jao has joined #ocaml
d0nn1e has quit [Quit: ZNC - http://znc.in]
d0nn1e has joined #ocaml
d0nn1e has quit [Client Quit]
al-damiri has quit [Quit: Connection closed for inactivity]
d0nn1e has joined #ocaml
conrad4 has joined #ocaml
conrad4 has quit [Ping timeout: 252 seconds]
nomicflux has quit [Quit: nomicflux]
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 256 seconds]
fluter has quit [Ping timeout: 260 seconds]
jg_ has joined #ocaml
brunoro has joined #ocaml
fluter has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
<dxtr> Error: The external function `unix_has_symlink' is not available <-- Hmm, I'm getting that
veggie_ has joined #ocaml
nicholasf has quit [Remote host closed the connection]
<pierpa> you must link in the Unix lib
veggie_ has quit [Ping timeout: 252 seconds]
<dxtr> hmm, okay
FreeBirdLjj has joined #ocaml
wu_ng has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 265 seconds]
TarVanimelde has joined #ocaml
jonatin has quit [Quit: jonatin]
brunoro has joined #ocaml
TarVanimelde has quit [Quit: Leaving]
TarVanimelde has joined #ocaml
TarVanimelde has quit [Client Quit]
brunoro has quit [Ping timeout: 256 seconds]
govg has quit [Quit: leaving]
petroav_ has joined #ocaml
nicholasf has joined #ocaml
Nahra has quit [Remote host closed the connection]
AlexRussia has quit [Ping timeout: 265 seconds]
conrad4 has joined #ocaml
petroav_ has quit [Ping timeout: 260 seconds]
conrad4 has quit [Ping timeout: 260 seconds]
peddie has quit [Quit: peace!]
ygrek_ has quit [Ping timeout: 244 seconds]
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
petroav_ has joined #ocaml
veggie_ has joined #ocaml
nomicflux has joined #ocaml
brunoro has joined #ocaml
veggie_ has quit [Ping timeout: 245 seconds]
brunoro has quit [Ping timeout: 250 seconds]
MercurialAlchemi has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
nomicflux has quit [Quit: nomicflux]
DavidGu has joined #ocaml
petroav_ has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Ping timeout: 252 seconds]
brunoro has joined #ocaml
Algebr has joined #ocaml
brunoro has quit [Ping timeout: 245 seconds]
Algebr has quit [Ping timeout: 276 seconds]
FreeBirdLjj has joined #ocaml
madroach has quit [Ping timeout: 276 seconds]
madroach has joined #ocaml
nicholasf has quit []
veggie_ has joined #ocaml
veggie_ has quit [Ping timeout: 245 seconds]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
jg has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
jg_ has quit [Ping timeout: 244 seconds]
jao has quit [Ping timeout: 250 seconds]
conrad4 has joined #ocaml
conrad4 has quit [Ping timeout: 256 seconds]
egno has joined #ocaml
brunoro has joined #ocaml
struk|desk2 has quit [Ping timeout: 252 seconds]
brunoro has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
AlexDenisov has quit [Client Quit]
MercurialAlchemi has joined #ocaml
AlexDenisov has joined #ocaml
toolslive has quit [Quit: Leaving]
jnavila has joined #ocaml
ygrek_ has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
pierpa has quit [Ping timeout: 244 seconds]
FreeBirdLjj has joined #ocaml
dhil has joined #ocaml
kamog has quit [Remote host closed the connection]
TarVanimelde has joined #ocaml
Onemorenickname has joined #ocaml
<Onemorenickname> Hi people
<Onemorenickname> what's the best way to work with sets /and/ subsets ?
<Onemorenickname> because I don't think making a type for every kind of subset is a good idea
conrad4 has joined #ocaml
dhil has quit [Ping timeout: 252 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
conrad4 has quit [Ping timeout: 256 seconds]
zpe has quit [Ping timeout: 244 seconds]
AltGr has joined #ocaml
egno has quit [Ping timeout: 260 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 250 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dmi3y has joined #ocaml
<companion_cube> what do you call a subset?
Simn has joined #ocaml
<Onemorenickname> companion_cube, A subset of B if all elements of A are elements of B
<Onemorenickname> (implictely, I will work with sets of subsets)
<companion_cube> you mean at the typelevel ?
<companion_cube> if it's just about values, you can have only one type (`Set.S` for some instance of `Set.Make`)
<Onemorenickname> yep, at the typelevel
zpe has joined #ocaml
<Onemorenickname> for instance, what would be the type of a function which takes an arbitrary typed set, and return its subsets ?
<Onemorenickname> (well, the set of its subsets)
<companion_cube> the type system is not powerful enough for this
<companion_cube> types are not sets
<Onemorenickname> companion_cube, i see
<Onemorenickname> then, is there an efficient implementations of sets with functions manipulating a simple parametrized type ?
<Onemorenickname> (so far, I'm working with 'a list)
<Onemorenickname> like self-balanced trees are something like that
<companion_cube> no, Set uses a functor because it brings some guarantees about the ordering that is used
<companion_cube> in other words, if `module IntSet = Set.Make(...)`, two values of type `IntSet.t` will use the same comparison function, making `IntSet.union` (say) safe and efficient
<companion_cube> having polymorphic sets would be more dangerous
AlexDenisov has joined #ocaml
<Onemorenickname> companion_cube, indeed, I forgot about the "ordered" constraint.
<Onemorenickname> we can't have 'a types with constraint ?
<zozozo> well in case of sets, you would need to make the comparison function part of the type of the set, thus making it a dependent type
<companion_cube> Onemorenickname: you could, in theory, it's just that the stdlib made the safest choice (in a sense)
<Onemorenickname> zozozo : what's the problem with dependant types ?
<companion_cube> they are terribly complicated? :D
<zozozo> type inference become undecidable ?
<companion_cube> (no mainstream language provides them)
<companion_cube> (maybe Idris will become somehow popular, but for now it's a bit too much I think)
<Onemorenickname> zozozo : I see, but so are GADT
<zozozo> type checking might be problematic also (i.e. require use of solvers)
<Onemorenickname> (f* and dafny do so)
<Onemorenickname> but, by my question, I thought that maybe there was some subset of dependant types implemented in ocaml
<zozozo> yeah, but then you rely on the correctness of a solver
<Onemorenickname> and that there was a problem with them
<Onemorenickname> if there are no such types in ocaml, then the problem is simply that they don't exist in ocaml :D
<companion_cube> the problem with dependent types is not only that type inference is undecidable
<companion_cube> but also that type checking is, unless you have a notion of pure terminating functions in the language
<companion_cube> (since you should only embed pure, terminating expressions in types)
<companion_cube> (or be doomed)
<Onemorenickname> companion_cube, here, we did not nead dependant types (or their full power), we only needed to specify that one operation was doable on a given type
<Onemorenickname> which is a static property
<Onemorenickname> but i get what you mean, np
whisperedcigar has quit [Ping timeout: 245 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
larhat has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
<companion_cube> ah, well...
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
bgfc has joined #ocaml
mengu has joined #ocaml
TarV has joined #ocaml
TarVanimelde has quit [Ping timeout: 244 seconds]
zpe has joined #ocaml
jwatzman|work has joined #ocaml
whisperedcigar has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
<dxtr> Are there types for integers of specific sizes?
TarV has quit [Ping timeout: 260 seconds]
<dxtr> And signedness
<dxtr> I would like unsigned 16-bit integers
Nahra has joined #ocaml
<reynir> In the stdlib there's only Int32 and Int64, both signed.
ygrek_ has quit [Ping timeout: 256 seconds]
<reynir> Ctypes has Uint8_t, but I'm not sure what it is exactly
brunoro has joined #ocaml
calculemus has quit [Quit: WeeChat 1.6]
<copy`> There's ocaml-stdint
<copy`> opam search … is a good tool to find packages, by the way
brunoro has quit [Ping timeout: 250 seconds]
malc_ has joined #ocaml
calculemus has joined #ocaml
conrad4 has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fUD has joined #ocaml
brunoro has joined #ocaml
conrad4 has quit [Ping timeout: 265 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
TarVanimelde has joined #ocaml
brunoro has quit [Ping timeout: 276 seconds]
djellemah has quit [Ping timeout: 252 seconds]
djellemah has joined #ocaml
brunoro has joined #ocaml
AlexDenisov has joined #ocaml
ethnopes has joined #ocaml
brunoro has quit [Ping timeout: 276 seconds]
calculemus has quit [Remote host closed the connection]
calculemus has joined #ocaml
sh0t has joined #ocaml
Ravana- has quit [Quit: Goodbye for now!]
Ravana has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
Algebr has joined #ocaml
ethnopes has quit [Remote host closed the connection]
ethnopes has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
<ethnopes> i'm quite new to ocaml and i think i'm having a conceptual issue here: http://pastebin.com/ArEPBNgn
dhil has joined #ocaml
<ethnopes> i keep getting "expression has type bool but 'a -> bool was expected" on the last inner line. isn't the whole block 'a -> bool?
AlexRussia has joined #ocaml
<Algebr> where are these modules from, filenamempa, sys_utils, is this batteries?
DavidGu has quit [Remote host closed the connection]
<ethnopes> Algebr: sorry, those are from https://github.com/facebook/flow/blob/master/src/common/utils_js.ml . i'm trying to fix a small bug in a large codebase so i tried to not throw too much code in.
DavidGu has joined #ocaml
_andre has joined #ocaml
jg has quit [Ping timeout: 256 seconds]
adi____ has joined #ocaml
adi___ has quit [Ping timeout: 245 seconds]
adi____ is now known as adi___
FreeBirdLjj has joined #ocaml
brunoro has joined #ocaml
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Remote host closed the connection]
Guest57237 has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
<Drup> zozozo: dependent types don't require a solver
<Drup> at least not a smt solver, if that's what you are getting at
<zozozo> right, I must have confused it with something else
<Drup> if you add only some dependent features, such as type level ints, it's common so use a smt solver for them
<Drup> but full blown dependent types don't really use a solver, you just evaluate things during type checking ...
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 265 seconds]
<freehck> Hello people.
Guest57237 has quit []
<freehck> Could anyone help me to understand why types FieldId.t and FieldId.Map.Key.t are incompatible in this code: http://pastebin.com/EeEids0H
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jg has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
jg has quit [Ping timeout: 260 seconds]
AlexDenisov has joined #ocaml
FreeBirdLjj has joined #ocaml
AlexDenisov has quit [Client Quit]
<Drup> freehck: in your Id signature, you do not specify that Map.key and t are equals
<Drup> by adding the module type constraint Id, you turn everything abstract, hence your issues, you will also hide that Strid.t = string
<Algebr> Drup: was there a way to not having to repeat yourself in oasis for says opts?
<Algebr> or cclib? I have a if system(macosx)
<Drup> for opts, I put things in _tags directly
<Drup> about C stuff, I don't know
<Algebr> I have tried to learn ocamlbuild directly like 3 times now, each time a failure
<Drup> what kind of options do you want to add ?
<Algebr> library names, compilter flags, linker options, its fine and working just redunant
stux|RC-only has quit [Ping timeout: 248 seconds]
conrad4 has joined #ocaml
igitoor has joined #ocaml
<calculemus> 7ls
igitoor has quit [Changing host]
igitoor has joined #ocaml
conrad4 has quit [Ping timeout: 265 seconds]
whisperedcigar has quit [Ping timeout: 245 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
whisperedcigar has joined #ocaml
whisperedcigar has quit [Ping timeout: 245 seconds]
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
FreeBirdLjj has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
stux|RC-only has joined #ocaml
mpenet has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
wu_ng has quit [Ping timeout: 260 seconds]
malc_` has joined #ocaml
malc_ has quit [Ping timeout: 256 seconds]
malc_` is now known as malc_
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has joined #ocaml
mengu has quit [Changing host]
mengu has quit [Ping timeout: 265 seconds]
ethnopes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dhil has quit [Ping timeout: 260 seconds]
<freehck> Drup: So my problem is in the fact I wrote "Map.S"? And I have to specify that Map.Key.t is actually Id.t?
octachron has joined #ocaml
<freehck> Well, I still don't understand how to write it. Need to read more RWO. :(
FreeBirdLjj has quit [Remote host closed the connection]
<Drup> it should be "Map.S with type Key.t = t"
<octachron> freehck: a simple solution is to remove signature constraint (i.e. the ": Id" part in "module MakeId (M : Sexpable) : Id" )
mpenet has quit [Remote host closed the connection]
<freehck> octachron: but I need Id to make TypeId/FieldId separate types, not just aliases for StrId.
sh0t has quit [Remote host closed the connection]
<freehck> I think I should write something like "module Map = Map S with key = t"...
<freehck> *Map.S
<Drup> with type*
<Drup> but yes
mrvn has quit [Ping timeout: 276 seconds]
<freehck> Drup: module Map : Map.S with type Key.t = t
<freehck> Yay! :)
<Drup> you might want to export the fact that StrId.t is string
<Drup> (same technique)
jao has joined #ocaml
<freehck> Drup: what does it enable?
<Drup> depends how you use it :)
<Drup> but as it is, you can't really build values of your types
<Drup> (except via sexp, but ...)
<freehck> Drup: Well I hid the fact that TypeId.t is string because I don't want to search in TypeId.Map using ServiceId.t
<freehck> And I can build them from strings, cause Id include Stringable.
<Drup> yeah, but you use of/to_sexp
<Drup> it's not a great way to build values
<freehck> Drup: why?
<Drup> show me the code to build a ValueId.t
<freehck> let v1 = ValueId.of_string "(type-name value-name)";
<freehck> let v2 = ValueId.t_of_sexp @@ List [Atom "type-name"; Atom "value-name"];
brunoro has joined #ocaml
<freehck> Drup:
<Drup> don't you feel like this is crap ?
<freehck> No.
justanotherguy has joined #ocaml
justanotherguy has quit [Client Quit]
<freehck> I'm constructing Sexp-based DSL so I think the 2nd variant will be used the most.
<Drup> You go out of your way to avoid using stringly typed things, and then for creation, you revert to stringly type
jao has quit [Ping timeout: 250 seconds]
<Drup> consider the case where you already have ty of type TypeId.t, how do you build a ValueId ?
dmi3y has quit [Quit: dmi3y]
AlexDenisov has joined #ocaml
<Drup> you use to_sexp on ty, and of_sexp back. While you should probably have a function `create : TypeId.t * string -> ValueId.t`
brunoro has quit [Ping timeout: 250 seconds]
dmi3y has joined #ocaml
<Drup> (side note: you should probably ask for a compare function, instead of building one using to_string, serializing to strings to compare is going to be very slow)
jao has joined #ocaml
FreeBirdLjj has joined #ocaml
<freehck> Drup: yes, you're probably right that I should have asked for of/to_string and compare functions.
nomicflux has joined #ocaml
<freehck> But if I coerce some way that TypeId.t and ServiceId.t are strings, the compiler will be able to substitute TypeId.t with ServiceId.t, and this is not the behavior I wanted.
<Drup> I didn't say you should expose the definion of TypeId.t
jg has joined #ocaml
<Drup> I said your module should provide a way to actually build a function that doesn't force you to go through a serialization format
<freehck> Drup: k. You're right, I'll fix it right now.
shinnya has joined #ocaml
rgrinberg has joined #ocaml
noddy has quit [Ping timeout: 252 seconds]
dhil has joined #ocaml
<freehck> Drup: is it better now? http://pastebin.com/QvcceQpp
<freehck> Oh, what do I need Idable for? :)
d0nn1e has quit [Ping timeout: 250 seconds]
<Drup> hum, you still don't have a create funtion with that, don't you ?
d0nn1e has joined #ocaml
<freehck> Drup: I will always create them from sexps. But now compare is inherited.
FreeBirdLjj has quit [Remote host closed the connection]
conrad4 has joined #ocaml
jao has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
conrad4 has quit [Ping timeout: 245 seconds]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
profan has quit [Ping timeout: 248 seconds]
TheLemonMan has joined #ocaml
dhil has quit [Ping timeout: 260 seconds]
agarwal1975 has joined #ocaml
brunoro has joined #ocaml
mpenet has joined #ocaml
brunoro has quit [Ping timeout: 265 seconds]
yomimono has joined #ocaml
AlexDenisov has joined #ocaml
profan has joined #ocaml
bgfc has quit [Quit: Page closed]
dhil has joined #ocaml
noddy has joined #ocaml
adi___ has quit [Ping timeout: 250 seconds]
Sim_n has joined #ocaml
ekr has joined #ocaml
whisperedcigar has joined #ocaml
Simn has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has quit [Ping timeout: 245 seconds]
MasseR has quit [Ping timeout: 276 seconds]
jnavila has quit [Quit: It was time]
yomimono has quit [Ping timeout: 245 seconds]
yomimono has joined #ocaml
AlexDenisov has joined #ocaml
jnavila has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 250 seconds]
letaris has joined #ocaml
brunoro has joined #ocaml
MasseR has joined #ocaml
brunoro has quit [Ping timeout: 250 seconds]
al-damiri has joined #ocaml
ekr has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
marsam has joined #ocaml
ahf has quit [Excess Flood]
ahf has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
noddy has quit [Ping timeout: 250 seconds]
Mercuria1Alchemi has joined #ocaml
chris2 has quit [Ping timeout: 260 seconds]
conrad4 has joined #ocaml
conrad4 has quit [Ping timeout: 252 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
noddy has joined #ocaml
chris2 has joined #ocaml
DavidGu1 has joined #ocaml
DavidGu has quit [Ping timeout: 252 seconds]
DavidGu1 is now known as DavidGu
AlexDenisov has joined #ocaml
whisperedcigar has quit [Ping timeout: 245 seconds]
ryanartecona has joined #ocaml
DavidGu has quit [Quit: DavidGu]
brunoro has joined #ocaml
mpenet has quit [Remote host closed the connection]
veggie_ has joined #ocaml
brunoro has quit [Ping timeout: 256 seconds]
tane has joined #ocaml
dmi3y has quit [Quit: dmi3y]
soupault has joined #ocaml
soupault has quit [Remote host closed the connection]
jnavila has quit [Quit: It was time]
johnf_ has joined #ocaml
<Leonidas> hmm, where do I get dbunzli's carcass from?
Onemorenickname_ has joined #ocaml
Onemorenickname has quit [Ping timeout: 252 seconds]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
larhat has quit [Ping timeout: 252 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
ethnopes has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
rwmjones is now known as rwmjones_hols
yomimono has quit [Ping timeout: 260 seconds]
brunoro has joined #ocaml
marsam has quit [Read error: Connection reset by peer]
marsam has joined #ocaml
brunoro has quit [Ping timeout: 245 seconds]
sh0t has quit [Remote host closed the connection]
noddy has quit [Ping timeout: 260 seconds]
dhil has quit [Ping timeout: 260 seconds]
eh_eff has joined #ocaml
pierpa has joined #ocaml
pierpa` has joined #ocaml
pierpa has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
pierpa` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Algebr has quit [Ping timeout: 260 seconds]
pierpa has joined #ocaml
conrad4 has joined #ocaml
ethnopes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conrad4 has quit [Ping timeout: 250 seconds]
ethnopes has joined #ocaml
sh0t has joined #ocaml
dmi3y has joined #ocaml
jg has quit [Ping timeout: 250 seconds]
marsam has quit [Read error: Connection reset by peer]
marsam has joined #ocaml
noddy has joined #ocaml
dhil has joined #ocaml
adi___ has joined #ocaml
Algebr has joined #ocaml
tane has quit [Quit: Leaving]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
hugomg has joined #ocaml
hugomg has quit [Read error: Connection reset by peer]
hugomg has joined #ocaml
hugomg has quit [Read error: Connection reset by peer]
smondet has joined #ocaml
TheLemonMan has joined #ocaml
octachron has quit [Quit: Page closed]
<Algebr> with Toploop.execute_phrase, how can I get the result of that evaluation?
yomimono has joined #ocaml
zpe has joined #ocaml
Onemorenickname_ has quit [Read error: Connection reset by peer]
<Algebr> does it add things to the std formmater in Format? Then how can I get that result
fUD has quit [Quit: Connection closed for inactivity]
<Drup> short answer: you can't (if only because the result of evulation might not be a value)
<Algebr> how does utop do it
<Drup> iirc, it doesn't, really
<Algebr> I want to eval ML code like a repl and get the result
<Drup> so, you can bound identifiers and the use `eval_path` or things like that
<Drup> then*
<Algebr> ffs
<Drup> yeah, the toploop's API is a tad arcane
<Algebr> then I want to use utop as an api
<Algebr> to take ocaml string and give me back whatever it would have done
<Algebr> after evaling it
<Algebr> but not seeing that functionality exposed
<Drup> have you considered using metaocaml ?
<Algebr> no
<Algebr> I want a simple eval: string -> string
frankpf has joined #ocaml
<Drup> oh, you want a *string* back ?
<Drup> not an Obj.t ?
<Drup> (or whatever, but at least an ocaml value)
slash^ has joined #ocaml
<Algebr> Obj.t would be fine as well I take it but at least as POC a string back is fine
<Algebr> hence I thought I could pull it out from the std_formatter
marsam has quit [Read error: Connection reset by peer]
<Drup> if that's the case, then just `Format.asprintf "%a" (fun ppf x -> ignore @@ Toploop.execute_phrase b ppf x)`
noddy has quit [Ping timeout: 250 seconds]
<Algebr> I forgot, whats the bool for in execute_phrase?
<Drup> no idea :D
<Algebr> ah, it controls whether or not something comes out lol
<Algebr> nice
<Algebr> this is exactly what I wanted for a poc: eval "10 + 10;;";; - : string = "- : int = 20\n"
<Algebr> Thanks Drup!!!
<Drup> (now I'm wondering what you are doing)
<Algebr> you'll see
<flux> "you'll see... you shall ALL see... muahahaha" ?
<Algebr> lol
<Algebr> this is gonna be funny
kakadu has joined #ocaml
<Algebr> sigh, seriously? /Users/Edgar/.opam/working/lib/ocaml/compiler-libs/ocamltoplevel.cmxa
<Algebr> Error: Cannot find file
sh0t has quit [Remote host closed the connection]
<Algebr> even though I gave compiler-libs.toplevel
nomicflux has quit [Quit: nomicflux]
<Algebr> oh duh, can't do ocamlopt
<Algebr> if only something gave a more useful error message
<Algebr> ah, TIL that {||} keeps even shell sequences as raw
<Algebr> oh how I wish there was a simple string.begins_with function
nomicflux has joined #ocaml
dmi3y has quit [Quit: dmi3y]
<Drup> CCString.prefix ? :3
<Leonidas> Astring.Sub.is_prefix? :3
<reynir> YetAnotherStdlib.is_it_really_a_prefix
<Algebr> ah, I was looking in astring and didn't find it
<Leonidas> There is surely a Core_kernel variant :-)
<Algebr> is_prefix, completely not used in any other string api of any other language
<Drup> I find the name quite natural
<Leonidas> same. Maybe not as descriptive as starts_with, but not bad
<Algebr> its not bad, but its not in line with other language's string apis
<Leonidas> I think Ruby's inject is probably the worst name for reduce/fold that there is.
<reynir> wow
<reynir> that's an interesting name
dmi3y has joined #ocaml
<Algebr> and ruby's filter is called......selecte
<Algebr> select*
<Drup> an amusing name is to collect how "bind" is named each time it's reinvented
<Leonidas> I guess it injects a value into the accumulator, but that's kinda a weird descriptin.
<Drup> game*
johnf_ has quit [Read error: Connection reset by peer]
johnf_ has joined #ocaml
letaris has quit [Ping timeout: 250 seconds]
yomimono has quit [Quit: Leaving]
noddy has joined #ocaml
<Algebr> oh its alive
ryanartecona has quit [Quit: ryanartecona]
jao has joined #ocaml
octachron has joined #ocaml
conrad4 has joined #ocaml
conrad4 has quit [Ping timeout: 250 seconds]
rgrinberg has joined #ocaml
veggie_ has quit [Ping timeout: 245 seconds]
frankpf has quit [Ping timeout: 250 seconds]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 245 seconds]
veggie_ has joined #ocaml
<Drup> Algebr: it doesn't transfer value, right ?
<Algebr> between the two worlds?
slash^ has quit [Read error: Connection reset by peer]
<Algebr> no yet
<Algebr> not*
<Algebr> I need to figure that out on the javascriptcore side
<Drup> that would be amusing :3
<Drup> (and much much harder ^^')
<Algebr> yea lol, I know. I was trying to figure it out a few months ago but had to put it on side burner
<Algebr> I'm thinking of using GADTs to model the unitype of the JS side
AltGr has left #ocaml [#ocaml]
<Algebr> this is enough however for me, was thinking of making an OCaml clone of the nodejs express web framework
<Algebr> because with this I can render react on the server side in an OCaml server
<Algebr> Which is insanely awesome
<Algebr> but another thing I wanted is that I'm teaching new programmers and when you open up in nodejs say some_array., you see all the methods
<Algebr> but they don't say what they do
<Drup> wrt GADT to model values, the work ocamlpro people did for the MOOC environment is of interest
<Drup> (they do something similar for the grading of student's exercises)
<Algebr> so thinking of making an ocaml program that evals javascript and then when someone does foo.push it prints out with linenoise's hint a doc string from Mozilla developer network the doc string for the method, aka push
<Algebr> Is there a link for that source code?
<Drup> yeah, it's all on ocamlpro's github
<Drup> (there is a short paper+presentation in OCaml's workshop too)
<Algebr> I can probably find the former, but link to the latter?
zpe has quit [Remote host closed the connection]
pyx has joined #ocaml
pyx has quit [Client Quit]
zpe has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
nomicflux has quit [Quit: nomicflux]
<Algebr> ahhh, thanks!!
<Drup> I think you could do something a bit more violent, though
nomicflux has joined #ocaml
<Algebr> listening
<Drup> like injecting values in the OCaml environment, and figuring out the type by typeof on the js value
zpe has quit [Ping timeout: 276 seconds]
<Drup> I don't see a way to really share values unless you use jsoo, unfortunatly
<Algebr> I thought about this
<Algebr> and went down the path, but it ended up being a mess, but I can do it, just need more time on it
dhil has quit [Ping timeout: 244 seconds]
<Algebr> next step, integrate a python repl
<Algebr> why not
<Drup> as before, the difficulty is to share values :p
<Algebr> yep
rgrinberg has quit [Ping timeout: 244 seconds]
<Drup> (all the typing issues can be solved by abusing the fact that you can access the typing environment dynamically in a toplevel)
<Algebr> well the endgoal isn't the repl but in a compiled program sharing values
<Algebr> ocaml doesn't give me the flexibilty that objective-c did, aka making new types and such at runtime
<Algebr> which kinda sucks for creativity, but oh well
<Drup> Well, that's an important design decision of OCaml
agarwal1975 has joined #ocaml
<Algebr> ya, eh, its limiting
_andre has quit [Quit: leaving]
rgrinberg has joined #ocaml
veggie_ has quit [Ping timeout: 265 seconds]
ryanartecona has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
veggie_ has joined #ocaml
brunoro has joined #ocaml
frankpf has joined #ocaml
brunoro has quit [Ping timeout: 256 seconds]
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
letaris has joined #ocaml
nomicflux has quit [Read error: Connection reset by peer]
agarwal1975 has quit [Quit: agarwal1975]
agarwal1975 has joined #ocaml
average has quit [Ping timeout: 260 seconds]
average has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
nomicflux has joined #ocaml
eh_eff has quit [Ping timeout: 276 seconds]
conrad4 has joined #ocaml
conrad4 has quit [Ping timeout: 260 seconds]
Algebr has quit [Ping timeout: 260 seconds]
ethnopes has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 245 seconds]
nomicflux has quit [Quit: nomicflux]
octachron has quit [Quit: Leaving]
dmi3y has quit [Quit: dmi3y]
frankpf has quit [Ping timeout: 276 seconds]
nomicflux has joined #ocaml
letaris has quit [Ping timeout: 265 seconds]
jao has quit [Ping timeout: 245 seconds]
jao has joined #ocaml
letaris has joined #ocaml
ethnopes has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
Sim_n has quit [Quit: Leaving]
rgrinberg has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
Muzer has quit [Excess Flood]
brunoro has joined #ocaml
Muzer has joined #ocaml
brunoro has quit [Ping timeout: 256 seconds]
ryanartecona has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
agarwal1975 has quit [Quit: agarwal1975]
Algebr has joined #ocaml
jmiven_ has joined #ocaml
Algebr has quit [Ping timeout: 244 seconds]
conrad4 has joined #ocaml
emias has quit [Ping timeout: 245 seconds]
emias has joined #ocaml
conrad4 has quit [Ping timeout: 265 seconds]
kakadu has quit [Remote host closed the connection]
fUD has joined #ocaml
brunoro has joined #ocaml
rgrinberg has joined #ocaml
eh_eff has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
smondet has quit [Ping timeout: 260 seconds]
Algebr has joined #ocaml
eh_eff has quit [Ping timeout: 256 seconds]
theblatte has quit [Ping timeout: 245 seconds]
rgrinberg has quit [Ping timeout: 252 seconds]
Algebr has quit [Ping timeout: 256 seconds]
theblatte has joined #ocaml