adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Upcoming OCaml MOOC: https://huit.re/ocamlmooc | OCaml 4.03.0 release notes: http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 244 seconds]
profmaad has quit [Quit: leaving]
<Bluddy[m]> bonhoeffer: much of the complexity that builds up as you scale up applications comes from mutable state: changing the values of variables and data structures, and having that affect interlocking systems. By removing that as much as possible, you remove some of the worst bugs that can occur, making systems far more reliable.
mfp has quit [Ping timeout: 244 seconds]
tristero has quit [Quit: tristero]
sh0t has quit [Ping timeout: 248 seconds]
ygrek has joined #ocaml
ygrek has quit [Remote host closed the connection]
michaeltbaker has joined #ocaml
bruce_r_ has quit [Remote host closed the connection]
bruce_r has joined #ocaml
wu_ng has joined #ocaml
osa1__ has joined #ocaml
<osa1__> does anyone know how to print shell escape sequences in OCaml? strings like \033[10A work in every other language except OCaml
osa1 has joined #ocaml
osa1__ has quit [Ping timeout: 244 seconds]
rbocquet has quit [Ping timeout: 272 seconds]
ee_ks has left #ocaml [#ocaml]
rbocquet has joined #ocaml
FreeBirdLjj has joined #ocaml
tristero has joined #ocaml
randomA has joined #ocaml
<randomA> hi
<randomA> i ned some quick help
<randomA> I have module AMap = Map.Make(A)
<randomA> then I want to do let mymap = B AMap.t
<randomA> but B is not detected
<Bluddy[m]> B isn't a type. Maybe B.t?
<Bluddy[m]> but you can't do that anyway, since let declares a value and you're making it equal a type
<Bluddy[m]> let mymap = AMap.empty should do the trick
<randomA> isn't B the values of the keys?
<Bluddy[m]> AMap.t is a type
<randomA> ok
<randomA> so how do i say that this map is of type B?
<Bluddy[m]> you only need to do that for the key type
<randomA> why?
<Bluddy[m]> you've created an AMap. It has key type A
<randomA> yeah
<randomA> but i want to say that the values will be B
<Bluddy[m]> The full type of the map is 'a AMap.t, and OCaml will infer that type
<randomA> oh ok
<Bluddy[m]> so you don't need to worry about it
<Bluddy[m]> the only reason you needed to tell Map that it's built for A (using the functor application) is because the key is constantly compared, and we don't want to use polymorphic comparison
<randomA> ok, if I want to print records, will Map automaticaly do that or no
<Bluddy[m]> nope. to print them, you need a print function
<randomA> that's too bad
<randomA> i tried to match the record but then i had the mismatch type with 't not equal to t
<randomA> idk
tmtwd has quit [Ping timeout: 265 seconds]
<Bluddy[m]> If you're printing the entire map of records, you'll iterate over the map, calling Printf.printf on each record
AltGr has joined #ocaml
<randomA> yes, ill do that
<randomA> actually, I just mapped modules that are records
<randomA> and have a to_string method in the module
<Bluddy[m]> That's fine. It's better
<Bluddy[m]> In that case you can use Printf.sprintf.
<randomA> Printf.printf and it works like C?
<randomA> why spritnf?
<Bluddy[m]> sprintf just returns a string
<Bluddy[m]> instead of printing to the screen
<Bluddy[m]> It's almost exactly like C, except it actually typechecks the types
wxfdglm has joined #ocaml
<randomA> cool thanks
<Bluddy[m]> So you can build up the whole string, and then call print_string on the whole thing
<randomA> and it's also ok for me to have let compare t1 t2 = Pervasives.compare t1 t2 right if all my types are records
<randomA> Bluddy[m]: and yeah, i'm gonna do that
<randomA> This is due at 11:59 and it's 10:43 so im probably fucked, but at worst, i
<Bluddy[m]> yes that'll work fine if there's no map inside the record
<randomA> ll be a day late
<randomA> ok, no maps inside records
<randomA> ive essentially wrapped all my types inside modules
<Bluddy[m]> then Pervasives.compare is great
<randomA> and then used the modules to add functions
AltGr has left #ocaml [#ocaml]
<Bluddy[m]> okey doke. Once again, if it gets too confusing and you have trouble getting it to work, you can get rid of the modules and just place everything in the same module.
<randomA> thanks for like answering my questions btw. I really appreciate it even though i don't think I'll have this done on time
<Bluddy[m]> no prob
magnumkarter has quit [Ping timeout: 240 seconds]
magnumkarter_ has quit [Ping timeout: 240 seconds]
<randomA> if I want to create an alias called exits which is a map of rooms to exits, then that would be Exit Room.Map.t
<randomA> how come I can go type treasuremap = room Item.Map.t but not type treasuremap = Room Item.Map.t
<Bluddy[m]> Room is a module, not a type
<Bluddy[m]> Room.room is a type
<Bluddy[m]> as is room (if you defined that alias type)
<randomA> wow
<randomA> so if i was like room = { .... } then did module Room = struct type t = room, then is room = Room.room
shinnya has quit [Ping timeout: 260 seconds]
tmtwd has joined #ocaml
<Bluddy[m]> well, where did you define the type? type room = { ... }
<Bluddy[m]> you don't really need room on the outside. You could just use Room.t
<Bluddy[m]> But no it's not Room.room, it's Room.t
<Bluddy[m]> since inside the Room module you define type t
<randomA> yeah
<randomA> i saw it i n an example most likelyu dotn
<Bluddy[m]> So inside Room, you can make type t = {...}
<Bluddy[m]> with the details of room
<randomA> and then just spam Map.t
<randomA> so tired
<Bluddy[m]> long day, huh?
<randomA> i ve been up 48 hours and no joke am starting to hallucinate shadows
<Bluddy[m]> like Don't Starve!
<Bluddy[m]> know that game?
<randomA> but like, i was trying to do this project yesterday then got distracted by picking out sublime theme colors
<randomA> and nope, dont know
<Bluddy[m]> yeah it's a survival game where you start hallucinating shadows as you go mad
<randomA> that's unfortuante
<randomA> its not like people shadows, it's like i see this dark glimps fly accross the peripheral of my vision
<randomA> kind of like what happens hwne you see a bug
<randomA> it;s apparentlt an allnighter thing
<Bluddy[m]> yeah makes sense
<Bluddy[m]> if you're far from getting it done (and it sounds like it, since you're missing quite a bit) I recommend going to sleep now
<randomA> hmm, do you think i can write the game loop, create the functions for implementing game state, parse json to the correct types, and get user input in 1 hour?
<Bluddy[m]> no way
<randomA> lol are you actually a TA
<Bluddy[m]> sorry :(
<Bluddy[m]> this stuff takes time
<randomA> i'll put your username in the acknowledgement comments
<Bluddy[m]> sweet
<randomA> you're not actually a TA for this class, right?
<Bluddy[m]> nope
<randomA> i'm pretty sure that other guy was
<randomA> because he was referencing the exact json names
<randomA> either he was a TA or was a the proffessor lol
<Bluddy[m]> yeah could be
<randomA> thats funny if actual professor was him and then connected me to this username bc he doesnt know me but i shit post a ton on this class forum thing
<Bluddy[m]> piazza?
<Bluddy[m]> everybody uses piazza
<randomA> yah lol
<Bluddy[m]> it's great
<randomA> nah, the layout is shitty
<randomA> Are you a student here then? also taking this class
<randomA> thatd be funny
<Bluddy[m]> no i'm in a different school
<Bluddy[m]> Hopkins
<Bluddy[m]> but I think I know which school you're at
<randomA> oh ok
<randomA> is it in my host id?
<randomA> apparently that happens
<randomA> ~hostname
<randomA> eh
<Bluddy[m]> no i just searched for an OCaml course, and then I looked at the schedule
<Bluddy[m]> you mentioned you just did functors
<randomA> oh lol
<randomA> and you see the writeup for the project
<randomA> it's so cool, but I always waste a lot of time on trying to print and trying to get types to match
<randomA> Btw, do you know how testing should be done?
<randomA> like I know o unit tests
<randomA> but it's an entire game, so I don't know how I would test some of this stuff
<Bluddy[m]> well, the general rule is, the more functional you make your functions (ie. no mutable state), the easier it is to test
<Bluddy[m]> you just feed them input and compare to the output
<randomA> ok, there is no mutable for sure
<randomA> alright, i guess ill do a ton of assertequal
<randomA> so i need to aprse json into these types, which was the reason why I decied to put the type outside because i didn't think ic oudl parse into a module
<Bluddy[m]> holy crap dude, you expected to do this thing in 2 days?
<randomA> I think it will work if I do something variants and pattern matching, like all of these are not variatns of each other
<randomA> Bluddy[m]: i mean yeah, i was up for 48 hours
<randomA> on a lot of stims
<Bluddy[m]> it's a large assignment
<randomA> yeah, it is. It's really cool though.
<Bluddy[m]> yeah pretty awesome
<randomA> so for parsing json into modules, is that a thing or no? I was going to pattern match but didn't know how to do that nicely
<Bluddy[m]> into types, not modules
<Bluddy[m]> remember -- modules are just wrappers. like plastic bags
<randomA> right, so that's why i have the types on the outside and not inside
<Bluddy[m]> that part doesn't matter so much. you can have your types inside the modules or outside them. Either way you'll access them the same way
<Bluddy[m]> It's purely organizational to have them inside modules
<Bluddy[m]> Like a sandwich. You can put it in a plastic bag or outside it, it's the sandwich that matters
<randomA> oh that's interesting
<Bluddy[m]> anyway, yojson will read the json text and create a tree of variants: float, int, all the variants it has to describe data
<randomA> right
<randomA> i understand all that
<Bluddy[m]> the tree will resemble what's in the json file
<Bluddy[m]> you then go over the tree and build your records
<Bluddy[m]> ok
<Bluddy[m]> so what was your question again?
<randomA> what do you mean by go over tree?
<randomA> and so i should def put my types inside my modules?
<randomA> and this hallucination thing is getting weird as in some depth is getting squigly
<Bluddy[m]> you've already got your types inside modules, so keep them that way. it doesn't matter so much, like i said.
<randomA> ok
<Bluddy[m]> go over the tree means you'll create a function that examines the tree (pattern matches)
<Bluddy[m]> so you'll get yojson's output, and then you'll match on it
<randomA> so then if I'm aliasing, I have to do type exits = Room.t Exit.Map.t
<randomA> yeah, ok so this is the part that confused me
<randomA> what does it mean by iterate over tree?
<randomA> in rwo they don't really do that, he just kind of goes through all his values
<Bluddy[m]> ok so how does yojson represent something like a record? json format is pretty limited
<randomA> curly braces and list
<Bluddy[m]> if you're using Json.Basic, you'll have Assoc of (string * json) list
<randomA> array of curly brases
<Bluddy[m]> so you'll try to find that inside your function, and then you'll go through the elements and match them up with what your record has
<Bluddy[m]> array of curly braces is the JSON text, but you want to think in terms of the Yojson data type
<Bluddy[m]> type json
<randomA> so what happens if they ahve a record inside the record, then the parsing must be recursive?
<randomA> do you think i'll finish this by tomorrow?
<randomA> i get another 24 hours
<Bluddy[m]> in that case it could be recursive, but you know what depth to expect. You're using your data format as a guideline. Your records have no inner record, so if you see a list inside the list, you know something's wrong and can report an error. But let's say your room record has only an int -- you'll look for that int inside the list and create the corresponding room record.
<randomA> this is similar to pattern amtching on records then
<randomA> ah ok
<Bluddy[m]> Yeah, but variants are a little different since you can have multiple options, one for each variant.
<randomA> i patternmatch on JSON's variants
<randomA> can I extend JSON to give it variants that will match my types?
<Bluddy[m]> no
<Bluddy[m]> There's a way to automatically generate json for your type with ppx (a preprocessor), but you don't want to mess with that and you're probably not supposed to
<randomA> ok
<Bluddy[m]> JSON only has a few data types anyway, and that's what the variants represent
<randomA> Alright. That seems good
<Bluddy[m]> I recommend doing the best that you can to get a working prototype as soon as you can. Tomorrow -- get some sleep.
<Bluddy[m]> Take shortcuts to get to the point where something is working.
<Bluddy[m]> Then build out from there.
<randomA> And the last issue is that apaprently "directions" are suppose to come from the JSON, so there's no default directions like "UP, DOWN, LEFT"...is it possible to parse the json values into a variant?
<Bluddy[m]> You'll get a String variant from yojson with the text inside
<Bluddy[m]> And you can convert that to your own direction type
<randomA> so type direction = blah of String
<Bluddy[m]> no you want to create a type with your own variants
<Bluddy[m]> e.g. type direction = North | South | East | West | Up | Down
<randomA> but what if they have northeast
<Bluddy[m]> But I'm thinking maybe you just want to have an instruction type:
<Bluddy[m]> ah ok directions are custom-made
<Bluddy[m]> if you have an instruction type, type instruction = Direction of string | Take of item | Drop of item ...
<Bluddy[m]> something like that
<randomA> actually, dont i not need to use variants
<randomA> i can just say they are keys
<randomA> of type string
<Bluddy[m]> you could. It's traditional to use variants, but you don't have to
<Bluddy[m]> at least in this case you don't have to
<Bluddy[m]> variants give you some nice properties, like knowing you covered the entire space of possibilities when you pattern match
<randomA> ill try first, but i dont want be like two days late
<Bluddy[m]> yeah do whatever it takes
<Bluddy[m]> i gotta go to sleep. so should you.
<Bluddy[m]> good luck
<randomA> thanks!
<randomA> and thanks for answering questions
lgstate has joined #ocaml
<lgstate> is there by any chance any screen cast that walks thorugh step by step implementing each of the type checkers in TAPL? (the source is already online; but I'm looking for a screen cast)
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 265 seconds]
AlexDenisov has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
wxfdglm has quit [Ping timeout: 248 seconds]
MercurialAlchemi has joined #ocaml
jao has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 265 seconds]
tmtwd has quit [Ping timeout: 272 seconds]
ccvv has joined #ocaml
lgstate has left #ocaml [#ocaml]
bruce_r has quit [Ping timeout: 272 seconds]
bruce_r has joined #ocaml
pierpa has quit [Ping timeout: 244 seconds]
MercurialAlchemi has joined #ocaml
bruce_r has quit [Ping timeout: 265 seconds]
michaeltbaker has quit []
bruce_r has joined #ocaml
Guest94222 is now known as kandu
osa1__ has joined #ocaml
osa1_ has quit [Ping timeout: 276 seconds]
igt0 has quit [Quit: Connection closed for inactivity]
copy` has quit [Quit: Connection closed for inactivity]
kolko has quit [Read error: Connection reset by peer]
kolko has joined #ocaml
osa1 has joined #ocaml
osa1__ has quit [Ping timeout: 264 seconds]
FreeBirdLjj has joined #ocaml
Simn has joined #ocaml
nojb has joined #ocaml
jnavila has joined #ocaml
apache2 has quit [Remote host closed the connection]
apache2 has joined #ocaml
bruce_r has quit [Ping timeout: 248 seconds]
larhat has quit [Quit: Leaving.]
AlexDenisov has joined #ocaml
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 244 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
jstolarek has joined #ocaml
AlexDenisov has quit [Ping timeout: 265 seconds]
Algebr` has quit [Read error: Connection reset by peer]
AlexDenisov has joined #ocaml
Algebr` has joined #ocaml
osa1_ has quit [Remote host closed the connection]
osa1_ has joined #ocaml
AlexDenisov has quit [Client Quit]
nopf has joined #ocaml
Reshi has joined #ocaml
osa1_ has quit [Remote host closed the connection]
osa1_ has joined #ocaml
isbromberg has joined #ocaml
AlexDenisov has joined #ocaml
osa1_ has quit [Ping timeout: 265 seconds]
FreeBirdLjj has joined #ocaml
jwatzman|work has joined #ocaml
ocaml975 has quit [Ping timeout: 240 seconds]
mpenet has joined #ocaml
mfp has joined #ocaml
larhat has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mpenet` has joined #ocaml
johnf has quit [Read error: Connection reset by peer]
johnf has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
mpenet has quit [Ping timeout: 244 seconds]
mpenet` has left #ocaml [#ocaml]
<dxtr> I achieve some code yesterday!
<chelfi> \o/
<dxtr> I am not disappointed so far
bacam has quit [Quit: back in a moment]
bacam has joined #ocaml
<rightfold> lgstate: thanks for that question, I always wondered about how to implement equirecursive types, and now I found an example by googling TAPL! :D
AlexDenisov has joined #ocaml
<companion_cube> there is a github repo with some simple typecheckers
<rightfold> 😍😍😍😍😍
Reshi has quit [Quit: WeeChat 1.5]
jwatzman|work has quit [Quit: jwatzman|work]
ccvv has quit [Ping timeout: 240 seconds]
fddf has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
AlexDenisov has joined #ocaml
jwatzman|work has joined #ocaml
<Algebr`> anyone well versed in sql around
FreeBirdLjj has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<rightfold> Algebr`: yes
AlexDenisov has joined #ocaml
<Algebr`> in sqlite: I created these tables, http://pastebin.com/pbDK51JS, and expected the last insert to fail but it still succeeded. How can I make it such that an insertion of an nonexistent primary key fails?
<MasseR> don't you need to have a foreign key constraint?
CuriousErnestBro has joined #ocaml
<MasseR> Err is my terminology wrong. The thing that is separate from foreign keys that declares *what* to do in case of a delete, insert etc
<Algebr`> right, so I was thinking I needed to add constraint, but isn't that already created by foreign key implicitly?
<mrvn> a foreign key is when you say one column contains the key to another table.
<MasseR> Which dbms?
<Algebr`> sqlite
<Algebr`> right, but I want to say I can't do an insert into this event with a account id that doesn't exist in the account tbale
<Algebr`> which is what I thought the foreign key would do
FreeBirdLjj has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
<MasseR> this discusses exactly your case
<Algebr`> actually I was right, apparenrly it was a sqlitism
<Algebr`> it had to be turned on explicitly, PRAGMA foreign_keys = ON;
<MasseR> :)
<Algebr`> yea, was reading that
<Algebr`> thanks!
<Algebr`> backwards compatibility strikes again
sepp2k has joined #ocaml
<rightfold> Foreign keys are wizard
<rightfold> They're like morphisms
orbifx-m has joined #ocaml
wu_ng has quit [Ping timeout: 265 seconds]
<orbifx-m> Is there a library for matrix operation, e.g. multiplications?
<mrvn> matrix * vector = vector? matrix * scalar = matrix? matrix * matrix = matrix?
<Algebr`> wouldn't oml have it
<mrvn> let mul m s = List.map (List.map (( * ) s))
<mrvn> let mul s = List.map (List.map (( * ) s)) I mean.
igt0 has joined #ocaml
<rightfold> Don't use lists of lists for matrices, they don't have the guarantee that each row is same size
<rightfold> Use a flattened sequence, then compute offset using x + width * y
<mrvn> rightfold: why not array of arrays?
<rightfold> Same issue
<mrvn> you make the type private and only create the right ones.
<rightfold> [|[|1|];[|2;3|]|] is malformed
<mrvn> rightfold: [|1; 2; 3|] too
<rightfold> Right XD
<rightfold> HMM
<zozozo> flattened array is a lot better for memory usage and prefetching
<rightfold> If you're doing a mutable array, a flat array still has benefit
<orbifx-m> So other than oml?
<mrvn> A flattened array needs to also knwo the dimensions. Array of array has it in the block headers.
<orbifx-m> And why not tuples?
<mrvn> orbifx-m: needs code duplication to deal with 2, 3 and 4 dimensions.
<jnavila> orbifx-m: have a look at lacaml
<mrvn> I bet lots of peple have written their on vector and matrix module by now.
* mrvn doesn't want to implement a 100x100 matrix with tuples.
<rightfold> mrvn actually [|1;2;3|] is well formed
<rightfold> 1x3
<mrvn> rightfold: assume the same 2x2 dimension
<orbifx-m> Thanks jnavila
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<mrvn> Might be beneficial to put the size of a vector / matrix into a phantom type. So you can multiply an NxM matix by a N vector to get a M vector. Or NxM * MxO = NxO.
<orbifx-m> mrvn: it's not good that many write their own. Duplicated effort
<mrvn> orbifx-m: no kidding
<orbifx-m> jnavila: anything native?
<flux> I can recommend 'gg'
<orbifx-m> Hasn't bunzil written anything? :-P
<jnavila> orbifx-m: what would be the sizes of the matrices and vectors?
<orbifx-m> Ah Lol, thanks flux
<orbifx-m> 4 x 4 jnavila
<jnavila> mrvn: there's slap for that: https://github.com/akabe/slap
<jnavila> orbifx-m: Ah, then lacaml is overkill.
octachron has joined #ocaml
<mrvn> jnavila: I think that's for bigger matrixes. Like 100x100, not 2/3/4 dimentsions. It depends what you need.
<orbifx-m> I think GG will do. Also using Vg already
<octachron> on the linear algebra side, there is also splap: http://akabe.github.io/slap/
<mrvn> orbifx-m: generalized 3 dimensional rotation and prespective transformation matrixes?
<orbifx-m> Sorry not Vg, tgls
<Algebr`> node's express makes building webapplications ridiculously easy, I wish OCaml had something like it
<orbifx-m> mrvn: yes
<octachron> (and I am one of these people that have created yet another tensor library)
jwatzman|work has joined #ocaml
<flux> algebr`, eliom!
<flux> maybe not :-(
<Algebr`> yea right
<Algebr`> when experienced ocamlers have trouble with it....yea..
saruta has quit [Quit: WeeChat 1.3]
<orbifx-m> Gg here go
_andre has joined #ocaml
<MercurialAlchemi> there is opium too
<MercurialAlchemi> not sure how maintained it is
isbromberg has quit [Quit: Konversation terminated!]
pootler has quit [Ping timeout: 240 seconds]
<Algebr`> it can't even handle a file upload last I heard in this chan. The fact is ocaml community doesn't care about web dev at all
<Algebr`> not in any serious way
<Algebr`> oh well
freusque has joined #ocaml
<jnavila> Algebr`: lately, Janestreet has been interested in web, so maybe they'll set up some saner system...
pootler has joined #ocaml
<MercurialAlchemi> (I'll admit that I'm in the node + typescript boat myself)
<flux> algebr`, I managed to make file upload working with eliom!
<Algebr`> jnavila: and it will be all core based and then people will complain about that too...
<Algebr`> MercurialAlchemi: its nuts how much and how fast you can build a product with node
<flux> I don't think there's no compelling reason why ocaml couldn't be just as fast.. except we like to keep our types in order, and it's difficult :)
<flux> another compelling reason: someone would need to write it :)
<Algebr`> well people do have an interest, just in the reason & bucklescript land
<MercurialAlchemi> Algebr`: well, I'm making an SPA with react and server-side rendering, it's not all roses either...
<Algebr`> MercurialAlchemi: what issues are you hitting?
<rightfold> Go is the sweet spot between development horror and deployment horror
<Algebr`> ha
<MercurialAlchemi> Algebr`: well, first to have server-side rendering you need to have both an ajax implementation and an sql-to-json version of your data retrival methods
<MercurialAlchemi> also, in general React is great, but the "consensus" store library, Redux, is IMHO not that suited for SPAs
<MercurialAlchemi> you end up with that giant state where you can't easily expose/synchronize sub-parts of between your pages
DrWhax has quit [Read error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number]
<Algebr`> true
profmaad has joined #ocaml
<MercurialAlchemi> also, promises... make it very easy to forget to catch your errors
<MercurialAlchemi> urg
<Algebr`> use async/await
<Algebr`> with try/catch
<MercurialAlchemi> don't think Typescript supports async await yet
<Algebr`> but yea, just promises, very easy to not deal with errors
<companion_cube> MercurialAlchemi: it does
<Algebr`> the whole js ecosystem does poorly with error handling
<companion_cube> (I know because I read one VSCode plugin)
<MercurialAlchemi> not if you target ES < 6
<Algebr`> MercurialAlchemi: y u do that
<Algebr`> need old version of IE?
<MercurialAlchemi> though now that I think of it, my depressingly complex webpack config pipes this junk to babel so it's not an issue
jnavila has quit [Quit: It was time]
jnavila has joined #ocaml
<rightfold> The best JS amalgamation tool is cat
<MercurialAlchemi> Algebr`: well, yeah
<Algebr`> webpack is a clusterfuck
<MercurialAlchemi> well, it beats cat
<Algebr`> the whole front end webpack/babel thing is a disaster
<Algebr`> could really benefit from some OCaml professionalism...hint hint
<MercurialAlchemi> uhm
<MercurialAlchemi> *peeks at the state of ocaml build tools*
<MercurialAlchemi> well, I think the JS ecosystem can find its own way to help without help, really
<Algebr`> amazingly I'd say its even worse in front end
<Algebr`> because things move so ridiculously fast
<companion_cube> OCaml professionalism… in tools? wait
<rightfold> I use purescript and browserify for front-end stuff
<MercurialAlchemi> "moves too fast" is definitely not a criticism you can leverage against the ocaml build ecosystem
<companion_cube> I'll wait for webasm and keep as far from web dev as I can :]
<Algebr`> ha
<Algebr`> well, yea, maybe in tools isn't the best....
<MercurialAlchemi> well, recent tools kick ass
<MercurialAlchemi> opam is great
<Algebr`> yes, opam is what I Was thinking about
<MercurialAlchemi> old tools are a giant steaming pile of garbage
<Algebr`> well, they worked, but yea, I reallllllly wish opam would subsume more responsibility
chris2 has quit [Ping timeout: 265 seconds]
chris2 has joined #ocaml
zpe has quit [Remote host closed the connection]
chris2 has quit [Ping timeout: 255 seconds]
chris2 has joined #ocaml
randomA has quit [Quit: Lost terminal]
AlexDenisov has joined #ocaml
<companion_cube> yeah, well, we don't even all agree on what a build system should look like
FreeBirdLjj has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
wu_ng has joined #ocaml
nicholasf has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC 1.6.3 - http://znc.in]
zpe has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sdothum has joined #ocaml
rgrinberg has quit [Ping timeout: 265 seconds]
AlexDenisov has joined #ocaml
Merv_ has joined #ocaml
pootler has quit [Ping timeout: 276 seconds]
Merv_ has quit [Client Quit]
TheLemonMan has joined #ocaml
fddf has quit [Quit: Page closed]
ggole has joined #ocaml
zaquest has quit [Remote host closed the connection]
zpe has quit [Remote host closed the connection]
Denommus has joined #ocaml
zaquest has joined #ocaml
pootler has joined #ocaml
osa1_ has joined #ocaml
wu_ng has quit [Ping timeout: 265 seconds]
freehck has joined #ocaml
nicholasf has joined #ocaml
osa1__ has joined #ocaml
osa1_ has quit [Ping timeout: 272 seconds]
nicholasf has quit [Ping timeout: 265 seconds]
Denommus has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<benmachine> re: webdev stuff, I've been using incr_dom lately and it's fun, but it's really more for developing "apps" than, like, normal websites
<Algebr`> benmachine: and you were able to actually get it installed?
<benmachine> yes
<benmachine> although I got it from the bleeding-edge repositories which, who knows, may have broken again by now
<Algebr`> I felt like the API was way too heavy handed
<benmachine> it's very, uh, particular
<benmachine> about how you should do things
<benmachine> but I found it fit me pretty well
<Algebr`> benmachine: do you work at JS?
<benmachine> yeeeees
<benmachine> but I did this at home :P
<benmachine> admittedly it does make it easier when you know the guy who wrote the library, but I'm not using any actual JS-specific resources
<benmachine> (bad habit: talking about "JS" in a conversation about web scripting)
<Algebr`> yes, I hosted the incr_dom presented in SF, Matt gave the talk
<Algebr`> I gave it like 10 minutes of effort, then gave up, perhaps gave up too quickly
<benmachine> heh
Denommus has joined #ocaml
<benmachine> it definitely took me more than 10 minutes to get it working
jao has joined #ocaml
<benmachine> but in fairness some of those struggles were getting aspcud on arch linux
<benmachine> aspcud being in the AUR, and I didn't have a good AUR helper
<freehck> Hello everyone. I've just read about PPX and want to be sure about one thing. AFAIK Camlp4 is an analog of cpp. Is PPX an analog of lisp macros?
<benmachine> so I went looking for a package manager to install a package which would help my other package manager solve dependencies
<dxtr> benmachine: I'm on a distro that didn't have aspcud or any of the dependencies
<Algebr`> freehck: no, camlp4 is an actual macro system of sorts, cpp is just copy paste
<dxtr> So I had to create all those packages :p
<Algebr`> ppx is the successor of camlp4
<benmachine> dxtr: congrats, you win :P
<dxtr> :D
<dxtr> Took like an hour, but still
<freehck> Algebr`: I'm not sure I understand what "system of sorts" is.
<Algebr`> freehck: what
<benmachine> freehck: camlp4 is an actual macro system, of sorts
<benmachine> is that clearer?
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<freehck> benmachine: yes, thank you
<freehck> So ppx has camlp4 in its base?
<benmachine> no
<Algebr`> no, I said successor
<benmachine> ppx doesn't use camlp4, it replaces it
<benmachine> well, ppx is far more limited in applications, but that's generally a good thing
<Algebr`> benmachine: how much more limited
<companion_cube> benmachine: for "normal websites", why would you need JS anyway? :p
<benmachine> Algebr`: well, you can't do arbitrary syntax things
<freehck> Okay. Well AST-to-AST translation seems to be quite similar to lisp macros still.
<Algebr`> almost, there's a good Jane Street blog post about it
<benmachine> companion_cube: to help manage your withdrawal symptoms
<freehck> Algebr`: already read. :)
<benmachine> companion_cube: actually I'm not sure that joke made a lot of sense, sorry :P
<benmachine> companion_cube: but yeah I dunno, I build websites at either extreme of normality, either they are plain static HTML or some custom RPC server and websockets
<dxtr> javascript abuse fuck yeah
govg has joined #ocaml
AlexDenisov has joined #ocaml
zpe has joined #ocaml
<rightfold> javascript is always abuse
<companion_cube> javabusescript
<dxtr> Is it really abuse if you (the developer) consent?
osa1__ has quit [Ping timeout: 265 seconds]
<Algebr`> smh
<Leonidas> it's like when you're drunk and can't consent anymore
<Algebr`> could we please leave these kinds of analogies...
<Algebr`> does cohttp handle sessions?
nicholasf has joined #ocaml
nicholasf has quit [Ping timeout: 240 seconds]
<companion_cube> hmm, an announce for otags
<companion_cube> but who still uses otags? :D
copy` has joined #ocaml
wxfdglm has joined #ocaml
zpe has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
osa1__ has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
nicholasf has joined #ocaml
Leonidas has quit [Ping timeout: 265 seconds]
inco6 has joined #ocaml
ee_ks has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<Bluddy[m]> companion_cube: yeah I've been waiting for years for my Compuserve client to be updated
sepp2k has quit [Quit: Leaving.]
sepp2k has joined #ocaml
<reynir> wow it just took me a few minutes to remember it's Lwt.Infix and not Lwt.Syntax or similar
ee_ks has left #ocaml [#ocaml]
freusque has quit [Quit: WeeChat 1.4]
rgrinberg has joined #ocaml
ee_ks has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
kamog has joined #ocaml
inco6 has quit [K-Lined]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
jonasen has joined #ocaml
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
pierpa has joined #ocaml
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
bruce_r has joined #ocaml
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
jwatzman|work has quit [Quit: jwatzman|work]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
inco6 has joined #ocaml
inco6 has quit [Max SendQ exceeded]
osa1__ has left #ocaml ["Konversation terminated!"]
sh0t has joined #ocaml
jonasen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has quit [Ping timeout: 265 seconds]
jnavila has quit [Quit: It was time]
jncog has joined #ocaml
jncog has quit [Max SendQ exceeded]
MercurialAlchemi has joined #ocaml
jncog has joined #ocaml
jncog has quit [Max SendQ exceeded]
jncog has joined #ocaml
jncog has quit [Max SendQ exceeded]
nicholasf has quit [Remote host closed the connection]
bruce_r has quit [Ping timeout: 255 seconds]
govg has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
jstolarek has quit [Ping timeout: 244 seconds]
<reynir> googling 'cohttp xmlm' only gives results for 'http xml'
wxfdglm has quit [Ping timeout: 260 seconds]
govg has quit [Quit: leaving]
jwatzman|work has joined #ocaml
Merv_ has joined #ocaml
pootler has quit [Ping timeout: 265 seconds]
wxfdglm has joined #ocaml
tmtwd has joined #ocaml
slash^ has joined #ocaml
p_nathan has quit [Ping timeout: 244 seconds]
sepp2k has quit [Quit: Leaving.]
AlexRussia has quit [Ping timeout: 265 seconds]
Tinned_Tuna has joined #ocaml
Denommus has quit [Read error: Connection reset by peer]
<Tinned_Tuna> Hi, I may be mis-using the Unix library. I'm getting a segmentation fault when I pass the empty array "[||]" to execv after calling setuid.
<flux> tinned_tuna, cool, I think it means you have found a bug in the standard library!
<flux> not a standard occurrence.
<zozozo> shouldn't execv always start with the name of the binary ?
<flux> yes. actually are you tinned_tuna sure it's ocaml that segfaults, and not the binary you run?
<flux> well, not necessarily the name, but it should usually be something descriptive
<zozozo> afaik, you have to do something like: Unix.execv bin [| bin; arguments; ... |]
<flux> regardless of those, calling Unix.execv should not crash the ocaml program in any situation, with any parameters
<flux> but I think it's still fair play for an ocaml binary to crash if given 0 arguments, although I guess that wouldn't be great either..
<ggole> I tried that in the toplevel and got "A NULL argv[0] was passed through an exec system call."
<Tinned_Tuna> It is the binary that I run, but it doesn't matter what binary I run
<flux> it could be libc ;)
<flux> or (say) gcc runtime library
<Tinned_Tuna> http://pastebin.com/G58WMvTB shows how to trigger it
<Tinned_Tuna> If it's not an OCaml bug, I think the docs should be updated :-)
<flux> I doubt that's a case people test too hard. I believe it's invalid, but kernel might not validate it.
<zozozo> ggole: I don't know how execv* functions are supposed to behave in a toplevel, as they are supposed to replace the current program
<Tinned_Tuna> The docs aren't hugely clear, but I assume they're supposed to follow the stdlib (unistd) functions they are named for.
<flux> my shell says: A NULL argv[0] was passed through an exec system call. zsh: abort ./foo
jonasen has joined #ocaml
orbifx-m2 has joined #ocaml
<ggole> Yeah, the function in (OCaml's) execv.c doesn't check
apache2 has quit [Read error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number]
<Tinned_Tuna> ggole: should it? What does C do under those circumstances?
<ggole> C doesn't give a damn.
<rightfold> very few programs check for null argv[0]
<flux> the error comes from whoami
apache2 has joined #ocaml
<flux> as you can see with sudo strace ./foo
apache2 has quit [Client Quit]
orbifx-m has quit [Ping timeout: 244 seconds]
<flux> the execve succeeds in running whoami, and the control flow is from there on in that binary
<flux> so ocaml works correctly
orbifx-m has joined #ocaml
<ggole> Try it with different executable
<Tinned_Tuna> ggole: ok, I'll take a lok
<Tinned_Tuna> *look
jwatzman|work has quit [Quit: jwatzman|work]
FreeBird_ has quit [Remote host closed the connection]
<Tinned_Tuna> Yup, it works for better binaries. I'd only check /bin/sh and /usr/bin/whoami previously
<Tinned_Tuna> /usr/bin/host works just fine.
orbifx-m2 has quit [Ping timeout: 250 seconds]
<ggole> A bunch of "system" binaries give the same response, so it's probably just some more careful checking there
<ggole> My guess is that there is some GNU library with that logic
<flux> could be a security measure of some sort in util-linux (not sure if those are part of it)
<flux> the lesson here is,: don't do it :)
larhat has quit [Quit: Leaving.]
<Tinned_Tuna> In the future I'll make sure the arrays are non-empty :-p
octachron has quit [Quit: Page closed]
<flux> well, as said, you're supposed to put the program name as argument 0
DuoSRX has joined #ocaml
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wxfdglm has quit [Quit: leaving]
chris2 has quit [Ping timeout: 272 seconds]
kamog has quit [Ping timeout: 265 seconds]
wu_ng has joined #ocaml
ee_ks has left #ocaml [#ocaml]
tane has joined #ocaml
kamog has joined #ocaml
Merv_ has quit [Remote host closed the connection]
kamog has quit [Ping timeout: 248 seconds]
orbifx-m2 has joined #ocaml
orbifx-m has quit [Ping timeout: 272 seconds]
chris2 has joined #ocaml
rgrinberg has quit [Ping timeout: 272 seconds]
CuriousErnestBro has quit [Quit: Leaving]
CuriousErnestBro has joined #ocaml
rgrinberg has joined #ocaml
johnf has quit [Remote host closed the connection]
orbifx-m has joined #ocaml
orbifx-m2 has quit [Ping timeout: 255 seconds]
AlexDenisov has joined #ocaml
wu_ng has quit [Ping timeout: 248 seconds]
Algebr` has quit [Ping timeout: 240 seconds]
AlexRussia has joined #ocaml
orbifx-m2 has joined #ocaml
orbifx-m3 has joined #ocaml
orbifx-m has quit [Ping timeout: 276 seconds]
orbifx-m2 has quit [Ping timeout: 272 seconds]
octachron has joined #ocaml
orbifx has joined #ocaml
orbifx-m3 has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #ocaml
<orbifx> what do you use for documenting ocaml code? is there something which generates doc files?
slash^ has quit [Read error: Connection reset by peer]
<orbifx> and is it better to create mli files manually?
<orbifx> ocamldoc?
<tane> I guess most modules are actually documented in their mli files
octachron has quit [Ping timeout: 248 seconds]
<orbifx> and do you generate the mli's manually?
<orbifx> because if they are autogenerated and I change the ml file I can't then auto-generate again, right?
<ggole> You can rename the .ml, generate the .mli, and then paste in the new bits
<ggole> It's clumsy but workable.
<orbifx> yeah good idea
<flux> I think usually .ml files live so little that you can copy individual function signatures with ie. emacs (go over function, ^C^T^W, then write val foo : ^Y)
<flux> so simple it could even be an emacs function ;)
octachron has joined #ocaml
traceroutelol is now known as djsjadkhf
kamog has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 276 seconds]
nicholasf has joined #ocaml
<orbifx> and is the a build system which handles generating ocamldoc documentation?
<companion_cube> ocamlbuild can drive ocamldoc
jlouis has quit [Quit: leaving]
jlouis has joined #ocaml
jlouis has quit [Client Quit]
jlouis has joined #ocaml
pootler has joined #ocaml
jlouis has quit [Client Quit]
jlouis has joined #ocaml
jlouis has quit [Client Quit]
jlouis has joined #ocaml
tane has quit [Quit: Leaving]
AlexDenisov has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
octachron has quit [Quit: Leaving]
struk|desk has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
orbifx has quit [Ping timeout: 255 seconds]
Lethe_ has joined #ocaml
ggole has quit []
rgrinberg has quit [Ping timeout: 244 seconds]
<Lethe_> hi,
Lethe_ has quit [Quit: Leaving...]
randomA has joined #ocaml
<randomA> hi
<randomA> how can i pattern match parse yojson
<randomA> into recrod tyepes
<randomA> types that are record
<randomA> I know I use `Assoc
<randomA> don't know specifi
<randomA> is this with yojson safe
<lyxia> randomA: the three Yojson modules Basic, Raw, Safe provide similar functionality. Which one you choose depends on how hard your values exercise the JSON syntax.
<randomA> the json format is short
<randomA> i just need to parse into record types
<lyxia> Is your JSON a dictionary with the names of the fields as keys?
<randomA> kind of
<randomA> yeah
<randomA> its a normal json format
<randomA> but it will have things like records
<randomA> i have structured my records excatly as they hae structured theirs
<randomA> so i was thinking match json with | {name = n; id = id;} -> createName n id
<randomA> where creates a record type with fields name id same as json
<lyxia> s!dictionary!object!
<randomA> does tha tmagic work
<randomA> it's in `Assoc * json
<randomA> do you know how
<lyxia> randomA: have you seen the Util module http://mjambon.com/yojson-doc/Yojson.Basic.Util.html
<randomA> yes
<randomA> i know how it basically works to extract lists and to extract ints
<randomA> and members
<randomA> im unsure how to turn these into my record types
<lyxia> oh nvm the parent modules expose most of it
nicholasf has quit [Ping timeout: 248 seconds]
<lyxia> oh no I'm double wrong
<randomA> hm?
<randomA> what are you saing
<lyxia> create Util.(to_string (member "name" json)) Util.(to_int (member "id" json)) ?
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
regnat[m] has quit [*.net *.split]
pyon has quit [*.net *.split]
APNG has quit [*.net *.split]
danieli has quit [*.net *.split]
evhan has quit [*.net *.split]
tmtwd has quit [*.net *.split]
zaquest has quit [*.net *.split]
sdothum has quit [*.net *.split]
kolko has quit [*.net *.split]
alpen has quit [*.net *.split]
iZsh has quit [*.net *.split]
rom1504 has quit [*.net *.split]
mcspud has quit [*.net *.split]
maufred has quit [*.net *.split]
gustav___ has quit [*.net *.split]
pierpa has quit [*.net *.split]
mfp has quit [*.net *.split]
Simn has quit [*.net *.split]
zv has quit [*.net *.split]
sfri has quit [*.net *.split]
al-damiri has quit [*.net *.split]
nore has quit [*.net *.split]
_y has quit [*.net *.split]
Jaxan has quit [*.net *.split]
bernardofpc has quit [*.net *.split]
jrslepak has quit [*.net *.split]
rfv has quit [*.net *.split]
mg- has quit [*.net *.split]
adelbertc has quit [*.net *.split]
benmachine has quit [*.net *.split]
dmbaturin has quit [*.net *.split]
andreypopp has quit [*.net *.split]
emmanueloga has quit [*.net *.split]
MorTal1ty has quit [*.net *.split]
sz0 has quit [*.net *.split]
mbrock has quit [*.net *.split]
lopex has quit [*.net *.split]
strmpnk has quit [*.net *.split]
mrallen1 has quit [*.net *.split]
menasw has quit [*.net *.split]
_2can has quit [*.net *.split]
lpaste has quit [*.net *.split]
richi235 has quit [*.net *.split]
jkni has quit [*.net *.split]
jeroud has quit [*.net *.split]
hyperbor1ean has quit [*.net *.split]
aggelos_ has quit [*.net *.split]
eagleflo has quit [*.net *.split]
AlexRussia has quit [*.net *.split]
sh0t has quit [*.net *.split]
M-martinklepsch has quit [*.net *.split]
nzyuzin has quit [*.net *.split]
Orion3k has quit [*.net *.split]
Madars has quit [*.net *.split]
DanielRichman has quit [*.net *.split]
emias has quit [*.net *.split]
ansiwen has quit [*.net *.split]
w1gz has quit [*.net *.split]
asm89 has quit [*.net *.split]
osheeta has quit [*.net *.split]
unbalancedparen has quit [*.net *.split]
fold4 has quit [*.net *.split]
xaimus has quit [*.net *.split]
lyxia has quit [*.net *.split]
seliopou has quit [*.net *.split]
Khady has quit [*.net *.split]
engil has quit [*.net *.split]
jerith has quit [*.net *.split]
tormen has quit [*.net *.split]
pwzoii has quit [*.net *.split]
tokenrov1 has quit [*.net *.split]
Cypi has quit [*.net *.split]
chris2 has quit [*.net *.split]
DuoSRX has quit [*.net *.split]
ia0 has quit [*.net *.split]
rpip has quit [*.net *.split]
infinity0 has quit [*.net *.split]
Merv has quit [*.net *.split]
Bluddy[m] has quit [*.net *.split]
Intensity has quit [*.net *.split]
segmond has quit [*.net *.split]
jyc has quit [*.net *.split]
cschneid has quit [*.net *.split]
dch has quit [*.net *.split]
rightfold has quit [*.net *.split]
cyraxjoe has quit [*.net *.split]
ggherdov has quit [*.net *.split]
NhanH has quit [*.net *.split]
msch has quit [*.net *.split]
Rome has quit [*.net *.split]
breitenj has quit [*.net *.split]
srax has quit [*.net *.split]
obj_magic has quit [*.net *.split]
notdan has quit [*.net *.split]
regnat has quit [*.net *.split]
reynir has quit [*.net *.split]
lobo has quit [*.net *.split]
j0sh__ has quit [*.net *.split]
thizanne has quit [*.net *.split]
kandu has quit [*.net *.split]
igitoor has quit [*.net *.split]
cnu- has quit [*.net *.split]
mehdib has quit [*.net *.split]
zv has joined #ocaml
mfp has joined #ocaml
sfri has joined #ocaml
Simn has joined #ocaml
pierpa has joined #ocaml
nore has joined #ocaml
_y has joined #ocaml
rfv has joined #ocaml
Jaxan has joined #ocaml
bernardofpc has joined #ocaml
lpaste has joined #ocaml
richi235 has joined #ocaml
dmbaturin has joined #ocaml
jkni has joined #ocaml
mrallen1 has joined #ocaml
emmanueloga has joined #ocaml
andreypopp has joined #ocaml
adelbertc has joined #ocaml
strmpnk has joined #ocaml
hyperbor1ean has joined #ocaml
MorTal1ty has joined #ocaml
eagleflo has joined #ocaml
_2can has joined #ocaml
menasw has joined #ocaml
mg- has joined #ocaml
sz0 has joined #ocaml
lopex has joined #ocaml
benmachine has joined #ocaml
aggelos_ has joined #ocaml
jeroud has joined #ocaml
jrslepak has joined #ocaml
mbrock has joined #ocaml
caw has quit [Ping timeout: 248 seconds]
andreypopp has quit [Max SendQ exceeded]
MorTal1ty has quit [Max SendQ exceeded]
rfv has quit [Max SendQ exceeded]
sz0 has quit [Max SendQ exceeded]
stephe has quit [Ping timeout: 250 seconds]
srcerer has quit [Ping timeout: 248 seconds]
Sorella has quit [Ping timeout: 248 seconds]
jcloud has quit [Ping timeout: 248 seconds]
mankyKitty has quit [Ping timeout: 263 seconds]
bigs has quit [Ping timeout: 250 seconds]
chris2 has joined #ocaml
Bluddy[m] has joined #ocaml
Merv has joined #ocaml
rpip has joined #ocaml
Intensity has joined #ocaml
rightfold has joined #ocaml
segmond has joined #ocaml
infinity0 has joined #ocaml
ia0 has joined #ocaml
cschneid has joined #ocaml
jyc has joined #ocaml
cyraxjoe has joined #ocaml
dch has joined #ocaml
Rome has joined #ocaml
srax has joined #ocaml
breitenj has joined #ocaml
obj_magic has joined #ocaml
notdan has joined #ocaml
regnat has joined #ocaml
reynir has joined #ocaml
j0sh__ has joined #ocaml
lobo has joined #ocaml
thizanne has joined #ocaml
kandu has joined #ocaml
igitoor has joined #ocaml
cnu- has joined #ocaml
mehdib has joined #ocaml
banjiewen has quit [Ping timeout: 265 seconds]
l1x has quit [Ping timeout: 265 seconds]
mbrock has quit [Ping timeout: 252 seconds]
mrallen1 has quit [Ping timeout: 252 seconds]
strmpnk has quit [Ping timeout: 252 seconds]
dch has quit [Ping timeout: 255 seconds]
danieli has joined #ocaml
evhan has joined #ocaml
APNG has joined #ocaml
pyon has joined #ocaml
regnat[m] has joined #ocaml
sspi has quit [Ping timeout: 250 seconds]
barkmadley[m] has quit [Ping timeout: 276 seconds]
Merv has quit [Ping timeout: 255 seconds]
tmtwd has joined #ocaml
kolko has joined #ocaml
sdothum has joined #ocaml
iZsh has joined #ocaml
rom1504 has joined #ocaml
zaquest has joined #ocaml
alpen has joined #ocaml
mcspud has joined #ocaml
gustav___ has joined #ocaml
maufred has joined #ocaml
parataxis has quit [Ping timeout: 265 seconds]
emmanueloga has quit [Ping timeout: 248 seconds]
jkni has quit [Ping timeout: 248 seconds]
lpw25[m] has quit [Ping timeout: 276 seconds]
srenatus[m] has quit [Ping timeout: 276 seconds]
43UAABI8P has joined #ocaml
43UAABI8P has quit [Client Quit]
AlexRussia has joined #ocaml
nzyuzin has joined #ocaml
M-martinklepsch has joined #ocaml
Orion3k has joined #ocaml
Madars has joined #ocaml
asm89 has joined #ocaml
fold4 has joined #ocaml
w1gz has joined #ocaml
sh0t has joined #ocaml
DanielRichman has joined #ocaml
osheeta has joined #ocaml
emias has joined #ocaml
pwzoii has joined #ocaml
ansiwen has joined #ocaml
unbalancedparen has joined #ocaml
tokenrov1 has joined #ocaml
Khady has joined #ocaml
tormen has joined #ocaml
seliopou has joined #ocaml
engil has joined #ocaml
jerith has joined #ocaml
xaimus has joined #ocaml
lyxia has joined #ocaml
Cypi has joined #ocaml
asm89 has quit [Max SendQ exceeded]
AlexRussia has quit [Max SendQ exceeded]
fold4 has quit [Max SendQ exceeded]
lopex has quit [Ping timeout: 265 seconds]
<lyxia> :( I was netsplitted away
AlexRussia has joined #ocaml
<randomA> anyone know how to parse yojson
<randomA> how do i feed it into a type by pattern amtching
fold4 has joined #ocaml
<randomA> either `Variant
<randomA> or `Assoc
<lyxia> randomA: did you not like using to_string and member ?
john51 has quit [Read error: Connection reset by peer]
<randomA> no
<randomA> i don't know how
<randomA> though
<randomA> do i match on | `Assoc
<randomA> like json is a tree write
john51 has joined #ocaml
asm89 has joined #ocaml
<lyxia> let n = Util.(to_string (member "name" json)) and id = Util.(to_int (member "id" json)) in createNAme n id
nicholasf has joined #ocaml
stephe has joined #ocaml
<randomA> i dont know how to filter members of members
<lyxia> randomA: if you want to pattern match on `Assoc, you can use List.assoc on the list
bigs has joined #ocaml
<randomA> so like suppose i record called person with fields name:string, int:age, grades: string list, friend: person list
<randomA> how do i filter the friend fieeld
mankyKitty has joined #ocaml
<lyxia> that's a recursive type
<randomA> ?
<randomA> ok
<randomA> so how does that filter into the reocrd itself
andreypopp has joined #ocaml
<lyxia> how does your json format handle a person containing persons
<randomA> nad what if i dont know how many people are in the json
ggherdov has joined #ocaml
banjiewen has joined #ocaml
xaanimus has joined #ocaml
<randomA> oh i get it
<randomA> i filter_member spam
barkmadley[m] has joined #ocaml
andreypopp has quit [Read error: No route to host]
<lyxia> Sorry I don't understand what you're having trouble with. Can you show me an example of JSON you want to process?
parataxis has joined #ocaml
<randomA> but how can i match it on the types
Sorella has joined #ocaml
<randomA> ok its not recursive
<randomA> but its like there are records inside records
mrallen1 has joined #ocaml
<lyxia> just call your conversion function recursively?
al-damiri has joined #ocaml
jcloud has joined #ocaml
xaanimus has left #ocaml ["ERC (IRC client for Emacs 25.1.1)"]
sspi has joined #ocaml
<reynir> !deriving
mbrock has joined #ocaml
<randomA> so you see this example yojson
<randomA> how do you filtermember the id and the title
lpw25[m] has joined #ocaml
srenatus[m] has joined #ocaml
l1x has joined #ocaml
<randomA> do you do all seperately or same time
jkni has joined #ocaml
<randomA> filter_member |>
strmpnk has joined #ocaml
Merv has joined #ocaml
DuoSRX has joined #ocaml
caw has joined #ocaml
emmanueloga has joined #ocaml
<lyxia> the api is not suited to extract multiple fields of a list of objects
lopex has joined #ocaml
<randomA> ok i guess ill just not do this
andreypopp has joined #ocaml
dch has joined #ocaml
msch has joined #ocaml
NhanH has joined #ocaml
rfv has joined #ocaml
sz0 has joined #ocaml
<lyxia> I don't know, I'm having trouble helping you.
ee_ks has joined #ocaml
<randomA> its ok
<randomA> i dont know either lol
MorTal1ty has joined #ocaml
Heasummn has joined #ocaml
<randomA> does anyone know how to work `Assoc
Simn has quit [Quit: Leaving]
lopexx has joined #ocaml
sh0t has quit [Remote host closed the connection]
randomA has quit [Remote host closed the connection]
ee_ks has left #ocaml [#ocaml]
lopexx has quit []
xaanimus has joined #ocaml
xaanimus has left #ocaml [#ocaml]
al-damiri has quit [Quit: Connection closed for inactivity]
wu_ng has joined #ocaml
Heasummn has quit [Quit: Leaving]
kamog has quit []