00:15
Smerdyakov has joined #ocaml
00:39
seafoodX has joined #ocaml
00:55
Submarine has quit [Remote closed the connection]
01:01
pantsd has joined #ocaml
01:12
yminsky has joined #ocaml
01:19
piggybox__ has joined #ocaml
01:23
visage has joined #ocaml
01:27
piggybox has joined #ocaml
01:27
piggybox_ has quit [Read error: 104 (Connection reset by peer)]
01:29
zarul has quit [Read error: 110 (Connection timed out)]
01:32
piggybox__ has quit [Read error: 104 (Connection reset by peer)]
01:32
visage has left #ocaml []
01:45
yminsky has quit []
01:53
buluca is now known as AkiraYuki
01:54
AkiraYuki is now known as buluca
02:18
zarul has joined #ocaml
02:28
piggybox has quit [Read error: 110 (Connection timed out)]
02:46
zarulshahrin has joined #ocaml
02:46
rhz has joined #ocaml
02:46
zarul has quit [Nick collision from services.]
02:46
<
rhz >
can you define multiple cases for functions like in Haskell? Or do you always have to use the match construct in OCaml?
02:46
zarulshahrin is now known as zarul
02:49
<
mbishop >
what do you mean?
02:52
<
abez >
rhz: as far as I know generics are about as far you can go with it or using a guard
02:53
<
abez >
rhz: let f x = match x with Dragons(_) -> ... | Trolls(_) -> ... | Olives(_) -> ... <-- guards or let f g x = g x <-- generic
02:53
<
abez >
rhz: You could always use classes and virtual dispatch
02:54
<
abez >
rhz: but as far as I know if you make a function let f (x:int) = x * x ;; let f (x:float) = x *. x ;; the old f will no longer be accessible.
02:55
<
abez >
rhz: Or you can use a functor
03:21
piggybox has joined #ocaml
03:44
buluca has quit [Read error: 113 (No route to host)]
03:52
thesoko has quit [Remote closed the connection]
03:53
thesoko has joined #ocaml
04:06
thesoko has quit [Remote closed the connection]
04:18
pantsd has quit [Read error: 110 (Connection timed out)]
04:20
jeberle has joined #ocaml
04:43
thermoplyae has joined #ocaml
04:47
thermoplyae has left #ocaml []
05:02
jeberle has left #ocaml []
05:05
piggybox_ has joined #ocaml
05:21
piggybox has quit [Read error: 110 (Connection timed out)]
06:55
zak_ has joined #ocaml
07:01
fluctus has left #ocaml []
07:08
rhz has quit ["Leaving"]
07:33
Cygal has joined #ocaml
07:35
zarul has quit [No route to host]
07:42
m3ga has joined #ocaml
08:00
m3ga has quit ["disappearing into the sunset"]
08:24
Cygal` has joined #ocaml
08:38
Cygal has quit [Read error: 110 (Connection timed out)]
08:44
love-pingoo has joined #ocaml
08:49
xavierbot has joined #ocaml
08:50
<
rwmjones >
module type Req = sig type a type b end ;;
08:50
<
xavierbot >
module type Req = sig type a type b end
08:50
<
rwmjones >
module Example (Base:Req) = struct type a_or_b = A of Base.a | B of Base.b let foo (x : a_or_b list) = () end ;;
08:50
<
xavierbot >
module Example :
08:50
<
xavierbot >
functor (Base : Req) ->
08:50
<
xavierbot >
type a_or_b = A of Base.a | B of Base.b
08:50
<
xavierbot >
val foo : a_or_b list -> unit
08:50
<
rwmjones >
type void;;
08:50
<
xavierbot >
type void
08:51
<
rwmjones >
module Myreq = struct type a = int type b = void end ;;
08:51
<
xavierbot >
module Myreq : sig type a = int type b = void end
08:51
<
rwmjones >
module Myexample = Example (Myreq) ;;
08:51
<
xavierbot >
module Myexample :
08:51
<
xavierbot >
type a_or_b = Example(Myreq).a_or_b = A of Myreq.a | B of Myreq.b
08:51
<
xavierbot >
val foo : a_or_b list -> unit
08:51
<
rwmjones >
Myexample.foo [1; 2; 3];;
08:51
<
xavierbot >
Characters 16-17:
08:51
<
xavierbot >
Myexample.foo [1; 2; 3];;
08:51
<
xavierbot >
This expression has type int but is here used with type
08:51
<
xavierbot >
Myexample.a_or_b = Example(Myreq).a_or_b
08:51
<
rwmjones >
Myexample.foo [A 1; A 2; A 3];;
08:51
<
xavierbot >
Characters 18-19:
08:51
<
xavierbot >
Myexample.foo [A 1; A 2; A 3];;
08:51
<
xavierbot >
Unbound constructor A
08:52
<
rwmjones >
Myexample.foo [Myreq.A 1; Myreq.A 2; Myreq.A 3];;
08:52
<
xavierbot >
Characters 24-25:
08:52
<
xavierbot >
Myexample.foo [Myreq.A 1; Myreq.A 2; Myreq.A 3];;
08:52
<
xavierbot >
Unbound constructor Myreq.A
08:52
<
rwmjones >
Myexample.foo [Example.A 1];;
08:52
<
xavierbot >
Characters 26-27:
08:52
<
xavierbot >
Myexample.foo [Example.A 1];;
08:52
<
xavierbot >
Unbound constructor Example.A
08:52
<
rwmjones >
Myexample.foo [Example(Myreq).A 1];;
08:52
<
xavierbot >
Myexample.foo [Example(Myreq).A 1];;
08:52
<
xavierbot >
^^^^^^^^^
08:52
<
xavierbot >
Characters 23-32:
08:52
<
xavierbot >
Parse error: currified constructor
08:53
<
rwmjones >
Myexample.foo [Myexample.A 1];;
08:53
<
xavierbot >
- : unit = ()
08:53
<
rwmjones >
Myexample.foo [Myexample.B 1];;
08:53
<
xavierbot >
Characters 28-29:
08:53
<
xavierbot >
Myexample.foo [Myexample.B 1];;
08:53
<
xavierbot >
This expression has type int but is here used with type Myreq.b = void
08:58
<
flux-_ >
difficult :)
09:35
seafoodX has quit []
10:30
buluca has joined #ocaml
10:43
xavierbot has quit [Read error: 110 (Connection timed out)]
11:15
_blackdog has joined #ocaml
11:20
buluca is now known as TH3_L4m4H
11:21
TH3_L4m4H is now known as buluca
11:25
_blackdog has quit ["Ex-Chat"]
11:25
_blackdog has joined #ocaml
11:29
noteventime has joined #ocaml
11:33
buluca has quit ["Leaving."]
11:36
_blackdog has left #ocaml []
11:47
magius_pendragon has joined #ocaml
12:06
slipstream-- has joined #ocaml
12:09
zarul has joined #ocaml
12:11
leo037 has joined #ocaml
12:19
zarul has quit [Remote closed the connection]
12:21
slipstream has quit [Read error: 110 (Connection timed out)]
12:41
leo037-2 has joined #ocaml
13:00
leo037-2 has quit ["Ex-Chat"]
13:02
leo037-2 has joined #ocaml
13:07
leo037-2 has quit ["Ex-Chat"]
13:07
leo037-2 has joined #ocaml
13:09
leo037-2 has quit [Client Quit]
13:15
mwc_ has joined #ocaml
13:16
<
mwc_ >
I've poured through the module tutorial and the reference for module types. I'm trying to expose a variant type from a compilation unit
13:16
<
mwc_ >
but as soon as I add "type foo" to the .mli, the compile errors on "inconsistent assumptions"
13:17
<
mwc_ >
I'm trying to expose the type and all its variants.
13:17
<
mwc_ >
(and yes, type foo is defined in the .ml)
13:19
<
Smerdyakov >
You add "type foo" with the list of variants, just like you were defining it anew?
13:19
<
mwc_ >
aha, oh man, this was silly
13:20
<
mwc_ >
I'd let my .depends get out of date
13:20
<
mwc_ >
Well, that only took 30 minutes to sort out
13:32
<
flux-_ >
yes, when getting that error, make clean
13:32
<
flux-_ >
..plus fix your dependencies ;)
13:42
<
tsuyoshi >
hmm.. ocamlnet is explicitly missing the one encoding I need, iso-2022-jp
13:43
<
tsuyoshi >
wonder if there's some really good reason for not supporting it, or if I can just add it myself
13:49
Smerdyakov has quit ["Leaving"]
14:13
martin_ has joined #ocaml
14:14
martin__ has joined #ocaml
14:27
mbishop has quit [Read error: 113 (No route to host)]
14:42
zak_ has quit [Read error: 110 (Connection timed out)]
14:51
love-pingoo has quit ["Connection reset by pear"]
14:59
mwc_ has quit ["leaving"]
15:10
leo037 has quit ["Leaving"]
15:11
xavierbot has joined #ocaml
15:18
pango has quit [Remote closed the connection]
15:27
pango has joined #ocaml
15:42
seafoodX has joined #ocaml
16:00
seafoodX has quit []
16:25
leo037 has joined #ocaml
16:39
postalchris has joined #ocaml
17:07
Submarine has joined #ocaml
17:07
leo037 has quit ["Leaving"]
17:07
leo037 has joined #ocaml
17:27
mav- has joined #ocaml
17:30
Submarine has quit [Remote closed the connection]
17:43
ygrek has joined #ocaml
17:45
pantsd has joined #ocaml
17:54
leo037 has quit ["Leaving"]
17:54
leo037 has joined #ocaml
18:08
martin__ is now known as mbishop
18:29
Archville has joined #ocaml
18:30
<
Archville >
Where can i find infomation about the Ocaml programming language and it's differentes to C ?
18:30
<
Archville >
*differences
18:32
<
flux-_ >
I doubt there is a list
18:32
<
flux-_ >
OCaml is basically totally different
18:33
<
flux-_ >
but, then I again, I suppose one can write C in any language..
18:33
<
Archville >
I'm building my own simple programming language, looking for nice features on other languages already at use
18:34
<
Archville >
and a lot of people tells me Ocaml has nice things. specially for functional programming
18:34
<
Archville >
so i would like to read a bit on them
18:34
<
flux-_ >
well, then looking how ML does things can be very useful
18:35
<
Archville >
Thanks, i'll take a look
18:36
<
mbishop >
creating a language takes a LOT of research heh
18:37
<
mbishop >
have you looked at SISAIL, Acute, Alice ML, Pict, Occam-Pi, SR, etc?
18:37
<
Archville >
Yeah, but i think it's worth it
18:37
<
Archville >
So far i looked at TCL, Lisp, some Scheme interpreters/compilers, Python, Ruby...
18:37
<
Archville >
Over all of them, i loved Scheme and Lisp
18:38
<
Archville >
So my little language looks a bit like them
18:38
<
Archville >
Never heard of the names you say, but i'll look at everything interesting i find
18:39
<
flux-_ >
Haskell is also one big name in the functional world
18:39
<
Archville >
By the way, on the raytracer code... seems pretty elegant
18:39
<
Archville >
however i find strange things like: "Printf.printf"
18:39
<
mbishop >
there are a lot of neat ones, most of those I mentioned are based on process calculi
18:40
<
Archville >
Haskell annoys me
18:40
<
flux-_ >
archville, it's the printf-function from the module Printf; if one wrote open Printf at the top of the file one would be able to omit the Printf-prefix
18:40
<
Archville >
I find it too hard to read
18:40
<
Archville >
and too hard to write
18:40
<
Archville >
Oh, so there are modules and you call functions from them
18:40
<
Archville >
like module.function parameters...
18:41
<
Archville >
Looks good, no need for #include things
18:41
<
flux-_ >
yes, except module names always begin with a capital letter
18:41
<
mbishop >
I highly recommend "Programming Language Pragmatics 2nd edition", fantastic book covering a whole bunch of languages and how they do things
18:41
<
Archville >
I'm currently reading SICP
18:43
<
mbishop >
That's a fantastic book too :)
18:43
<
Archville >
Yes, it's really worth a look.
18:43
<
Archville >
Also found On Lisp by Paul Graham awesome.
19:05
fmardini has joined #ocaml
19:09
noteventime has quit [Remote closed the connection]
19:14
jlouis has quit [Remote closed the connection]
19:16
ygrek has quit ["Leaving"]
19:29
jlouis has joined #ocaml
19:50
fmardini has quit []
19:59
Mr_Awesome has joined #ocaml
20:27
david_koontz has quit ["Leaving"]
20:33
david_koontz has joined #ocaml
20:47
martin_ has left #ocaml []
20:53
Submarine has joined #ocaml
21:01
pantsd has quit [Read error: 110 (Connection timed out)]
21:08
screwt8 has quit [Read error: 104 (Connection reset by peer)]
21:12
pantsd has joined #ocaml
21:31
xavierbot has quit [Read error: 110 (Connection timed out)]
21:32
pantsd has quit [Read error: 110 (Connection timed out)]
22:37
leo037 has quit ["Leaving"]
22:39
magius_pendragon has quit ["leaving"]
22:57
Cygal` has quit [Remote closed the connection]
23:01
postalchris has quit ["Leaving."]
23:12
Cygal` has joined #ocaml
23:50
screwt8 has joined #ocaml