seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
lordmetroid_ has joined #ocaml
goalieca has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
psnively has quit []
LordMetroid has quit [Read error: 110 (Connection timed out)]
hkBst has quit ["Konversation terminated!"]
lordmetroid_ has quit [Client Quit]
seafood_ has quit [Read error: 104 (Connection reset by peer)]
seafood_ has joined #ocaml
middayc has joined #ocaml
mwc_ has left #ocaml []
bluestorm has quit ["Konversation terminated!"]
<orbitz>
do i have to open amodule in order to get access to anyr ecords i put in its interface?
ita has quit [Remote closed the connection]
<Smerdyakov>
No. You never have to open a module to do anything in OCaml.
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has joined #ocaml
authentic has quit [Read error: 104 (Connection reset by peer)]
ben__ has joined #ocaml
ben__ is now known as ziph
mwc_ has joined #ocaml
authentic has joined #ocaml
mwc_ has left #ocaml []
jlouis has joined #ocaml
bzzbzz has quit ["leaving"]
jlouis_ has quit [Read error: 110 (Connection timed out)]
jlouis_ has joined #ocaml
<orbitz>
except for the first chaaracter, is case important in the name of a module?
<hcarty>
orbitz: Not really, except in mapping to a filename
<orbitz>
so if i want to do camel case it would be
<orbitz>
myFile
<orbitz>
for a module naemd MyFile
<hcarty>
Yes
<orbitz>
ok thanks
AxleLonghorn has quit [Read error: 110 (Connection timed out)]
jlouis has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
middayc has quit []
AxleLonghorn has joined #ocaml
onigiri has quit []
seafood_ has quit []
Robdor has joined #ocaml
jlouis_ has quit [kornbluth.freenode.net irc.freenode.net]
huh has quit [kornbluth.freenode.net irc.freenode.net]
ertai has quit [kornbluth.freenode.net irc.freenode.net]
dobblego has quit [kornbluth.freenode.net irc.freenode.net]
|Catch22| has quit [kornbluth.freenode.net irc.freenode.net]
__suri has quit [kornbluth.freenode.net irc.freenode.net]
thelema has quit [kornbluth.freenode.net irc.freenode.net]
netx has quit [kornbluth.freenode.net irc.freenode.net]
morner has quit [kornbluth.freenode.net irc.freenode.net]
goalieca has quit [kornbluth.freenode.net irc.freenode.net]
rwmjones has quit [kornbluth.freenode.net irc.freenode.net]
svenl has quit [kornbluth.freenode.net irc.freenode.net]
ikatz has quit [kornbluth.freenode.net irc.freenode.net]
jdavis_ has quit [kornbluth.freenode.net irc.freenode.net]
unfo- has quit [kornbluth.freenode.net irc.freenode.net]
TaXules has quit [kornbluth.freenode.net irc.freenode.net]
jeremiah has quit [kornbluth.freenode.net irc.freenode.net]
orbitz has quit [kornbluth.freenode.net irc.freenode.net]
mattam has quit [kornbluth.freenode.net irc.freenode.net]
AxleLonghorn has quit [kornbluth.freenode.net irc.freenode.net]
Mr_Awesome has quit [kornbluth.freenode.net irc.freenode.net]
Demitar has quit [kornbluth.freenode.net irc.freenode.net]
Oatschool has quit [kornbluth.freenode.net irc.freenode.net]
Robdor has quit [kornbluth.freenode.net irc.freenode.net]
thermoplyae has quit [kornbluth.freenode.net irc.freenode.net]
pattern has quit [kornbluth.freenode.net irc.freenode.net]
mwc has quit [kornbluth.freenode.net irc.freenode.net]
Smerdyakov has quit [kornbluth.freenode.net irc.freenode.net]
mbishop has quit [kornbluth.freenode.net irc.freenode.net]
mfp has quit [kornbluth.freenode.net irc.freenode.net]
cmeme has quit [kornbluth.freenode.net irc.freenode.net]
authentic has quit [kornbluth.freenode.net irc.freenode.net]
Morphous has quit [kornbluth.freenode.net irc.freenode.net]
letrec has quit [kornbluth.freenode.net irc.freenode.net]
kig has quit [kornbluth.freenode.net irc.freenode.net]
guyzmo has quit [kornbluth.freenode.net irc.freenode.net]
ozzloy has quit [kornbluth.freenode.net irc.freenode.net]
ahf has quit [kornbluth.freenode.net irc.freenode.net]
ppsmimou has quit [kornbluth.freenode.net irc.freenode.net]
jonathanv has quit [kornbluth.freenode.net irc.freenode.net]
mrsolo has quit [kornbluth.freenode.net irc.freenode.net]
smimou has quit [kornbluth.freenode.net irc.freenode.net]
Dazhbog has quit [kornbluth.freenode.net irc.freenode.net]
gim has quit [kornbluth.freenode.net irc.freenode.net]
bla has quit [kornbluth.freenode.net irc.freenode.net]
gaja has quit [kornbluth.freenode.net irc.freenode.net]
acatout has quit [kornbluth.freenode.net irc.freenode.net]
bebui has quit [kornbluth.freenode.net irc.freenode.net]
zmdkrbou has quit [kornbluth.freenode.net irc.freenode.net]
seafood_ has joined #ocaml
Robdor has joined #ocaml
AxleLonghorn has joined #ocaml
jlouis_ has joined #ocaml
authentic has joined #ocaml
goalieca has joined #ocaml
thermoplyae has joined #ocaml
orbitz has joined #ocaml
|Catch22| has joined #ocaml
pattern has joined #ocaml
Morphous has joined #ocaml
ppsmimou has joined #ocaml
mwc has joined #ocaml
morner has joined #ocaml
Mr_Awesome has joined #ocaml
thelema has joined #ocaml
Smerdyakov has joined #ocaml
letrec has joined #ocaml
Demitar has joined #ocaml
gaja has joined #ocaml
rwmjones has joined #ocaml
jonathanv has joined #ocaml
mrsolo has joined #ocaml
svenl has joined #ocaml
huh has joined #ocaml
ertai has joined #ocaml
dobblego has joined #ocaml
smimou has joined #ocaml
netx has joined #ocaml
acatout has joined #ocaml
__suri has joined #ocaml
Dazhbog has joined #ocaml
kig has joined #ocaml
gim has joined #ocaml
zmdkrbou has joined #ocaml
bebui has joined #ocaml
guyzmo has joined #ocaml
cmeme has joined #ocaml
Oatschool has joined #ocaml
mfp has joined #ocaml
ahf has joined #ocaml
mattam has joined #ocaml
TaXules has joined #ocaml
ikatz has joined #ocaml
jeremiah has joined #ocaml
jdavis_ has joined #ocaml
unfo- has joined #ocaml
bla has joined #ocaml
mbishop has joined #ocaml
ozzloy has joined #ocaml
mwc has quit [Remote closed the connection]
julm has joined #ocaml
julm has quit [Remote closed the connection]
julm has joined #ocaml
TheLittlePrince has joined #ocaml
<Optikal__>
the little prince can catch a shooting star and fly away
authentic has quit [No route to host]
julm has quit ["bye \o_"]
julm has joined #ocaml
seafood_ has quit []
julm has quit ["bye \o_"]
julm has joined #ocaml
<ziph>
Anyone have any hints on doing "functional style" string manipulation in ocaml? Like having a takewhile on a string without having to home brew a strings library? :)
<Optikal__>
Does ocaml have a String.explode function?
<ziph>
Doesn't seem to. Is that an F#/other ML thing? Does it do string -> char list?
<Optikal__>
yeah
<Optikal__>
StandardML has String.explode
<thelema>
Optikal__: once you define fold_right on strings (and have a cons function), explode s = fold_right cons s []
<ziph>
Does that mean every significant ocaml library has its own mini string library? ;)
<dumb_questions>
i thought that would mean localtime is being passed a single element tuple
<dumb_questions>
still dont understand parens
<dumb_questions>
ah i suppose it's only a tuple if it has 2+ elements
<dumb_questions>
since the signature of (1) is just vanilla int
<dumb_questions>
thanks
<dumb_questions>
still very much groping around in the dark
<Yoric[DT]>
There's one thing you need to understand about parens: except for a few special circumstances, they're used only as a mean of prioritizing operations.
<Yoric[DT]>
In mathematics, with common notations, they're used like this except for functions.
<Yoric[DT]>
In OCaml, they're used like this including for functions.
* Yoric[DT]
realizes his English is not very clear today.
* Yoric[DT]
is very much lacking sleep.
<ziph>
What are the special cases?
<Yoric[DT]>
Right now, I'm thinking of functors, but there are others.
<Yoric[DT]>
Prefix operators / functions, for instance.
<Yoric[DT]>
( * ) ;;
<Yoric[DT]>
erf, Xavierbot is sleeping.
<Yoric[DT]>
Mmmhhhh....
<ziph>
Ah, haven't played with them yet. Is printf one? :)
<Yoric[DT]>
Nope.
<ziph>
(A functor)
<Yoric[DT]>
Hashtbl.Make is one.
xavierbot has joined #ocaml
<Yoric[DT]>
It takes a module as argument and produces a module as result.
<rwmjones>
( * );;
<xavierbot>
- : int -> int -> int = <fun>
<Yoric[DT]>
Yeah :)
<ziph>
I thought I saw printf infering types from a format string at one stage. Was I dreaming?
<Yoric[DT]>
print_endline "Thanks, rwmjones";;
<xavierbot>
Thanks, rwmjones
<xavierbot>
- : unit = ()
<rwmjones>
np
<Yoric[DT]>
ziph: yep, it's called a hack :)
<flux>
ziph, you weren't, but it's compiler magic
<ziph>
Ah. :)
<flux>
Printf.printf;;
<xavierbot>
- : ('a, out_channel, unit) format -> 'a = <fun>
<Yoric[DT]>
In practice, format strings are not strings.
<Yoric[DT]>
They just look like strings.
<Yoric[DT]>
Unrelated question: does anyone know if there's a way to install cairo bindings from godi ?
<flux>
godi for 3.10 doesn't appear to have them
<ziph>
();;
<xavierbot>
- : unit = ()
<flux>
shouldn't be a big deal installing them manually?
<Yoric[DT]>
Yeah, but there's the aforementioned lack of sleep problem :)
<Yoric[DT]>
Actually, I'm not completely sure.
<Yoric[DT]>
There doesn't seem to be a way of downloading these bindings without downloading the whole of cairo.
<Yoric[DT]>
And I'd rather not have binary incompatibilities between the system-installed version and the local version.
<flux>
really? that's weird
<Yoric[DT]>
That and the fact that I may need to install cairo on the students-usable machines, so the more automated the better.
<coucou747>
I just wanted to know if someone have a nicer solution
<coucou747>
(it's not for the classroom, it's just an idea between the teacher and me)
AxleLonghorn has left #ocaml []
<rwmjones>
coucou747, a nicer solution wouldn't involve bubble sort :-)
<coucou747>
it's just cause bubble sort have a look of itterativ algorithm...
<coucou747>
in itteratif it's just that : for (int i=0;i<N-1;i++)for (int j=i+1;j<N;j++) if (tab[i]<tab[j]){ int a=tab[i]; tab[i]=tab[j];tab[j]=a;}
<coucou747>
in Cpp or java
<coucou747>
rwmjones> to do a insert sort, it's nicer in ocaml as in Cpp, but to do a bubble sort...
<thermoplyae>
that C code uses arrays
<Yoric[DT]>
Bubble sort with lists is OK in OCaml.
<thermoplyae>
you can write something similarly brief in ocaml if you avoid the functional list datatype
<thermoplyae>
though it's not like what you have in the pastebin is terrible
love-pingoo has joined #ocaml
<coucou747>
my aim is to make a nice bubble sort, using List
revax has joined #ocaml
Plo1 has joined #ocaml
Plo1 is now known as Plop_
Plop_ has left #ocaml []
<Yoric[DT]>
Yeah, that version is ok.
<Yoric[DT]>
I don't think you can do anything much nicer.
<coucou747>
thx
jderque has joined #ocaml
Morphous has joined #ocaml
thermoplyae has quit ["daddy's in space"]
Morphous_ has quit [Read error: 110 (Connection timed out)]
olleolleolle has left #ocaml []
xaviertest has quit [Remote closed the connection]
<bla>
xavierbot, wake
<xavierbot>
xavierbot wakes up
<bla>
With two bots it's still possible to make one send a command to the second, which is a command to the first...
onigiri has joined #ocaml
OChameau has quit ["Leaving"]
postalchris has joined #ocaml
thelema has joined #ocaml
RobertFischer has joined #ocaml
<flux>
it's a shame there are some irc clients written by people who haven't read the relevant rfc, otherwise the notice-approach would nicely solve that
jonathanv has joined #ocaml
thermoplyae has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
ygrek has joined #ocaml
middayc_ has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
RobertFischer has quit [Client Quit]
jlouis_ is now known as jlouis
onigiri has quit []
evn has joined #ocaml
<hcarty>
Is there a standard name for a fold using only the contents of the given list/array? Something like: let foo f l = List.fold_left f (List.hd l) (List.tl l)
<hcarty>
Then foo min [1;2;3] to find the smallest item in the list
ita has joined #ocaml
<hcarty>
"find" is the first thing that comes to my mind, but it has a different meaning in the stdlib
<hcarty>
And find doesn't really apply for all uses...
<coucou747>
let min_list = List.fold_left min (List.hd l) (List.tl l);;
<xavierbot>
Characters 44-45:
<xavierbot>
let min_list = List.fold_left min (List.hd l) (List.tl l);;
<xavierbot>
^
<xavierbot>
Unbound value l
<coucou747>
let min_list l= List.fold_left min (List.hd l) (List.tl l);;
<xavierbot>
val min_list : 'a list -> 'a = <fun>
<coucou747>
min_list [1;2;3;5;0;12];;
<xavierbot>
- : int = 0
<coucou747>
:)
middayc has joined #ocaml
<coucou747>
hcarty> es geht ?
<coucou747>
hum...
<coucou747>
does it works ?
<rwmjones>
xaviertest has gone ...
<thelema>
hcarty: one semi-solution - List.fold_left min max_int l
<hcarty>
coucou747: That works, I am just wondering if there is a standard name
<thelema>
your solution raises an exception on an empty list, mine returns max_int
<coucou747>
what's the minimum of an empty list ?
<coucou747>
there is no minimum... so the exception is (for me) the good solution
<hcarty>
Thank you for both of the examples, but is the naming convention that I am wondering about
<hcarty>
s/is/it is/
<jderque>
hcarty: it's called foldl1 in haskell : "foldl1 is a variant of foldl that has no starting value argument, and thus must be applied to non-empty lists."
<thelema>
fair enough. Maybe the stdlib should have reduce_left and reduce_right runctions
<hcarty>
jderque: Thanks
<hcarty>
I like "reduce"...
<thelema>
hcarty: that's the python name
evn has quit [Read error: 104 (Connection reset by peer)]
<hcarty>
Oh no! I can't use them then... :-)
<ita>
let reduce_left = fold_left in
evn has joined #ocaml
<hcarty>
thelema: Thanks, I think I will use those names
<thelema>
hcarty: just giving credit where it's due.
<thelema>
ita: let reduce_left f l = fold_left f (hd l) (tl l)
middayc_ has quit [Read error: 110 (Connection timed out)]
<hcarty>
module Array = struct include Array let reduce_left f a = fold_left f a.(0) (sub a 1 (length a - 1)) end;;
<xavierbot>
module Array :
<xavierbot>
sig
<xavierbot>
external length : 'a array -> int = "%array_length"
<xavierbot>
external get : 'a array -> int -> 'a = "%array_safe_get"
<xavierbot>
external set : 'a array -> int -> 'a -> unit = "%array_safe_set"
<xavierbot>
external make : int -> 'a -> 'a array = "caml_make_vect"
<xavierbot>
external create : int -> 'a -> 'a array = "caml_make_vect"
<xavierbot>
val init : int -> (int -> 'a) -> 'a array
<xavierbot>
val make_matrix : int -> int -> 'a -> 'a array array
<xavierbot>
val create_matrix : int -> int -> 'a -> 'a array array
<malc_>
_W_: huh? since when does gcc support win64?
<_W_>
malc_, I have no idea, I don't think it does?
<malc_>
_W_: last time i checked it didn't
<malc_>
that means no dice with cygwin/ming there
<_W_>
it's kind of irrelevant to what I'm asking though
<malc_>
i should pay more attention to 'and's
<_W_>
ah I see the comment at the end of the win64 section
<thelema>
_W_: you have to make your own win64 binaries.
<_W_>
anyway, iut's the cygwin binaries I'm after
<_W_>
*it's
<_W_>
I mean, I can compile myself, but if someone already has for cygwin, it'd save me some time
<thelema>
_W_: make them yourself
<_W_>
I guess the maintaners of the page doesn't come here?
<thelema>
_W_: not so much.
<bla>
I was using bytecode ocaml on windows. Which... worked... And doesn't need a compiler.
<hcarty>
_W_: Windows binary packages are something the OCaml team recently asked for help on
<julm>
module M : sig val f : [>`A of int] -> [>`A of int] end = struct let f x = x end;;
<xavierbot>
module M : sig val f : [> `A of int ] -> [> `A of int ] end
<julm>
\o/
<_W_>
hcarty, yeah I figured something like that was up, it's just that the text on that page made it appear as if there WAS a binary, and they just forgot to link to it or something
coucou747 has quit ["bye ca veut dire tchao en anglais"]
postalchris has joined #ocaml
evn_ has quit [Read error: 110 (Connection timed out)]
vpalle has quit ["Leaving"]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
bluestorm has quit ["Konversation terminated!"]
jlouis has joined #ocaml
Mr_Awesome has joined #ocaml
jlouis__ has quit [Read error: 110 (Connection timed out)]