00:10
mye_ has joined #ocaml
00:12
mye has quit [Ping timeout: 240 seconds]
00:12
mye_ is now known as mye
00:14
watermind has quit [Quit: Konversation terminated!]
00:34
suyu has quit [Quit: suyu]
00:35
suyu has joined #ocaml
00:48
suyu has quit [Quit: suyu]
01:06
tac has quit [Quit: Page closed]
01:19
madroach has quit [Ping timeout: 244 seconds]
01:19
hcarty has quit [Ping timeout: 255 seconds]
01:19
hcarty has joined #ocaml
01:20
madroach has joined #ocaml
01:23
suyu has joined #ocaml
01:39
tane has joined #ocaml
01:49
tane has quit [Quit: Verlassend]
02:31
fantasticsid has joined #ocaml
02:36
nickmeharry has quit [Quit: Leaving.]
02:44
Yoric has joined #ocaml
02:46
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
02:57
hcarty has quit [Ping timeout: 255 seconds]
02:57
hcarty has joined #ocaml
02:59
q66 has quit [Quit: Quit]
03:07
Yoric has quit [Ping timeout: 252 seconds]
04:34
ontologiae has joined #ocaml
04:42
wormphle1m has quit [Ping timeout: 255 seconds]
04:42
<
pippijn >
wmeyer: you can also just return pointers cast to value
04:42
wormphlegm has joined #ocaml
04:42
<
pippijn >
the GC won't touch it
04:43
<
pippijn >
custom block is for GC'able C pointers
04:46
milosn has quit [Ping timeout: 255 seconds]
04:47
milosn has joined #ocaml
04:51
lolcathost has joined #ocaml
05:07
ontologiae has quit [Ping timeout: 265 seconds]
05:31
Yoric has joined #ocaml
05:35
pkrnj has quit [Quit: Computer has gone to sleep.]
05:39
weie has joined #ocaml
05:41
pkrnj has joined #ocaml
06:04
tac has joined #ocaml
06:12
gour has joined #ocaml
06:20
ontologiae has joined #ocaml
06:21
eni has joined #ocaml
06:25
ontologiae has quit [Ping timeout: 245 seconds]
06:30
tac has quit [Quit: Page closed]
06:30
tac has joined #ocaml
06:45
Kakadu has joined #ocaml
06:55
milosn has quit [Ping timeout: 255 seconds]
07:03
milosn has joined #ocaml
07:09
wormphlegm has quit [Read error: Connection reset by peer]
07:10
wormphlegm has joined #ocaml
07:14
eni has quit [Ping timeout: 264 seconds]
07:27
mcclurmc has quit [Ping timeout: 245 seconds]
07:33
cdidd has joined #ocaml
07:48
eni has joined #ocaml
08:15
tac has quit [Ping timeout: 245 seconds]
08:22
cdidd has quit [Ping timeout: 245 seconds]
08:23
cdidd has joined #ocaml
08:32
suyu has quit [Quit: suyu]
08:32
cdidd has quit [Ping timeout: 252 seconds]
08:43
cdidd has joined #ocaml
09:01
cdidd has quit [Read error: Connection reset by peer]
09:36
jewel has joined #ocaml
09:54
myx has joined #ocaml
10:50
yezariaely has quit [Quit: changing servers]
10:51
yezariaely has joined #ocaml
10:52
asmanur_ has joined #ocaml
10:55
asmanur has quit [Ping timeout: 265 seconds]
10:58
RagingDave has joined #ocaml
11:06
julm has joined #ocaml
11:13
q66 has joined #ocaml
11:16
BiDOrD_ has joined #ocaml
11:16
milosn has quit [Ping timeout: 276 seconds]
11:18
milosn has joined #ocaml
11:18
BiDOrD has quit [Ping timeout: 252 seconds]
11:24
|jbrown| has quit [Read error: Connection reset by peer]
11:37
suyu has joined #ocaml
11:40
suyu has quit [Client Quit]
11:40
Kakadu has quit [Ping timeout: 245 seconds]
11:40
Kakadu has joined #ocaml
12:18
lolcathost has quit [Ping timeout: 264 seconds]
12:22
tane has joined #ocaml
12:28
xavierm02 has joined #ocaml
13:17
<
xavierm02 >
Does this definition of my boolean_expression type seem reasonable?
13:18
<
xavierm02 >
happy new year btw
13:19
ontologiae has joined #ocaml
13:21
<
asmanur_ >
xavierm02: why do you want to enforce canonicality/cnf while building the tree ?
13:21
<
xavierm02 >
I don't
13:22
<
xavierm02 >
but I want to have a single type
13:22
<
xavierm02 >
to represent both canonical and non canonical expressions
13:22
<
xavierm02 >
so that I can use functions that don't need it on either
13:22
<
xavierm02 >
and can specify it has to be canonical for some other functions
13:23
<
asmanur_ >
but at the moment, you cannot build canonical expressions, can you ?
13:23
<
wmeyer >
xavierm02: good point by asmanur_, but I quite like your GADT :-)
13:23
<
xavierm02 >
I don't need to build canonical expressions
13:24
<
xavierm02 >
I'll have a function that makes expressions canonical
13:24
<
asmanur_ >
it will have to use Obj.magic then
13:24
<
asmanur_ >
i'd rather have 'canonical and 'cnf be phantom
13:24
<
asmanur_ >
and you hide your constructors and you provide safe functions binop : ... to the user
13:25
<
asmanur_ >
otherwise you will have to use Obj.magic all the time
13:26
<
xavierm02 >
I'll look into it
13:36
<
xavierm02 >
is there really no way
13:36
<
xavierm02 >
to have an "intelligent" constructor
13:36
<
xavierm02 >
that would know
13:37
<
xavierm02 >
cnf + or + cnf -> cnf
13:37
<
xavierm02 >
_ + _ + _ -> not_cnf
13:40
<
asmanur_ >
you can do a constructor
13:40
<
asmanur_ >
for each rule :)
13:41
<
xavierm02 >
but then filtering becomes a pain in the ass
13:42
<
asmanur_ >
what you can do
13:42
<
asmanur_ >
type ('a, 'b) private exp = ... (* untyped constructors *)
13:42
<
asmanur_ >
and then provide a function per constructor
13:42
<
xavierm02 >
so like
13:42
<
xavierm02 >
two constructors in the type
13:43
<
xavierm02 >
and a function that dispatches to those two constructors?
13:43
<
asmanur_ >
one constructor in the type
13:43
<
asmanur_ >
and two functions
13:44
<
asmanur_ >
the private (i think it's right) allows the user only to match
13:44
<
asmanur_ >
against this type
13:44
<
asmanur_ >
not to build
13:44
<
asmanur_ >
the problem is that when you will match you will loose typeness :/
13:46
<
asmanur_ >
depends on what you are aiming :)
13:47
<
xavierm02 >
isnt two construdctors and one function a good idea?
13:47
<
xavierm02 >
or maybe
13:47
<
xavierm02 >
two constructors
13:48
<
xavierm02 >
two functions
13:48
<
xavierm02 >
one function that dispatches to both constructors
13:48
<
xavierm02 >
and the publioc one allowing only one constructor
14:17
<
fasta >
Is there any library which takes an URL and returns the domain?
14:22
<
fasta >
adrien: er anonscm.debian.org
14:22
<
adrien >
look at ocamlnet
14:22
<
adrien >
and I think there's something around mirage too
14:23
<
adrien >
there's an RFC for URI schemes and I know there are a couple implementations
14:23
tww has joined #ocaml
14:39
<
xavierm02 >
can't I do somethign like this
14:39
<
xavierm02 >
type 'canonical boolean_expression =
14:39
<
xavierm02 >
| Var_Canonical : int -> canonical boolean_expression
14:39
<
xavierm02 >
| Var_NotCanonical : int -> not_canonical boolean_expression
14:39
<
xavierm02 >
let var_ = function
14:39
<
xavierm02 >
| 0 -> Var_Canonical 0
14:39
<
xavierm02 >
| (i:int) -> Var_NotCanonical i
14:39
Snark_ has joined #ocaml
14:39
Snark_ is now known as Snark
14:40
<
xavierm02 >
it works by using
14:40
<
xavierm02 >
| Var_NotCanonical : int -> _ boolean_expression
14:40
<
xavierm02 >
I have no idea what I'm doing T.T
14:41
<
asmanur_ >
why the first thing does not work ?
14:41
tww has quit [Quit: tww]
14:41
<
asmanur_ >
what you can do is also
14:42
<
xavierm02 >
| Var_NotCanonical : int -> not_canonical boolean_expression
14:42
<
xavierm02 >
doesnt work
14:42
<
xavierm02 >
because then the function returns two different types
14:42
<
xavierm02 >
aparently
14:42
<
xavierm02 >
but the _ fixes it
14:42
<
xavierm02 >
somehow
14:42
<
xavierm02 >
no idea why though
14:42
<
asmanur_ >
what is the type of var_ ?
14:43
<
xavierm02 >
'a boolean_expression -> 'b boolean_expression
14:43
<
xavierm02 >
i think
14:43
<
xavierm02 >
it should be
14:44
<
asmanur_ >
it takes an int ?
14:45
<
xavierm02 >
right >_<
14:45
<
xavierm02 >
int -> 'a boolean_expresion
14:46
<
asmanur_ >
then since 'a is phantom anyay it is useless
14:47
<
xavierm02 >
but it does what I want
14:48
<
xavierm02 >
type binary_operator = And | Or;;
14:48
<
xavierm02 >
(* canonical means the ints representing the variables range from 0 to (n-1) where n is the number of variables *)
14:48
<
xavierm02 >
type canonical;;
14:48
<
xavierm02 >
type not_canonical;;
14:48
<
xavierm02 >
(* cnf means the expression is in conjunctive normal form *)
14:48
<
xavierm02 >
type cnf;;
14:48
<
xavierm02 >
type not_cnf;;
14:48
<
xavierm02 >
type ('canonical, 'cnf) boolean_expression =
14:48
<
xavierm02 >
| Var_Canonical : int -> (canonical, not_cnf) boolean_expression
14:48
<
xavierm02 >
| Var_NotCanonical : int -> (_, not_cnf) boolean_expression
14:48
<
xavierm02 >
let var_ = function
14:48
<
xavierm02 >
| 0 -> Var_Canonical 0
14:48
jpdeplaix has quit [Ping timeout: 265 seconds]
14:48
<
xavierm02 >
| (i:int) -> Var_NotCanonical i
14:48
<
xavierm02 >
let is_cnf = function
14:48
<
xavierm02 >
| Var_Canonical _ -> 1
14:48
<
xavierm02 >
| _ -> 0
14:48
tww has joined #ocaml
14:48
<
xavierm02 >
print_int (is_cnf(var_ 0));(*0*)
14:48
<
xavierm02 >
print_int (is_cnf(var_ 1));(*1*)
14:48
tww has quit [Client Quit]
14:48
<
xavierm02 >
since I still have the constructors
14:48
<
xavierm02 >
I can determine if it is canonical
14:51
jpdeplaix has joined #ocaml
14:51
<
asmanur_ >
yes that's right
14:52
<
xavierm02 >
it does make the type completely useless
14:52
<
xavierm02 >
var_ is
14:53
<
xavierm02 >
int -> (canonical, not_cnf) boolean_expression
14:59
ulfdoz_ has joined #ocaml
15:02
ulfdoz has quit [Ping timeout: 264 seconds]
15:02
ulfdoz_ is now known as ulfdoz
15:33
<
fasta >
How can I find which package contains a given module? In case of multiple results, it should just list all of the candidates.
15:44
<
fasta >
I already hacked up something that seems to work in common cases.
15:50
eni has quit [Ping timeout: 240 seconds]
15:57
ontologiae has quit [Ping timeout: 245 seconds]
16:17
ontologiae has joined #ocaml
16:28
ontologiae has quit [Ping timeout: 260 seconds]
16:29
myx has quit [Ping timeout: 260 seconds]
16:40
eni has joined #ocaml
16:41
myx has joined #ocaml
16:47
emmanuelux has joined #ocaml
17:43
milosn has quit [Ping timeout: 245 seconds]
17:53
milosn has joined #ocaml
18:14
milosn has quit [Remote host closed the connection]
18:14
milosn has joined #ocaml
18:24
mcclurmc has joined #ocaml
18:33
jewel has quit [Ping timeout: 240 seconds]
18:35
<
troydm >
can i have a polymorphic type record in ocaml
18:35
<
troydm >
something like
18:35
<
troydm >
type a' myrec = { x: a' }
18:35
<
troydm >
i guess i can't :(
18:43
<
wmeyer >
yes, of course you can. Put ' before the a
18:52
<
troydm >
it doesn't compiles
18:52
<
troydm >
i mean i've put
18:53
Snark has quit [Quit: Quitte]
18:53
<
troydm >
type 'a object = { object: 'a }
18:53
<
flux >
object is a keyword
18:54
<
flux >
yep, that's it
18:56
fraggle_ has quit [Ping timeout: 260 seconds]
19:07
shp has joined #ocaml
19:08
<
shp >
i can't manage to get random floats in caml light: i use random__float(1.) for instance to get a random number but it always the same that come at first. I have written "random__init;;" before but there's no difference
19:08
jamii has joined #ocaml
19:15
<
wmeyer >
well, it's a pseudo-random generator not real one. It's deterministic. Your call to random_init is not a call, perhaps you need to do: random_init 123;;
19:17
<
shp >
but it's the same case, the first random will always be the same with random__init 123;;
19:18
<
shp >
and caml light does not seem to have implemented a time() function
19:18
<
wmeyer >
yes, it will be the same, and that is expected always.
19:18
<
wmeyer >
libc does it in the same way
19:18
<
wmeyer >
you want to be able to reproduce the results with the same seed
19:21
<
shp >
it feels like i'm gonna install ocaml
19:21
<
wmeyer >
shp: great idea!
19:22
<
shp >
i have a 60 lines caml light code, do you think it will be a big hardship to make it work in ocaml ?
19:22
<
wmeyer >
no, it should be OK
19:25
<
shp >
i'm on linux, "ocaml < and.ml " seems to act up, is there an "official" equivalent ?
19:26
<
flux >
shp, ocaml and.ml? but maybe you want ocamlscript
19:26
<
flux >
(but I have done without, just put #!/usr/bin/ocaml at the top of the file and run with it)
19:28
<
shp >
lol i'm a little twisted sometimes
19:29
<
shp >
is it possible to make "ocaml" binary more verbose ? because it just tells me there is a syntax error line 4 and it does not precise me which instruction
19:42
<
shp >
no vectors in ocaml ?!?!?
19:52
jbrown has joined #ocaml
19:59
<
Kakadu >
there a arrays
20:08
ontologiae has joined #ocaml
20:09
weie has quit [Quit: Leaving...]
20:13
gustav__ has joined #ocaml
20:17
<
wmeyer >
shp: [|"look";"into";"manual"|]
20:37
gour has quit [Quit: WeeChat 0.3.8]
20:54
Oejet has joined #ocaml
20:54
eni has quit [Quit: Leaving]
21:06
Yoric has quit [Ping timeout: 252 seconds]
21:35
Oejet has quit [Ping timeout: 255 seconds]
21:39
hcarty has quit [Ping timeout: 244 seconds]
21:39
hcarty has joined #ocaml
21:51
tani has joined #ocaml
21:54
tane has quit [Ping timeout: 245 seconds]
22:09
shp has quit [Quit: kit]
22:13
Oejet has joined #ocaml
22:22
jbrown has quit [Remote host closed the connection]
23:15
RagingDave has quit [Quit: Ex-Chat]
23:18
oriba has joined #ocaml
23:19
suyu has joined #ocaml
23:24
tani has quit [Quit: Verlassend]
23:34
tac has joined #ocaml
23:59
tac has quit [Quit: Page closed]