kaustuv changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
ikaros has quit ["Leave the magic to Houdini"]
slash_ has quit [Client Quit]
Cafuneba_ has quit []
angerman has quit []
sfmatt has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
Ched has quit [Read error: 110 (Connection timed out)]
Ched has joined #ocaml
sfmatt has quit [Remote closed the connection]
alexyk has joined #ocaml
psnively has joined #ocaml
psnively has quit [Client Quit]
travisbrady has quit []
willb has joined #ocaml
seafood has joined #ocaml
<jeff_s_> has anyone tried writing something like haskell's fmap in ocaml? I've convinced myself it's not possible
sporkmonger has joined #ocaml
* thelema sees only "Functor a => (b -> c) -> a b -> a c"
<thelema> fmap does some sort of map given a functor?
<thelema> What prerequesites does "Functor a" imply?
<thelema> If it implies a datatype with some functions, I can see writing it as a functor
<thelema> if you really had to, you could have parameters (or even a tuple of parameters) that define all the required functions
<jeff_s_> The example I'm thinking of is this:
<thelema> s/define/supply/
<jeff_s_> module IntSet = Set.Make(struct tyep t int let compare = compare end) module StringSet = Set.Make (String)
<jeff_s_> fmap string_of_int someSetOfInts :: StringSet.t
<thelema> class Functor f where
<thelema> fmap :: (a -> b) -> f a -> f b
<thelema> isn't "Functor f" just a way of saying "the module supplying f also supplies a map function"?
<thelema> well, I guess it's a bit more...
<thelema> if you want to go from one type of set to another
<thelema> one problem is that sets aren't parameterized by type.
<thelema> they're functorized...
<thelema> Queues are parameterized by type... so maybe an example where you take an int Queue.t and make a string Queue.t ...
<thelema> but asserting that Queue was a functor means exactly that it supplies a fmap function.
<thelema> so we're back to having a circular definition for paremeterized types, and the problem of crossing abstraction boundaries for Sets
<jeff_s_> never mind, fmap doesn't quite do what I was thinking it did
<thelema> ok.
<thelema> if you wanted, you could assume iteration and the ability to add to a collection, and build fmap
<jeff_s_> ok you CAN do what I wanted to do, bu tit's not fmap, it's just map
<jeff_s_> Data.Set.map (\x -> [x]) (singleton 'c') :: Set [Char]
<jeff_s_> but that's type class magic at work, no mysteries there
<thelema> Batteries' PSet module (polymorphic set) defines a ['a set] type, and has the map function you want
<thelema> with the functorial set, you can't map from one set type to another.
<jeff_s_> I saw pmap earlier, if I remember right it works but is kinda ugly in comparison. not much though
<jeff_s_> Hm, I guess it's not bad, but it looks like it relies on Pervasives.compare?
<thelema> PSet.create takes a comparison function as argument
<thelema> (similar for PMap)
<thelema> good night.
julm has quit [Read error: 110 (Connection timed out)]
julm has joined #ocaml
seafood has quit []
alexyk has quit []
alexyk has joined #ocaml
Mr_Awesome has joined #ocaml
<sporkmonger> What would be the ideal way to handle "joining" for a list? IE, returns a string with commas in between list items. I need to dump an AST to stdout for debug purposes and I'm running into noob type issues (has type Ast.expr list, used with Ast.expr list list) and "joining" seems like maybe the sort of thing that might exist somewhere in the stdlib?
<flux> sporkmonger, String.concat
Axioplas1 has joined #ocaml
alexyk has quit []
lanaer has quit [Read error: 113 (No route to host)]
Axioplas1 has quit ["++"]
Asmadeus has quit [Read error: 60 (Operation timed out)]
Asmadeus has joined #ocaml
Asmadeus_ has joined #ocaml
Jedai has quit ["KVIrc Insomnia 4.0.0, revision: , sources date: 20090115, built on: 2009/03/07 00:45:02 UTC http://www.kvirc.net/"]
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
Asmadeus has quit [Read error: 110 (Connection timed out)]
lanaer has joined #ocaml
itewsh has joined #ocaml
Associat0r has quit []
monadic_kid has joined #ocaml
Camarade_Tux has joined #ocaml
angerman has joined #ocaml
jeff_s_ has quit [Read error: 104 (Connection reset by peer)]
jeanbon has joined #ocaml
Asmadeus_ is now known as Asmadeus
monadic_kid has quit ["Leaving"]
angerman has quit []
jeanbon has quit [Read error: 110 (Connection timed out)]
yziquel has joined #ocaml
<yziquel> has anyone tried using findlib with jocaml? Using the debian jocaml package, I get The files /usr/bin/jocaml and /usr/lib/ocaml/3.11.0/toploop.cmi make inconsistent assumptions over interface Outcometree
ikaros has joined #ocaml
verte has joined #ocaml
verte has quit ["~~~ Crash in JIT!"]
robocop has joined #ocaml
mellum has left #ocaml []
yziquel has quit [Read error: 104 (Connection reset by peer)]
Yoric[DT] has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
<itewsh> how to manage "in_channel" and "out_channel" in c? Does someone have any documentation?
<Camarade_Tux> I can't remember how to do it for *_channel but Unix.file_descr is easy to do and you can convert between them from both ocaml and C
<Camarade_Tux> hmm, crap, I can't remember which way it is
<Camarade_Tux> ok : file_descr are ints and are used with C's open() for instance, *_channel may be what fopen() returns but I'm not sure (anyway, as I said, you can "translate" between them with fdopen())
<itewsh> so it should return a "FILE *" ?
<itewsh> (I'd rather use FILE* than int (file descriptors))
marmottine has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
itewsh has quit [Read error: 60 (Operation timed out)]
itewsh has joined #ocaml
schme has joined #ocaml
ofaurax has joined #ocaml
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
itewsh has quit [Client Quit]
Yoric[DT] has quit ["Ex-Chat"]
BiDOrD has joined #ocaml
BiDOrD has quit [Read error: 104 (Connection reset by peer)]
alexyk has joined #ocaml
BiDOrD has joined #ocaml
marmottine has quit [Remote closed the connection]
Alpounet has joined #ocaml
ikaros has joined #ocaml
Associat0r has joined #ocaml
robocop has left #ocaml []
alexyk has quit []
Lomono has joined #ocaml
<palomer> http://pastebin.com/m708054bf <-- I'm getting this error when trying to compile a simple extension
<palomer> ahh, woops
<palomer> forgot an open Syntax
<palomer> http://pastebin.com/m320f0d7d <--why do I get this warning?
jeff_s_ has joined #ocaml
Lomono has quit ["Don't even think about saying Candlejack or else you wi"]
<thelema> palomer: sorry, dunno. Is there another rule that's called str_item?
<palomer> str_item is a quotation...
<palomer> oh, I have to define the LEVEL
<jeff_s_> Why are constructors not first class objects in ocaml? In SML and Haskell I've found taht you can do things like "map Some [1;2;3] = [Some 1; Some 2; Some 3]"
<jeff_s_> It's not a big deal, but it's kind of strange.
julm has quit [Remote closed the connection]
julm has joined #ocaml
BiDOrD has quit [hubbard.freenode.net irc.freenode.net]
bacam has quit [hubbard.freenode.net irc.freenode.net]
poucet has quit [hubbard.freenode.net irc.freenode.net]
ertai has quit [hubbard.freenode.net irc.freenode.net]
BiDOrD has joined #ocaml
bacam has joined #ocaml
poucet has joined #ocaml
ertai has joined #ocaml
jeddhaberstro has joined #ocaml
<palomer> jeff_s_, there was a long discussion about this somewhere
<palomer> jeff_s_, I found it strange at first too
slash_ has joined #ocaml
<mrvn> They are also not curried.
Yoric[DT] has joined #ocaml
Amorphous has quit [Read error: 113 (No route to host)]
Amorphous has joined #ocaml
<palomer> camlp4 rocks
<jeff_s_> thanks
<jeff_s_> palomer -did you find documentation?
<jeff_s_> like, not crappy documentation?
<palomer> nope
<palomer> I've been reading the sexplib/type-conv source for inspiration
<jeff_s_> ah ok
<palomer> and grepping the source
<palomer> I'm getting more and more agile, maybe I can answer some questions(if you have any)
<palomer> also, the EXTEND clauses of http://martin.jambon.free.fr/examples/pa_json_static_3100beta.html are very instructional
alexyk has joined #ocaml
Lomono has joined #ocaml
hkBst has joined #ocaml
<flux> this article makes me think how fast current computers would be, if memory was zero-latency cpu-bandwidth: http://embedded.com/columns/technicalinsights/205918952;jsessionid=DUY52BNZTH1QIQSNDLRSKHSCJUNN2JVN?printable=true
ofaurax has quit ["Leaving"]
ofaurax has joined #ocaml
ofaurax has quit [Client Quit]
ofaurax has joined #ocaml
alexyk has quit []
<thelema> flux: I try my best not to think of memory as slow, but yes.. I guess it is.
<flux> thelema, well, it is a tacit assumption in mostly everything that memory is fast, except for some reason not using it a lot is even faster ;)
<flux> O(this) and O(that)..
<thelema> This might relate to ocaml's speed efficiency - that stealing a bit from ints is worth the extra CPU needed to work with it because the ram savings...
<thelema> It may also explain ocaml
<thelema> 's tendency to not inline everything
jeanbon has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
alexyk has joined #ocaml
ofaurax has quit ["Leaving"]
jeddhaberstro has quit []
animist has joined #ocaml
alexyk has quit []
schme has quit ["leaving"]
<sporkmonger> i'm confused
<sporkmonger> this errors out: (Printf.printf "%s\n" print_ast_internal(ast))
<kaustuv> move the ( from after print_ast_internal to before it
<sporkmonger> ah, ok
<sporkmonger> right, of course
alexyk has joined #ocaml
yziquel has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
Camarade_Tux has quit ["Leaving"]
jeanbon has quit ["EOF"]
Lomono has quit ["Don't even think about saying Candlejack or else you wi"]
monadic_kid has joined #ocaml
Associat0r has quit [Read error: 104 (Connection reset by peer)]
sfmatt has joined #ocaml
Lomono has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
monadic_kid has quit ["Leaving"]
<yziquel> what's your favourite implementation for priority queues?
slash_ has quit [Client Quit]
<Lomono> yziquel: my understanding of computer science is very lacking, but I can direct you to http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf if you've not heard of it already (unlikely)
<yziquel> Lomono: thanks for this document. Seems very interesting.
alexyk has quit []
seafood has joined #ocaml
seafood has quit []
seafood has joined #ocaml
Lomono has quit ["Don't even think about saying Candlejack or else you wi"]
ikaros has quit ["Leave the magic to Houdini"]
<palomer> hrmph
<palomer> anyone know what comma_ctyp, comma_expr, comma_ipatt and comma_patt mean?
<palomer> or, rather, where can I find the definition of Camlp4Syntax?