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…]
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.
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?