wormphlegm has quit [Read error: Connection reset by peer]
wormphlegm has joined #ocaml
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
gnuvince has quit [Read error: No route to host]
gnuvince has joined #ocaml
Catnaroek has quit [Quit: leaving]
PM has quit [Ping timeout: 246 seconds]
Catnaroek has joined #ocaml
cdidd has joined #ocaml
q66 has quit [Quit: Quit]
weie has joined #ocaml
PM has joined #ocaml
othiym23 has quit [Ping timeout: 260 seconds]
othiym23 has joined #ocaml
gnuvince has quit [Read error: No route to host]
gnuvince has joined #ocaml
PM has quit [Ping timeout: 246 seconds]
PM has joined #ocaml
pango_ has joined #ocaml
pango has quit [Ping timeout: 240 seconds]
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
Obfuscate has quit [Ping timeout: 246 seconds]
Obfuscate has joined #ocaml
Catnaroek has quit [Quit: leaving]
inv has quit [Ping timeout: 246 seconds]
inv has joined #ocaml
r126l has quit [Ping timeout: 246 seconds]
mye has quit [Quit: mye]
r126l has joined #ocaml
pango_ has quit [Remote host closed the connection]
mcclurmc has quit [Ping timeout: 255 seconds]
jewel has joined #ocaml
Catnaroek has joined #ocaml
gour has joined #ocaml
Catnaroek has quit [Quit: leaving]
Yoric has joined #ocaml
<adrien>
morning wmeyer
<adrien>
erf
<adrien>
that was "morning"
<adrien>
and
<adrien>
I'm going to post a revision of my cross-compilation patches on mantis too but 10 revisions and 20 patches, I'm not sure mantis will handle that well
<adrien>
well, it won't crash but it will be annoying to check
<adrien>
so make a tar of all the files for a given revision of the patches? I don't think mantis will be able to display that inline in the page but that might be nicer to the readers
<adrien>
suggestions?
<adrien>
wmeyer: ^ :-)
nickmeharry has quit [Quit: Leaving.]
eni has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
eni has quit [Ping timeout: 264 seconds]
Yoric has quit [Ping timeout: 246 seconds]
mcclurmc has joined #ocaml
Yoric has joined #ocaml
myx has joined #ocaml
ikaros has joined #ocaml
xavierm02 has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
tane has joined #ocaml
mye has joined #ocaml
Submarine has quit [Quit: Leaving]
nickmeharry has joined #ocaml
pango has joined #ocaml
justdit has joined #ocaml
<xavierm02>
hey
<xavierm02>
I have a .mll and a .mly files
<xavierm02>
and they seem to work
<xavierm02>
the compiler doesn't say anything
<xavierm02>
but whenever I use them, the program seems to crash silently...
<xavierm02>
Nothing after the line using it gets executed but I get no error...
milosn has quit [Remote host closed the connection]
justdit has quit [Ping timeout: 265 seconds]
<wmeyer>
adrien: yes, tarball would be fine, taking into account number of revisions. Otherwise you could provide a tarball and coaelsced patch for easier reviewing.
<adrien>
cross-patches-rev2-2012-12-29.tar.gz :-)
<wmeyer>
ok, thx :-)
<adrien>
I hope I'm mostly done with the changes to configure because shell scripting is horribly tiring
<wmeyer>
yeah it is
<wmeyer>
I will have more thorough look later today on your patches. We should have a build bot, because OCaml works on an enormous number of configurations..
justdit_ has quit [Read error: Connection reset by peer]
<adrien>
agreed
<adrien>
btw, the patches that are more dangerous start at the one which introduces -(-)target
<wmeyer>
OK
<adrien>
I'm still only starting on the x-compile support ;-)
<asmanur>
is there a syntactically light way of mixing recursive definitions of classes and modules/types ?
<asmanur>
(class foo = object .. end and type t = Foo)
<wmeyer>
asmanur: only through recursive modules
<asmanur>
i thought of them but I hoped there were a lighter way :/
<pippijn>
I'm not a fan of recursive module syntax, either
<pippijn>
especially the part where you have to write an explicit interface for everything
<asmanur>
yes
<pippijn>
which is even worse for classes
<asmanur>
perhaps i can get away with class ['a] foo = ... ;; type t= ... and u = t foo
<pippijn>
if you can, that would be swell
eni has joined #ocaml
<fasta>
How is it possible that I can do completion on Expect.expect_matc to Expect.expect_match in utop, but at the same time not do Expect.expect_match;;?
<diml>
fasta: because it is a type?
<fasta>
diml: yes, thanks.
<fasta>
diml: are you the utop developer?
<diml>
fasta: yes
<fasta>
diml: can you color the results perhaps? With a color legend to say 'blue is a type' for example?
<fasta>
Is there any standard command to get the documentation for a given function?
<diml>
it is not easy to know what is a type and what is a value
<diml>
there may be a value and a type with the same name
<fasta>
diml: doesn't the compiler expose that information anywhere now?
<fasta>
diml: where does utop gets it information now?
<fasta>
get*
<diml>
fasta: while typing a phrase utop just lexes it and look around the cursor position
ikaros has quit [Quit: Ex-Chat]
<diml>
the phrase is not even complete so it is not possible to parse and type it
<fasta>
diml: if something has tab completed, it is complete.
<diml>
fasta: you also need the context
<fasta>
diml: Anyway, I would like Expect.expect_match;; <press enter> to tell me something intelligent.
<fasta>
diml: it's clearly possible to do that.
<fasta>
In this case, it should just say 'you are trying to execute a type'.
<xavierm02>
pippijn: Right, sorry for being blind >_<
emmanuelux has quit [Ping timeout: 248 seconds]
<fasta>
Where does opam leaves the documentation for a package, if anywhere?
<fasta>
I am thinking of the ocamldoc generated pages.
<vbmithr>
~/.opam/<compil>/{doc,man}
<vbmithr>
~/.opam/<compil>/share/doc as well
suyu has quit [Quit: suyu]
<vbmithr>
It’s not standardized afaik
ontologiae has joined #ocaml
<mk270>
wmeyer: what was all this about a wiki for ocaml.org? (i ask as pull requests seem not to be a convenient way of contributing content)
<wmeyer>
mk270: in progress
<wmeyer>
pull requests have some advantages and disadvantages
eni has quit [Ping timeout: 248 seconds]
ulfdoz_ has joined #ocaml
oriba has joined #ocaml
ulfdoz has quit [Ping timeout: 252 seconds]
ulfdoz_ is now known as ulfdoz
<xavierm02>
when I'm matching something, can I use a variable to represent the type?
<xavierm02>
And example would be
<xavierm02>
a function negate_varaibles
<xavierm02>
applied on a boolean expression
<xavierm02>
it'd do
<xavierm02>
| Var n -> Not (Var n)
<xavierm02>
|Not (Var n) -> Var n
<xavierm02>
| And l -> And (List.map negate_variables l)
<xavierm02>
| Or l -> Or (List.map negate_variables l)
<xavierm02>
is there some way
<xavierm02>
I coudl regroupe the one for Or and the one for And?
<xavierm02>
something like
<xavierm02>
| 'a l with 'a = And or 'a = Or -> 'a (List.map negate_variables l)
<xavierm02>
which obviously doesn't work
<wmeyer>
xavierm02: nope, the data constructors are not first class
<xavierm02>
how can I do it then?
<xavierm02>
modify the type definition?
<xavierm02>
type base_boolean_expression =
<xavierm02>
| Var of int
<xavierm02>
| Not of base_boolean_expression
<xavierm02>
| And of base_boolean_expression list
<xavierm02>
| Or of base_boolean_expression list
<xavierm02>
;;
<xavierm02>
something like
<wmeyer>
you could have type t = UnOp of op * t list and type op = And | Or
<wmeyer>
so the And and Or are singletons
<xavierm02>
And_or_Or of boolean * (base_boolean_expression list)
<xavierm02>
k
<xavierm02>
ty :)
<wmeyer>
usually you want to say Logical of log_op * boolean
<xavierm02>
shouldn't it be BinOp rather?
<wmeyer>
oh yes
<wmeyer>
sorry
<xavierm02>
k
<xavierm02>
ty :)
mcclurmc has quit [Ping timeout: 252 seconds]
<xavierm02>
is there any way to keep being able to use And ?
<xavierm02>
I'd say no
<xavierm02>
but it'd be great a:/
<xavierm02>
it would mean defining a constructor that's a subcase of another constructor in the type definition
<xavierm02>
while still being able to match it with the "parent" constructor
<wmeyer>
xavierm02: No, I think Scala has it in some ways. What you can do is to define a separate type for your cases, and then use that type. Other solution is to use polymorphic variants
<xavierm02>
if I define another type
<xavierm02>
it means I have to convert every single time
fraggle_ has quit [Ping timeout: 265 seconds]
<xavierm02>
just because I'm too lazy to write BinOp And instead of And
<xavierm02>
so since I'm lazy, I won't convert ^.^
<xavierm02>
and how could polymorphic variants help?
cdidd has joined #ocaml
jewel has quit [Ping timeout: 252 seconds]
<xavierm02>
type 'operator binary_operator =
<xavierm02>
| And of base_boolean_expression list
<xavierm02>
| Or of base_boolean_expression list
<xavierm02>
and
<xavierm02>
base_boolean_expression =
<xavierm02>
| Var of int
<xavierm02>
| Not of base_boolean_expression
<xavierm02>
| BinOp of 'operator binary_operator
<xavierm02>
;;
<xavierm02>
something like this?
<xavierm02>
with a constraint on 'operator ofc
mcclurmc has joined #ocaml
<xavierm02>
ok I understood how polymorphic variants would help
<xavierm02>
ty once again :)
Zerker has quit [Quit: Colloquy for iPad - Timeout (10 minutes)]
emmanuelux has joined #ocaml
<mk270>
wmeyer: the disadvantage seems to be that people can bikeshed instead of merge + amend
<wmeyer>
mk270: yeah, perhaps agree in principle, but wiki also requires maintaiance - lower treshhold of applying changes, means sometimes lower quality
Catnaroek has joined #ocaml
Catnaroek has quit [Client Quit]
Catnaroek has joined #ocaml
<xavierm02>
I'm playing with gadts
<xavierm02>
And I have a strange syntax error
<xavierm02>
oh wait
<xavierm02>
no
<xavierm02>
I'm stupid don't mind me
<xavierm02>
before I start rebuilding everything
<xavierm02>
does this seem right to someone?
<xavierm02>
type binary_operator = And | Or;;
<xavierm02>
type _ boolean_expression =
<xavierm02>
| Var : int -> int boolean_expression
<xavierm02>
| Not : 'a boolean_expression -> 'a boolean_expression boolean_expression
<xavierm02>
| BinOp : binary_operator * 'a boolean_expression list -> (binary_operator * 'a list) boolean_expression
<xavierm02>
;;
ikaros has joined #ocaml
iZsh has quit [Quit: Coyote finally caught me]
<nicoo>
xavierm02: What are you trying to do ?
BiDOrD has joined #ocaml
<nicoo>
Because that type looks weird :o
BiDOrD_ has quit [Ping timeout: 264 seconds]
Catnaroek has quit [Ping timeout: 264 seconds]
Catnaroek has joined #ocaml
<wmeyer>
xavierm02: I like that people start using GADTs in their code, and I think we generally should favoour them over normal data types. Your GADT constructor is indeed a bit complicated. I don't really think you need even a type variable for that. Define the GADT witouh type variable, then think about encoding more invariants in the type.
<xavierm02>
Well
<xavierm02>
nicoo
<xavierm02>
I'm trying to do two things at once
<xavierm02>
1) have BinOp to represent And and Or operators so that I can either do a function that does the same thing for both (use_associativity) or different things depending on which one it is (distribute_or)
<xavierm02>
2) know whether the variables are properly indexed
<xavierm02>
or not
<xavierm02>
if I have n variables
<xavierm02>
I want them going from 0 to (n-1) because it helps for some algorithm
<xavierm02>
but for others I don;t need that
<wmeyer>
xavierm02: It depends, how you encode things. Maybe, for the initial AST list sounds good, but I'd prefer simple BinOp : bin_op * t * t -> t data constructor
<wmeyer>
then you can have associativity encoded easily
<xavierm02>
you mean
<xavierm02>
have 2 operands
<xavierm02>
instead of an arbitrary number?
<wmeyer>
(sometimes it matters, in eager language you want the second branch to be called by name)
<wmeyer>
the second benefit is that your AST can be wrong
<xavierm02>
eh?
<wmeyer>
you can have And operation on empty or one element list
<xavierm02>
yes
<xavierm02>
but removing thos is easy
<xavierm02>
well
<xavierm02>
I used list because it makes iteration a lot easier :/
<wmeyer>
yes, removing is easy, keep in mind however it will be removed at runtime
<xavierm02>
okay
<wmeyer>
and not guaranteed by type checker
<wmeyer>
so you are making an assumption
<xavierm02>
and
<wmeyer>
xavierm02: iteration over binop is also easy
<wmeyer>
to build it from list, use List.fold
<wmeyer>
to build it from list, use List.fold_left or fold_right
<xavierm02>
yeah
<xavierm02>
but
<wmeyer>
to map, you also need a custom iterator, as it's a tree
<xavierm02>
I don't want to have 2 different types
<xavierm02>
:/
<wmeyer>
which types?
<xavierm02>
well
<xavierm02>
one with a representation with lists
<wmeyer>
it's damn cheap to have several asts in ML!
<xavierm02>
and one with "really binary" operators
<xavierm02>
yes
<wmeyer>
no problem with that; if you provide a lower function
<xavierm02>
blower function = ?
<wmeyer>
people should "abuse" ASTs really :)
<xavierm02>
lower*
<wmeyer>
even with the overhead of implementing a module
<wmeyer>
or pretty printer etc.
<xavierm02>
I don't get what you're saying
<xavierm02>
I have one AST
<xavierm02>
you mean I should have several?
<xavierm02>
if I do, I constantly have to convert from one another
<xavierm02>
if I use the "best" one for each algorithm
<xavierm02>
and the cost of transforming it must be kind of high
<xavierm02>
I'm going to go with "really binary" operators