ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.1 announcement at http://ocaml.org/releases/4.02.html | Public channel logs at http://irclog.whitequark.org/ocaml
lambdahands has joined #ocaml
_um has joined #ocaml
oscar_toro has quit [Ping timeout: 252 seconds]
Ori_B_ has joined #ocaml
Ori_B has joined #ocaml
Ori_B has left #ocaml [#ocaml]
manu3000 is now known as manud
AltGr has joined #ocaml
colbseton has joined #ocaml
swgillespie has quit [Ping timeout: 246 seconds]
oscar_toro has joined #ocaml
swgillespie has joined #ocaml
rock_neurotiko has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 264 seconds]
SrPx has joined #ocaml
madroach has joined #ocaml
<SrPx> Hello...is there any set of benchmarks comparing the speed of bytecode vs native programs?
<SrPx> just for the sake of enlightment
NoNNaN has quit [Remote host closed the connection]
jonludlam has quit [Quit: Coyote finally caught me]
Simn has quit [Quit: Leaving]
enitiz has quit [Quit: Leaving]
RossJH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_5kg has quit [Ping timeout: 264 seconds]
_5kg has joined #ocaml
<nojb> hey, I patched ocamllex to recognize utf8 encoded text : https://github.com/nojb/ocaml/compare/ocamllex-utf8?expand=1 .
<whitequark> sigh
<whitequark> why not just use ulex or better sedlex
_5kg has quit [Ping timeout: 244 seconds]
colbseton has left #ocaml ["WeeChat 0.3.7"]
<nojb> i like ocamllex :) also sedlex does not allow to bind variables to sub regexp
<pippijn> nojb: I like it
<whitequark> nojb: the major problem with that patch is that it generates really huge lookup tables
<whitequark> nojb: another major problem is that it doesn't define any existing unicode ranges
<nojb> yes that’s true
<nojb> that can easily be added
<nojb> re the huge tables it may be better to use the -ml backend when using utf8
<whitequark> it should generate decision trees, like sedlex does
<whitequark> and I think ulex too
<nojb> that is what using the -ml backend amounts to
badkins has quit []
<whitequark> ah
<nojb> it generates ocaml pattern matching code which in turn gets translated into decision trees
<whitequark> I wonder if those are efficient, for tens of thousands of characters
<whitequark> e.g. look at XID_Continue
<whitequark> regarding sedlex (and ulex) not allowing binding variables, that is true, and annoying
<whitequark> so, I would patch sedlex instead :p
_5kg has joined #ocaml
<nojb> re xid_continue: since ocamllex only matches bytes I think it should be faster than sedlex which matches unicode characters (if I remember correctly)
<Drup> nojb: I can even give you the reference of a paper to modify sedlex for patterns capture, written by pippijn x)
hhugo has quit [Quit: Leaving.]
<whitequark> nojb: benchmarks!
<nojb> I’m working on it :)
<whitequark> sedlex does match characters
enitiz has joined #ocaml
<pippijn> character is an overloaded term in unicode
<whitequark> sedlex matches characters in the meaning that unicode gives to the term
<pippijn> where is that meaning defined?
<whitequark> unicode glossary?
swgillespie has quit [Max SendQ exceeded]
<whitequark> right, saying code point would be unambiguous here.
swgillespie has joined #ocaml
<pippijn> I think so
<nojb> where can I find a simple sedlex example ?
zwer_h is now known as zwer
yminsky has joined #ocaml
nonuby has quit [Remote host closed the connection]
<mistym> Is there an "opam --no" equivalent to --yes? I'm wanting to automate opam init and tell it "no" to its request to alter my dotfiles.
<pippijn> mistym: yes no | opam
<mistym> pippijn: That's what I ended up doing
<whitequark> hi mistym
<whitequark> I think opam init --no-setup does it
<mistym> whitequark: Thanks!
<mistym> Yep, that did the trick.
pyon has quit [Ping timeout: 265 seconds]
lostman has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
yminsky has quit [Quit: yminsky]
lordkryss has quit [Quit: Connection closed for inactivity]
lambdahands has quit [Ping timeout: 245 seconds]
swgillespie has quit [Ping timeout: 272 seconds]
_um has quit [Remote host closed the connection]
q66 has quit [Quit: Leaving]
lambdahands has joined #ocaml
SrPx has quit [Ping timeout: 246 seconds]
nojb has quit [Quit: nojb]
_um has joined #ocaml
<jneen> if i have a type error
<jneen> that says it can't match to type expressions
<jneen> but those two type expressions are syntactically equivalent
<jneen> what might be the things that could be happening
<jneen> specifically, an error between my mli file and the implementation
<jneen> oh and neither type expr is polymorphic, no type variables
enitiz has quit [Ping timeout: 246 seconds]
<jneen> more specifically, http://pastebin.com/t1YcNsub
<whitequark> you could have opened another module in intf but not impl
<jneen> hm
<jneen> so i didn't open any modules in the interface
<jneen> but i did in the implementation
Rebelion has joined #ocaml
<jneen> lemme just make them the same real quick
<jneen> hm, nope same thing
<Drup> paste everything
<jneen> k one sec
<jneen> it thinks its coffeescript lol
<jneen> uh
<jneen> and the error
enitiz has joined #ocaml
swgillespie has joined #ocaml
<Drup> and the .mli ?
<Drup> ah, nevermind
<pippijn> the new bytes thing makes me copy a lot :\
darkf has joined #ocaml
swgillespie has quit [Max SendQ exceeded]
BitPuffin has quit [Ping timeout: 252 seconds]
swgillespie has joined #ocaml
<struktured> curse you ocaml forge...please..load....
<Drup> jneen: hum, I don't really know, it's weird
kapil__ has joined #ocaml
<Drup> no error reported if you comment the parse declaration in the .mli ?
Rebelion has quit [Quit: Saliendo]
<struktured> jneen: is the line number accurate? or did you paste two files into one on hastebin, offsetting the lines in the ml file?
AlexRussia has quit [Ping timeout: 255 seconds]
AlexRussia has joined #ocaml
chinglish has joined #ocaml
ygrek has joined #ocaml
wormphlegm has joined #ocaml
AlexRussia has quit [Ping timeout: 252 seconds]
yminsky has joined #ocaml
__marius______ is now known as __marius__
__marius__ is now known as mariusae
yminsky has quit [Quit: yminsky]
swgillespie has quit [Read error: Connection reset by peer]
swgilles_ has joined #ocaml
araujo has quit [Quit: Leaving]
AlexRussia has joined #ocaml
larhat has quit [Quit: Leaving.]
NoNNaN has joined #ocaml
IbnFirnas has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
<jneen> struktured: yeah sorry i concatted it in the hastebin
<jneen> the line 111 it reports is on line 153 ovf the paste
<jneen> Drup: yes if i comment that and the declaration of `tag`
swgilles_ has quit [Ping timeout: 245 seconds]
enitiz has quit [Ping timeout: 272 seconds]
swgillespie has joined #ocaml
swgillespie has quit [Ping timeout: 240 seconds]
myyst has joined #ocaml
moei has joined #ocaml
yaewa has quit [Ping timeout: 264 seconds]
AlexRussia has quit [Ping timeout: 265 seconds]
samrat has joined #ocaml
JuggleTux has quit [Ping timeout: 264 seconds]
lambdahands has quit [Ping timeout: 245 seconds]
AlexRussia has joined #ocaml
MercurialAlchemi has joined #ocaml
<ygrek> what do you guys do with "findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /home/ygrek/.opam/4.02.1/lib/ocaml/compiler-libs, /home/ygrek/.opam/4.02.1/lib/ocaml" ?
jao has quit [Ping timeout: 276 seconds]
<whitequark> nothing
<ygrek> deleting one cmi will break either toplevel or lib I guess?
<whitequark> yes
<ygrek> crap
<ygrek> there is a ticket for this I hope
<whitequark> although, I don't see why it must break the lib
<whitequark> but iirc I tried it and it does
<whitequark> no, there is no ticket.
testcocoon has quit [Quit: Coyote finally caught me]
<ygrek> anything stops me from creating one? :)
<whitequark> no
<whitequark> please cc me if you do
testcocoon has joined #ocaml
<whitequark> thanks
swgillespie has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
lambdahands has joined #ocaml
lambdahands has quit [Ping timeout: 240 seconds]
<jneen> i wonder if it's something to do with that nested variant?
testcocoon has quit [Quit: Coyote finally caught me]
<jneen> this is what it does if i replace the type of parse with 'a (i.e. what it thinks it is)
<jneen> the expr type has more cases...?
testcocoon has joined #ocaml
<jneen> welp
<jneen> i figured it out
<jneen> i spelled it `Lam in one place and `Lambda in another
<jneen> pebkac
ebzzry has quit [Remote host closed the connection]
wormphlegm has quit [Quit: leaving]
booly-yam-4366 has quit [Ping timeout: 246 seconds]
vodkaInferno has joined #ocaml
vodkaInferno has quit [Client Quit]
vodkaInferno has joined #ocaml
jave has quit [Ping timeout: 245 seconds]
keen__________37 has joined #ocaml
Submarine has quit [Remote host closed the connection]
keen__________36 has quit [Ping timeout: 245 seconds]
Kakadu has joined #ocaml
ygrek has joined #ocaml
ggole has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
_um has quit [Read error: Connection reset by peer]
Haudegen has quit [Ping timeout: 264 seconds]
Haudegen has joined #ocaml
testcocoon has joined #ocaml
larhat has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Remote host closed the connection]
swgillespie has quit [Ping timeout: 252 seconds]
lostman has quit [Quit: leaving]
hhugo has joined #ocaml
lu324 has quit [Remote host closed the connection]
decaf has quit [Ping timeout: 245 seconds]
booly-yam-4366 has joined #ocaml
lu324 has joined #ocaml
lambdahands has joined #ocaml
hhugo has quit [Quit: Leaving.]
lambdahands has quit [Ping timeout: 272 seconds]
Thooms has joined #ocaml
RossJH has joined #ocaml
ollehar has joined #ocaml
mbac has quit [Remote host closed the connection]
matason has joined #ocaml
mort___ has joined #ocaml
axiles has quit [Quit: Quitte]
Thooms has quit [Quit: WeeChat 1.0.1]
Thooms has joined #ocaml
Thooms has quit [Client Quit]
Guest58109 is now known as johnelse
mort___ has left #ocaml [#ocaml]
dsheets has quit [Ping timeout: 255 seconds]
RossJH has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Simn has joined #ocaml
pyon has joined #ocaml
pyon has quit [Client Quit]
Haudegen has quit [Ping timeout: 264 seconds]
pyon has joined #ocaml
Haudegen has joined #ocaml
jonludlam has joined #ocaml
_andre has joined #ocaml
Thooms has joined #ocaml
pyon has quit [Ping timeout: 245 seconds]
dsheets has joined #ocaml
sgnb` has joined #ocaml
<Leonidas> jneen: yeah, that's a problem with polymorphic variants :+(
lambdahands has joined #ocaml
lambdahands has quit [Ping timeout: 276 seconds]
AltGr has left #ocaml [#ocaml]
ygrek_ has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
mort___ has joined #ocaml
antegallya has joined #ocaml
pyon has joined #ocaml
antegallya has quit [Ping timeout: 272 seconds]
yomimono has joined #ocaml
siddhart1v has joined #ocaml
siddhart1v has quit [Client Quit]
siddharthv has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
<dmbaturin> If I want logging (with syslog support), what library should I use?
<companion_cube> apparently there's a binding to syslog on opam
<companion_cube> Lwt also has some support
<companion_cube> not sure whether dolog does
BitPuffin has joined #ocaml
<dmbaturin> companion_cube: Since I'm going to use Lwt anyway, guess I should look into its logging functions.
mort___ has quit [Quit: Leaving.]
JuggleTux has joined #ocaml
mort___ has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
RossJH has joined #ocaml
AlexRussia has quit [Ping timeout: 264 seconds]
antegallya has joined #ocaml
yomimono has joined #ocaml
zwer_s has joined #ocaml
zwer has quit [Ping timeout: 250 seconds]
pdewacht has joined #ocaml
uris77 has joined #ocaml
uris77 has quit [Client Quit]
yminsky has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
endiruna has joined #ocaml
yminsky has quit [Quit: yminsky]
lambdahands has joined #ocaml
<companion_cube> dmbaturin: Lwt_log is nice
dsheets has quit [Ping timeout: 245 seconds]
<MercurialAlchemi> I've come to the conclusion that whenever you need to something with IO in OCaml, you should go the lwt route
lambdahands has quit [Ping timeout: 252 seconds]
<endiruna> i would like to create a tree(not binary) and insert elements in it. i create it by having type tree = Leaf|Node char*list tree . Now I would like to add strings to the tree. so that by following the tree one should get the strings of the tree. for example. to add the string "hello" i would add in the list of the first level 'h' and then on the second level 'e' and so on. After that i would like to add
<endiruna> another word say "world" so i would add on the first level 'w'(there is already 'h' there) and on the second level 'o' of the tree starting from 'w'
<companion_cube> MercurialAlchemi: I agree, if the IO part is non-trivial
yomimono has quit [Ping timeout: 245 seconds]
octachron has joined #ocaml
<endiruna> the list seems not to be good because it is immutable and in every insertion it should return a whole new tree
<endiruna> what should i use for this?
<companion_cube> for starters, you could use Set.Make(String)
<companion_cube> unless you explicitely need a prefix tree
<endiruna> companion_cube: would i not need a Set.Make(tree)?
<companion_cube> looks like you want to store strings
<companion_cube> it depends: 1/ are you doing this as an exercise 2/ what do you need to do with the strings
<mrvn> endiruna: a list is fine and returning a new tree is fine too. If you want that. Otherwise use a hashtbl. You might want that anyway for faster lookup.
yminsky has joined #ocaml
<mrvn> endiruna: One thing to consider though is that you might want to insert "h" "he" "hel" "hell" "hello". You would have one entry "h" with a Leaf and one entry "h" with "e"s next. That works for lists.
Kakadu has quit [Remote host closed the connection]
tane has quit [Quit: Verlassend]
<endiruna> this is the cartoon of what i want to do http://pastebin.com/UKZbamZV
<endiruna> mrvn: this is for an excercise
<endiruna> is there some library for inserting things in a string?
<endiruna> *list
<mrvn> endiruna: where is "he" in that tree?
<ggole> endiruna: just cons it onto the front (unless you need it in a particular position).
<endiruna> mrvn: i do not want to have he because i would like to check if the min keys needed for a string
<endiruna> i know how to insert in a list but it is unconvinient that i have to write always an insert for lists
<mrvn> endiruna: but "he" is one of your inputs while "h" is not. Usualy you need to know the difference.
psy_ has quit [Read error: Connection reset by peer]
<mrvn> endiruna: your type above has the "Leaf" constructor. If you add the Leafs then h would not have one but h-e would have one.
<mrvn> endiruna: is the data type given by the exercise?
sh1ken has quit [Ping timeout: 252 seconds]
<dmbaturin> Speaking of which, is insertion/deletion by returning a new tree going to affect performance too much in a real-life setting?
<endiruna> the ex is about autocomplete. so given the characters you typed(in the current string) and the words already given (that you have written before) one should find the min number of characters needed to completely determine the word you are typing
<mrvn> dmbaturin: 1) it's an exercise, 2) no. 3) it can save a lot of memory if previous trees are still being used.
<ggole> dmbaturin: Set and Map are done that way, and they perform OK
<ggole> ...OK for a balanced binary tree, anyway
<endiruna> for example suppose you have typed hi he hell you need 1 key for the first 2 for the second and 3 for the third. when you have to add a new element in the tree that is the number you are looking for
yminsky has quit [Quit: yminsky]
<mrvn> endiruna: type next = EOW | Char of char * tree and tree = next list
BitPuffin has quit [Ping timeout: 256 seconds]
<mrvn> endiruna: Then for a given tree you need to find the shortest path to an EOW.
<endiruna> right this is more or less what i had. now i have difficulties of creating the insert_to_next function
<ggole> Could just use a record char * bool * record list
<ggole> (Where the bool indicates whether a string ends there.)
RossJH has quit [Quit: Textual IRC Client: www.textualapp.com]
<mrvn> endiruna: recurse over the list. If you hit [] create a new next and return [next], otherwise modify the current next and return modified :: rest.
<mrvn> s/otherwise/if you hit the right key/
<mrvn> ggole: type node = { key : char; eow : bool; children : node list; } type tree = node list
<mrvn> ggole: not so nice
<mrvn> type tree = { eow : bool; children : (char * tree) list; }
<companion_cube> hmm, I'm wondering whether arrays might work as well as lists in this context
<companion_cube> when inserting, you always end up copying half the list in average (if it's sorted)
<mrvn> companion_cube: fixed size?
<companion_cube> well, when you insert you make a new array that has one more slot
<mrvn> hashtbl would be simpler
<companion_cube> I'm not sure
<mrvn> it copies the array for you
<companion_cube> if you create a new array, it's easy to sort it
<companion_cube> I meant in an immutable fashion
t4nk895 has joined #ocaml
<companion_cube> you just replace the list with an (immutable) array
<mrvn> Hashtbl.MAKE :)
<companion_cube> nah
<companion_cube> it's mutable and not sorted
<ggole> You could allow a choice between dense (256-long array) and sparse (list) nodes
<companion_cube> or linked lists of 256-elements arrays
<mrvn> most input will be ascii
<companion_cube> I have something like this somewhere
<ggole> That would only really make sense for mutable structures though
<companion_cube> oh, for ascii
nonuby has joined #ocaml
nonuby has left #ocaml [#ocaml]
nonuby has joined #ocaml
<mrvn> It's words, so even less than ascii (unless it's utf-8 or so).
<companion_cube> I was really thinking about (char * tree) array, replacing (char * tree) list
<t4nk895> i am trying to compile a small program with OCamlMakefile, that uses jane streets bin_prot. Do i have to add some special flags to my Makefile, because it complains about the type t .... with bin_io part
matason has quit [Quit: leaving]
<mrvn> companion_cube: I bet it makes no difference for small nodes and for large nodes an O(1) lookup as in hashtbl would be better.
<mrvn> companion_cube: unless you optimize for space.
<companion_cube> and data locality
<companion_cube> but without unboxed arrays I agree it's not very interesting
zyla has quit [Ping timeout: 255 seconds]
<mrvn> I'm always amazed how fast ocaml code runs given all the indirections. It should be dead slow.
<ggole> Fast compared to what?
<mrvn> ggole: e.g. C
<ggole> Well-written C is way faster
<ggole> But such code is usually a low-level morass.
<companion_cube> well-written rust should be much faster too
<companion_cube> without being as terrible as fast C
<ggole> Let's hope so.
Thooms has quit [Quit: WeeChat 1.0.1]
<pippijn> mrvn: I'm actually writing the same application in C++ and ocaml at the same time these days
<pippijn> mrvn: I'll have a direct comparison
<pippijn> mrvn: of course that depends on how good I am at writing efficient ocaml and C++ :)
<pippijn> I'm not putting the focus on efficiency in either language, but rather on correctness
<pippijn> however, C++ gives me a lot of ready to use tools for efficient resource management
lambdahands has joined #ocaml
lordkryss has joined #ocaml
zyla has joined #ocaml
regnat has quit [Quit: ZNC - http://znc.in]
lambdahands has quit [Ping timeout: 256 seconds]
regnat has joined #ocaml
vanila has joined #ocaml
mort___1 has joined #ocaml
yomimono has joined #ocaml
mort___ has quit [Ping timeout: 272 seconds]
<t4nk895> does someone here use OCamlMakefile with bin_prot and core?
yminsky has joined #ocaml
yminsky has quit [Client Quit]
Thooms has joined #ocaml
<ousado> I vaguely remember asking this before, but what's would be the proper name for a function that's mapping an ADT while maintaining a fold-style accumulator?
<ousado> s/what's/what
Haudegen has quit [Ping timeout: 256 seconds]
chinglish2 has joined #ocaml
<mrvn> fold
<mrvn> or foldmap
chinglish2 has quit [Client Quit]
Haudegen has joined #ocaml
<ousado> mmhm, so fold_expr or foldmap_expr
badkins has joined #ocaml
chinglish has quit [Ping timeout: 245 seconds]
chinglish2 has joined #ocaml
chinglish2 is now known as chinglish
<ousado> I really want a thing that generates those from an ADT
<ggole> ppx_deriving does that iirc
<ousado> does ppx_deriving duplicate the typer?
<ggole> Not really.
<companion_cube> ousado: it's not obvious how to /map/ an AST
<ggole> Some compile time information is made available through the recent extension points work. ppx_deriving is a library which consumes that info.
<companion_cube> for inner nodes, do you first try to map it to another node, or do you map sub-nodes first?
nonuby has quit [Ping timeout: 252 seconds]
psy_ has joined #ocaml
lambdahands has joined #ocaml
<ousado> companion_cube: in this case it just means applying f to all constructor arguments of type expression, mapping expression lists, etc.
<ggole> So iter, rather than map?
<ousado> no, f always returns an expression and the context
<ia0> companion_cube: I guess the /map/ maps on the 'a of the ADT, so it's quite precise
<ousado> s/context/accumulator
<ia0> he wants something like ('a -> 'c -> 'b * 'c) -> 'a btree -> 'c -> 'b btree * 'c
<ia0> where 'c is the accumulator
dsheets has joined #ocaml
<ia0> it's some sort of mapM (monoidal map)
<ia0> it's more clear with the following type: (('a * 'c) -> ('b * 'c)) -> ('a tree * 'c) -> ('b tree * 'c)
<ousado> and I'm adding the accumulator
<ousado> yes, looks about right
<ia0> type 'a state = 'a * 'c
<ia0> and you get: ('a state -> 'b state) -> 'a tree state -> 'b tree state
<ia0> it's a read/write monade
siddharthv is now known as siddharthv_away
<ousado> yes.. I thought about using a mutable ctx, but that doesn't feel right, and there's too much to get wrong.
<ia0> yes, using a mutable ctx would allow to use map
<ggole> Hmm, that doesn't look regular enough to derive without a bit of fiddling around
<ggole> eg, the first bunch of constructors don't have f applied
<ggole> (Unless I'm missing something.)
<ia0> that's right
<ia0> but it is similar to fold in that manner
<ousado> hm, you're right (which is why I like things that give me readable code)
t4nk895 has quit [Ping timeout: 246 seconds]
<ousado> actually it's regular
<ousado> those constructors don't have nested expressions
<ousado> they're leafs
pyon has quit [Ping timeout: 245 seconds]
<ggole> Oh, right
<ia0> let fold_map f tree zero = let acc = ref zero in map (fun x -> let y, tmp = f x !acc in acc := tmp; y) tree, !acc
<ia0> this has the first type I gave (but uses the mutable accumulator)
enitiz has joined #ocaml
<ia0> it's simply a map with the fold behavior
<ia0> said otherwise, fold can be implemented with map, which shows they are similar and can be merged
<ia0> let fold f zero tree = let acc = ref zero in map (fun x -> acc := f !acc x) tree; !acc
<mrvn> ia0: mutable acc is evil
<ousado> especially in this case..
<ggole> The stdlib is written that way
<ggole> As long as the ref doesn't escape it should be fine
<ia0> mrvn: agreed
<mrvn> fold is the more powerfull construct and map a subset
<mrvn> ggole: huh? why would stdlib have a mutable acc on fold?
<ggole> Why not?
<mrvn> ggole: because it is completly unnecessary
uris77 has joined #ocaml
<ggole> Who cares? It's a clear and efficient way to write the function.
<mrvn> ggole: no. Its a stupid way to write the function
<ia0> mrvn: fold is more powerful than map in theory, not in practice
<ia0> fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
<ia0> map : ('a -> 'b) -> 'a t -> 'b t
<ia0> this fold is less powerful because it ignores leaf nodes or nodes without 'a
<ggole> ia0: depends which fold, really
<ia0> yes
<ia0> the fold from Coq (generated one) is more powerful because it contains the ADT definition
<ggole> Right folds are isomorphic to the data structure
<ia0> in theory
<ia0> not in practice
<vanila> you mean theyre not as efficient for certain algorithms?
<ia0> the type is not the one I just gave
<ia0> the type would be a description of the ADT
<ggole> Well, that isn't a right fold.
<ia0> and thus different each time
<ia0> while map is always the same type for a "'a t"
<ia0> ggole: but usually the "'a t" fold with type "('b -> 'a -> 'b) -> 'b -> 'a t -> 'b" is enough for most uses
<ia0> those where 'a t is a container
<mrvn> ia0: if you want to map then use map, if you want to fold then fold. While you can implement one with the other doing so is just stupid.
siddharthv_away is now known as siddharthv
<vanila> hey guys i have aquestion about compiling
<ia0> mrvn: again I agree, it was just an example to explain why fold and map can be combined
<vanila> not ocaml just compilers ingelera
<vanila> in general
<ia0> because they just do the same thing
<vanila> where sould I ask it??
<ia0> "fold over the ADT"
<ia0> and each one does a specific thing
<ia0> I talk about the usual fold and map
<mrvn> ia0: except they don't, which is where your "more powerfull" comes from
<ia0> not the powerful Coq generated fold
<ia0> which is not the one you usually have in OCaml programs
<mrvn> vanila: over there --->
<vanila> in my understanding, foldC C1 C2 C3 (the constructors) is the identity function
<ia0> mrvn> ia0: except they don't, <= to which sentence do you refer?
<mrvn> ia0: 14:55 < ia0> because they just do the same thing
<ggole> ia0: the fold which people usually talk about as being universal is the second, though
<ia0> vanila: right
<vanila> so what is the problem ??
<ia0> ggole: ah ok, so why don't they use it?
<vanila> its hard to compute tail of a list with folds
<vanila> you can do it but its O(n)
<ggole> Usually you just expose the constructors
<ia0> mrvn: ok, so from the sentences that followed you understood that "the same thing" meant "fold over the ADT and produce some stuff"
<vanila> so folds can be algorithmically slower than using the pattern matching/recursion
<mrvn> vanila: to find the tail of a list requires looking at every element of the list ==> O(n) is optimal.
<vanila> mrvn, no
<ia0> mrvn: the tail, not the last element
<mrvn> vanila: or do you mean like List.tl?
<mrvn> ia0: I was thinking the tail as in the last 10 items or so
<ia0> vanila: yes, the generic fold (the one only Coq users use) in purely theoretical
<ia0> mrvn: ah ok
<vanila> well even Coq doesn't strictly abide to folds
<ia0> yes
<vanila> the real primitive is pattern matching
<vanila> sadly...
<ousado> ia0: actually at least one haxe user does too :)
<mrvn> WTF would one ever fold to get List.tl? Why not compute the powerset of the list and pick the one element thats the tail?
mort___1 has quit [Quit: Leaving.]
<ousado> heh
<mrvn> Note that fold requires a tail primite already
<ggole> It's how you embed data types in the lambda calculus
matason has joined #ocaml
rand000 has joined #ocaml
mort___ has joined #ocaml
yminsky has joined #ocaml
BitPuffin has joined #ocaml
<companion_cube> looks like a fold
<companion_cube> ("catamorphism" to haskellers, I think)
<companion_cube> have you looked at Ast_mapper? :)
<ousado> I don't think so?
<def`> that's the kind of code I would really like to derive :)
<def`> deriving Traversable :P
<ousado> indeed
<companion_cube> I suppose a plugin to ppx_deriving could do it
<def`> Ast_mapper is part of the compiler(-libs) (in parsing/ast_mapper.mli), doing more-or-less the same on ocaml asts
coext has joined #ocaml
<coext> my opam upgrade fails with both custom_prinf and merlin
pyon has joined #ocaml
<coext> using ocaml 4.02.0 and opam 1.1.1
<def`> coext: what's the error message for merlin?
<def`> ouch
<def`> you should update to 1.2.0 at least
psy_ has quit [Ping timeout: 245 seconds]
<def`> (just updating opam binary did it for me)
<coext> def`: let me paste bin it
enitiz has quit [Quit: Leaving]
<coext> def`: oh ok, seems like I just recently upgraded opam
<coext> shouldn't we be able to opam install opam?
<def`> :) maybe, but it's not the case
<def`> Ok, that's unrelated
<coext> merlin was installing fine until the previous version
<coext> custom_printf on the other hand, I've been stuck for a long time now
<coext> I'll try updating opam then
<def`> coext: it needs a new version of ocamlfind
shinnya has joined #ocaml
<coext> coext: I see
<coext> def`: I see
<def`> could you update ocamlfind separately, the constraints are not up-to-date in merlin package
<coext> yeap got it
<def`> so forget what I said about opam 1.2.0, you're probably fine with it… at least for some time ;)
siddharthv is now known as siddharthv_away
yminsky has quit [Quit: yminsky]
zyla has quit [Quit: WeeChat 0.4.3]
zyla has joined #ocaml
<coext> ouch my plasm5 fonts are all borked brb
ebzzry has joined #ocaml
coext has quit [Remote host closed the connection]
jabesed has joined #ocaml
endiruna has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 245 seconds]
rand000 has quit [Quit: leaving]
lordkryss has quit [Quit: Connection closed for inactivity]
larhat has quit [Quit: Leaving.]
siddharthv_away is now known as siddharthv
Hannibal_Smith has joined #ocaml
moviuro has joined #ocaml
<moviuro> Hi all! I have some issues with unison on Arch (latest, 2.38 IIRC): http://sprunge.us/DRhR
<moviuro> it complains about a bad bigarray kind :( (and I have no idea what it is)
<moviuro> (unison 2.48, my bad)
Hannibal_Smith has quit [Client Quit]
Hannibal_Smith has joined #ocaml
<Leonidas> yeah, that's a bug in Unison
<Leonidas> http://www.cis.upenn.edu/~bcpierce/unison/download.html meh, download links all broken
BitPuffin has quit [Read error: Connection reset by peer]
<moviuro> ah, crap
<moviuro> Leonidas: do you have a link to the bug report?
<Leonidas> no idea if this is reported
jonludlam has quit [Quit: Coyote finally caught me]
booly-yam-4366 has quit [Ping timeout: 276 seconds]
BitPuffin has joined #ocaml
Haudegen has quit [Ping timeout: 245 seconds]
Thooms has quit [Ping timeout: 264 seconds]
uris77 has quit [Ping timeout: 240 seconds]
kapil__ has quit [Quit: Connection closed for inactivity]
<moviuro> Leonidas: also, how do you tell it's unison's fault? ^_^
Haudegen has joined #ocaml
zwer_s is now known as zwer
yomimono has quit [Ping timeout: 244 seconds]
uris77 has joined #ocaml
tane has joined #ocaml
Kakadu has joined #ocaml
jonludlam has joined #ocaml
<Leonidas> moviuro: because that's an exception that is thrown by the application?
darkf has quit [Quit: Leaving]
_twx_ has quit [Remote host closed the connection]
uris77 has quit [Read error: Connection reset by peer]
yomimono has joined #ocaml
uris77 has joined #ocaml
MrScout_ has joined #ocaml
octachron has quit [Remote host closed the connection]
Snark has quit [Quit: leaving]
booly-yam-4366 has joined #ocaml
jabesed has quit [Quit: Konversation terminated!]
MrScout_ has quit [Remote host closed the connection]
antegallya has quit [Ping timeout: 264 seconds]
ollehar has quit [Ping timeout: 272 seconds]
slash^ has joined #ocaml
psy_ has joined #ocaml
arj has joined #ocaml
rand000 has joined #ocaml
mort___ has quit [Ping timeout: 265 seconds]
yomimono has quit [Ping timeout: 272 seconds]
wwilly has joined #ocaml
coext has joined #ocaml
<coext> def`: the culprit with my messy opam state seems to be jane street's core lib
<coext> def`: - downgrade ocamlfind.1.5.5 to 1.5.1 [required by async, core_extended, zed]
<coext> :/
zyla has quit [Quit: WeeChat 0.4.3]
<Drup> do you have aspcud installed ?
<Drup> :D
leowzukw has joined #ocaml
enitiz has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
Submarine has joined #ocaml
<coext> Drup: who? what?
<Drup> you, aspcud :p
<Drup> do you have it installed on your system
<Drup> ?
<coext> let me check
<coext> Drup: nope
<coext> Drup: should I?>
<Drup> if you can, yes
<Drup> opam will use it for dependency solving
<coext> I see
<coext> let me check
<coext> so it will use that instead of ocamlfind?
<coext> and should I remove ocamlfind then?
<Drup> no no, dependency solving as in "which package should be installed when you do opam install foo"
<Drup> it's unrelated to ocamlfind
<coext> Drup: I see but, opam does seem to be figuring out the dependencies
<coext> Drup: it just seems core needs ocamlfind 1.5.1
<coext> Drup: or do you think that's wrong?
<coext> hmmm "opam install aspcud" doesn't work
<coext> and my distro doesn't provide a package either
<dbp> hey, does anyone know how list literals are represented in the AST? I'm looking at the expression definition, and I see tuples and arrays, but no lists...
vanila has quit [Quit: Leaving]
q66 has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
<thizanne> dbp: with Pex_construct
oscar_toro has quit [Read error: Connection reset by peer]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
Haudegen has joined #ocaml
matason has quit [Ping timeout: 256 seconds]
oscar_toro has joined #ocaml
antegallya has joined #ocaml
coext has quit [Ping timeout: 272 seconds]
chinglish has quit [Quit: Nettalk6 - www.ntalk.de]
antegallya has quit [Quit: Leaving.]
arj has quit [Quit: Leaving.]
oskarth_ is now known as oskarth
AlexRussia has joined #ocaml
mekaj has quit [Ping timeout: 244 seconds]
darkf has joined #ocaml
darkf has quit [Changing host]
darkf has joined #ocaml
mekaj has joined #ocaml
dsheets has joined #ocaml
uris77 has quit [Quit: leaving]
leowzukw has quit [Ping timeout: 246 seconds]
leowzukw has joined #ocaml
ygrek has joined #ocaml
govg has quit [Quit: leaving]
govg has joined #ocaml
Hannibal_Smith has quit [Quit: Leaving]
govg has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
pyon is now known as pyon-iversal-pro
pyon-iversal-pro is now known as pyon
ygrek_ has joined #ocaml
<dbp> thizanne: Thanks!
ygrek has quit [Ping timeout: 255 seconds]
uris77 has joined #ocaml
govg has joined #ocaml
govg is now known as Guest65831
slash^ has quit [Read error: Connection reset by peer]
enitiz has quit [Ping timeout: 255 seconds]
voglerr1 has joined #ocaml
willy_ has joined #ocaml
wwilly has quit [Ping timeout: 246 seconds]
sgnb` has quit [Remote host closed the connection]
lambdahands has quit [Ping timeout: 245 seconds]
leowzukw has quit [Quit: Lost terminal]
tani has joined #ocaml
Guest65831 has quit [Ping timeout: 245 seconds]
govg has joined #ocaml
govg has quit [Client Quit]
siddharthv is now known as siddharthv_away
tane is now known as Guest15087
tani is now known as tane
Guest15087 has quit [Ping timeout: 244 seconds]
ygrek_ has quit [Ping timeout: 244 seconds]
matason has joined #ocaml
sh1ken has joined #ocaml
booly-yam-4366 has quit [Remote host closed the connection]
ygrek has joined #ocaml
ggole has quit []
hhugo has joined #ocaml
booly-yam-6137 has joined #ocaml
ygrek_ has joined #ocaml
ygrek_ has quit [Remote host closed the connection]
ygrek has quit [Remote host closed the connection]
ygrek_ has joined #ocaml
enitiz has joined #ocaml
nullcat has joined #ocaml
ygrek_ has quit [Ping timeout: 276 seconds]
araujo has joined #ocaml
araujo has joined #ocaml
hhugo has quit [Quit: Leaving.]
NSA360 has joined #ocaml
Thooms has joined #ocaml
hhugo has joined #ocaml
darnuria has quit [Remote host closed the connection]
darnuria has joined #ocaml
willy_ has left #ocaml ["Leaving"]
oriba has joined #ocaml
<oriba> is there a way to get the signature of a module? I thought there was such a feature added, a while ago, but don't know how to extract the signature of a module.
<Drup> "module type of Foo"
axiles has joined #ocaml
matason has quit [Ping timeout: 245 seconds]
<oriba> Drup, hmhh, does not work
<oriba> # module type of Unix;;
<oriba> Error: Syntax error
<Drup> well, sure, you can't have a signature floating around at top level like that, you need to bind it
<oriba> ok
<Drup> if you just want to see the module of a type (as opposed to extracting the signature), use #show
<oriba> Drup, ah, it was not in the manual I thought, but it is there, just under extensions of OCaml.
<oriba> Drup, #show is nice :-)
<oriba> thx
<oriba> aha, when I say module U = Unix and then use #show, it does not work... hmhh
<oriba> bug or feature?
Muzer has joined #ocaml
nullcat has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hhugo has quit [Quit: Leaving.]
oriba_ has joined #ocaml
oriba has quit [Ping timeout: 246 seconds]
badkins has quit [Ping timeout: 245 seconds]
oscar_toro has quit [Ping timeout: 245 seconds]
Muzer has quit [Excess Flood]
AlexRussia has quit [Ping timeout: 240 seconds]
NSA360 has quit [Quit: Leaving]
MercurialAlchemi has quit [Ping timeout: 245 seconds]
Muzer has joined #ocaml
jao has quit [Ping timeout: 276 seconds]
tane has quit [Quit: Verlassend]
badon has quit [Remote host closed the connection]
lambdahands has joined #ocaml
hhugo has joined #ocaml
hhugo has quit [Client Quit]
hhugo has joined #ocaml
badkins has joined #ocaml
AlexRussia has joined #ocaml
ygrek has joined #ocaml
lordkryss has joined #ocaml
lambdaha1ds has joined #ocaml
lambdahands has quit [Ping timeout: 245 seconds]
booly-yam-6137 has quit [Ping timeout: 244 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
booly-yam-6137 has joined #ocaml
lambdaha1ds has quit [Ping timeout: 256 seconds]
hhugo has quit [Quit: Leaving.]
struktured has joined #ocaml
<thizanne> feature
<thizanne> oriba_: ocaml tells you that U is just a different name for Unix
hhugo has joined #ocaml
<oriba_> thizanne, yes, you are right. It's like with other types also.... U as shortcur for Unix, so I can ask for the type of Unix, if I want to. No excessive printing of signature necessary.
<oriba_> So, it's a feature, not a bug :-)
Kakadu has quit [Remote host closed the connection]
badon has joined #ocaml
<thizanne> oriba_: before 4.02, writing module U = Unix would actually define a new module U, not compatible with Unix
<oriba_> ? I thought I just do that
<oriba_> did the semantics changed?
<thizanne> in 4.02, yes
<thizanne> when you write module U = Unix, you just define a new name for the same module
<thizanne> that's why #show behaves like this
<oriba_> hmhh
<oriba_> aha
<oriba_> and how to create a new module, like the old style?
<thizanne> module U = struct include Unix end
<thizanne> you might want to look at generative functors also ( https://blogs.janestreet.com/ocaml-4-02-everything-else/ ) if you want this property on functors
Simn has quit [Quit: Leaving]
<oriba_> ok, thx
reem has joined #ocaml
Thooms has quit [Quit: WeeChat 1.0.1]