spew has quit [Quit: Connection closed for inactivity]
Haudegen has quit [Ping timeout: 240 seconds]
rgherdt has quit [Ping timeout: 245 seconds]
seliopou has quit [Quit: whaaaat]
oni-on-ion has quit [Ping timeout: 250 seconds]
seliopou has joined #ocaml
c4rc4s has quit [Remote host closed the connection]
seliopou has quit [Client Quit]
seliopou has joined #ocaml
c4rc4s has joined #ocaml
ravenousmoose has joined #ocaml
ravenousmoose has quit [Ping timeout: 276 seconds]
seliopou has quit [Quit: whaaaat]
seliopou has joined #ocaml
seliopou has quit [Quit: whaaaat]
seliopou has joined #ocaml
seliopou has quit [Quit: whaaaat]
seliopou has joined #ocaml
EmeraldMoon has joined #ocaml
c4rc4s has quit [Read error: Connection reset by peer]
c4rc4s has joined #ocaml
EmeraldMoon has quit [Remote host closed the connection]
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
mfp has quit [Ping timeout: 265 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 264 seconds]
logicmoo has quit [Ping timeout: 245 seconds]
brettgilio has joined #ocaml
_whitelogger has joined #ocaml
dmiles has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
jao has joined #ocaml
zolk3ri has quit [Ping timeout: 260 seconds]
gravicappa has joined #ocaml
zolk3ri has joined #ocaml
EmeraldMoon has joined #ocaml
EmeraldMoon has quit [Remote host closed the connection]
_whitelogger has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
jao has quit [Ping timeout: 240 seconds]
vicfred has quit [Quit: Leaving]
brettgilio has quit [Ping timeout: 245 seconds]
narimiran has joined #ocaml
gravicappa has quit [Ping timeout: 265 seconds]
_whitelogger has joined #ocaml
okuu has joined #ocaml
unyu has quit [Ping timeout: 276 seconds]
pyx has joined #ocaml
pyx has quit [Client Quit]
okuu has quit [Quit: ERC (IRC client for Emacs 26.3)]
unyu has joined #ocaml
gravicappa has joined #ocaml
ggole has joined #ocaml
ravenousmoose has joined #ocaml
rgherdt has joined #ocaml
Serpent7776 has joined #ocaml
ohama has quit [Ping timeout: 240 seconds]
Nahra has joined #ocaml
Nahra has joined #ocaml
Nahra has quit [Changing host]
ohama has joined #ocaml
gravicappa has quit [Ping timeout: 268 seconds]
jaar has joined #ocaml
FreeBirdLjj has joined #ocaml
tane has joined #ocaml
_whitelogger has joined #ocaml
Haudegen has joined #ocaml
jaar has quit [Ping timeout: 252 seconds]
tizoc has quit [Quit: Coyote finally caught me]
tizoc has joined #ocaml
UndefinedIsNotAF has quit [Ping timeout: 240 seconds]
mfp has joined #ocaml
gravicappa has joined #ocaml
<narimiran>
how can i do something similar to this python code: `for a, b, c, d in zip(line, line[1:], line[2:], line[3:])`? is there a way to iterate/fold in parallel on multiple (more than 2) lists/strings at once?
<Leonidas>
narimiran: there is map2
<Leonidas>
but there is not general n-ary map or zip, because try to express the signature of that.
<narimiran>
i know, that's why explicitly said "more than 2" ;)
<Leonidas>
what would the signature of such a thing look like?
<narimiran>
yeah, i see your point
<narimiran>
so, is there some way around it? how would you achieve the same as the python code posted?
<Leonidas>
You can build map4 just fine
<narimiran>
write your own map4?
<Leonidas>
that's one way
<Leonidas>
though I am not sure whether it is the best
<Leonidas>
depends on what you actually want to do
<tane>
narimiran, given that you have a list of characters, you can match more than one, e.g. a::b::c::d::t when a = d && b = c && a <> b ->
<Leonidas>
I would probably parse out the [] first and then get a list of all 4 character sequences, overlapping and then filter.
<narimiran>
tane: nice, that might be the way to go!
<tane>
are you warming up for the next AoC? :)
<narimiran>
tane: that's exactly what i'm doing :)
<narimiran>
i decided to solve this year's AoC in ocaml (previously i have done it in python and nim), so now i'm trying to get familiar with ocaml before december :)
<tane>
nice
<narimiran>
i'm posting my AoC 2017 solutions here: https://github.com/narimiran/AdventOfCode2017 — so if any of you have some spare time to give me some advice what to change and how to improve my ocaml solutions, i'd be grateful
<ggole>
n-ary map/zip/etc are nicely typable, although not in OCaml's type system. eg, typed Racket supports such variadic types.
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
<octachron>
Even in Ocaml, it is possible to get quite close with tuple as GADT-enhanced list, but not with the standard tuple kind (because the type system has no idea that _ * _ and _ * _ * _ are related)
retropikzel has quit [Quit: Leaving]
silver has joined #ocaml
Nahra has quit [Quit: leaving]
<Leonidas>
(* LANGUAGE TupleKinds *) *ducks*
<def`>
It is possible to make an lightweight nary map in OCaml
<def`>
Type errors are not user-friendly (not C++ level, but not nice)
<def`>
# nary_map [[1;2;3]] string_of_int
<def`>
# nary_map [[1;2;3]; ["foo"; "bar"; "baz"]] (fun i s-> string_of_int i ^ s)
<def`>
and they have the expected runtime semantics
<def`>
this combines GADTs, constructor disambiguation and custom list syntax.
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
<rgrinberg>
narimiran: the direcctory structure for dune is _build/{context_name}, but as def` said, you may default to whatever profile you want in a context.
<narimiran>
rgrinberg: ah, i see, thanks!
ziyourenxiang has quit [Ping timeout: 268 seconds]
bartholin has quit [Ping timeout: 276 seconds]
bartholin has joined #ocaml
nullifidian has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
jnavila has joined #ocaml
ravenousmoose has joined #ocaml
retropikzel has quit [Quit: Leaving]
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenousmoose has joined #ocaml
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]