companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
ArthurStrong has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
Haudegen has quit [Ping timeout: 240 seconds]
st8less has quit [Quit: WeeChat 2.9]
ArthurStrong has quit [Quit: leaving]
mfp has quit [Ping timeout: 268 seconds]
Eoco has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
narimiran has joined #ocaml
narimiran has quit [Remote host closed the connection]
hosewiejacke has joined #ocaml
vicfred has quit [Quit: Leaving]
hosewiejacke is now known as hwj
pqwy[m] has quit [Ping timeout: 245 seconds]
smondet[m] has quit [Ping timeout: 250 seconds]
dieggsy has quit [Ping timeout: 245 seconds]
pqwy[m] has joined #ocaml
smondet[m] has joined #ocaml
dieggsy has joined #ocaml
wonko7 has joined #ocaml
hwj has left #ocaml ["Leaving"]
olle has joined #ocaml
Sanduni has joined #ocaml
Sanduni has quit [Quit: Connection closed]
Sanduni has joined #ocaml
mbuf has joined #ocaml
Sanduni has quit [Quit: Connection closed]
olle has quit [Ping timeout: 252 seconds]
wonko7 has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
olle has joined #ocaml
bartholin has joined #ocaml
Tuplanolla has joined #ocaml
mfp has joined #ocaml
henistein has joined #ocaml
<henistein> How can I convert a list to a matrix (array array)?
olle has quit [Ping timeout: 240 seconds]
bartholin has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
hackinghorn has joined #ocaml
<d_bot> <bikal> @octachron What's the `type void = |` here https://gist.github.com/Octachron/77b6cf086d8e636100a08d517f5ba3a4#file-runtime_hlist-ml-L1-L5 ? What is the semantics?
Sanduni has joined #ocaml
<d_bot> <antron> @bikal probably the empty variant, also known as bottom
<d_bot> <octachron> A type without value: `let never: 'a. void -> 'a = function _ -> . `
Sanduni has quit [Quit: Connection closed]
TheLemonMan has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<d_bot> <bikal> Is there a specific use case where using `void` type is unavoidable? I mean using just `type _ t = | [] : 'a t .....` works too, right?
<henistein> I am trying to make a function that removes the first two elements and the last elemento of a list, what am I doing wrong? https://pastebin.pl/view/3daf4913
<d_bot> <octachron> Using `'a t` will create issues with the value restriction on usage. Whereas using a real type is a bit adhoc.
<d_bot> <octachron> Using an empty type can be a way to restrict the possible contructors in a ADT: a `void option` is always `None`.
bartholin has quit [Ping timeout: 240 seconds]
<octachron> henistein, OCaml is white-space independent. The compiler reads your code as `List.rev l (let aux ... in aux m)`. You are missing quite a few connectors. And you are not handling the case of lists with less than three elements.
<henistein> Well I know I am missing that case, but I will just use this function into a speciefic case, about the connectors could you give me some hints?
<octachron> Even in this case, your function should cover this case itself and raise an exception. You need to add some `let`s to name your intermediary results.
<henistein> ok I think I did it, if you want to check it: https://pastebin.pl/view/52e9e898
<octachron> Note that you took my advice one step further and named your intermediary transforms. That works too.
mbuf has quit [Quit: Leaving]
waleee-cl has joined #ocaml
olle has joined #ocaml
tane has joined #ocaml
<d_bot> <bikal> So here `type dyn` is the companion type witness?
olle has quit [Ping timeout: 240 seconds]
<henistein> There are some examples how can I convert a list into matrix (array array)? I have been searching on internet and I could not find too much. Ocaml has Array.of_list, but I want to convert like this: https://pastebin.com/wfdTjGwS
<octachron> henistein: you can define a chunk function : int -> 'a list -> 'a list list. Then convert the result into an array.
<Armael> /w 47
<Armael> arg
<d_bot> <octachron> @bikal: no the witness is the type 'a ty: since by observing a value of type 'a ty in a pattern matching, you can deduce the type `'a`.
<d_bot> <octachron> `dyn` is a packing together a matching list of witness and values, then forgetting the type of `'a` to get a value whose type is not-dependent.
<d_bot> <bikal> Ah, so type witness means *holds type information*. In our case that is `'a ty` since it holds the type information for the HL.
<d_bot> <bikal> would types like `dyn` be called *universal* type?
<d_bot> <bikal> RE: type witness, are they sometimes encoded as extensible types, eg `type 'a witness = ..` so that it can be extended by for example user level code?
<d_bot> <octachron> No? Universal types are distinct notions. Yes, `hmap` work with a extensible type witness that can register a new witness for each keys.
<d_bot> <bikal> k
<d_bot> <bikal> hmm ... just a conjecture. We wouldn't need this technique of *type witness* if OCaml provided runtime type information, or reflection in .NET - correct ?
<d_bot> <octachron> A typed runtime type representation *is* a type witness.
vicfred has joined #ocaml
<d_bot> <Curzon> Just wondering
<d_bot> <Curzon> What do you guys use OCaml for other than compilers
<henistein> What is the easiest method to print an array of int?
<octachron> Using the Fmt library: Fmt.(Dump.array int) Fmt.stdout [|1;2;3|]
<d_bot> <rw> it's a general-purpose language, so you can find people using it for just about anything
<d_bot> <rw> I'm personally interested in using it for CLI tools and web apps
<d_bot> <bikal> 👍
Sumera[m] has quit [Ping timeout: 245 seconds]
Sumera[m] has joined #ocaml
anton_5[m] has quit [Ping timeout: 245 seconds]
<d_bot> <EduardoRFS> Is OCaml with MSVC still a thing? Like, do people still use it?
anton_5[m] has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
TheLemonMan has joined #ocaml
TheLemonMan has quit [Client Quit]
TheLemonMan has joined #ocaml
hackinghorn has quit [Quit: Leaving]
wonko7 has joined #ocaml
tmhoang520 has quit [Quit: Alpine Linux, the security-oriented, lightweight Linux distribution]
ania123 has joined #ocaml
tmhoang520 has joined #ocaml
ania123 has quit [Quit: Connection closed]
vicfred has quit [Quit: Leaving]
henistein has quit [Quit: Connection closed]
henistein has joined #ocaml
<henistein> It is possible to merge this two lambdas in only one? The first removes two first elements, and second removes last, https://pastebin.com/mSb1c5Zk
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
olle has joined #ocaml
<zozozo> henistein: I think your second function is not correct
<zozozo> you probably want something like `fun l -> List.rev (m2 (List.rev your_input_list)` to actually remove the last element
<zozozo> err. `fun l -> List.rev (m2 (List.rev l))`
<olle> 2 revs to remove one elemtent???
<olle> booo
<zozozo> assuming `m2 = fun hd :: tl -> tl`
<zozozo> yeah, it's hreally not efficient indeed
<olle> what about double-linked lists in ocaml?
<zozozo> you need to use mutable fields for that, and well, it's slightly more complicated
<olle> hm
<zozozo> but *if* removing the last element is a time-sensitive operation (i.e. you use it frequently), it highyl suggests simple lists are not the best data structure
<olle> yeah
<olle> might as well use array with option elements
<olle> and just skip the none's
<zozozo> or vectors/resizable arrays
<olle> yeah
safinaskar has joined #ocaml
safinaskar has quit [Client Quit]
safinaskar has joined #ocaml
<safinaskar> i am attempting to install ocaml using instructions from https://ocaml.org/learn/tutorials/up_and_running.html . (i am installing in docker.) i reached command "opam switch create 4.11.1". i typed it and i see: "[ERROR] Compiler selection '4.11.1' is ambiguous. matching packages: { ocaml-base-compiler.4.11.1, ocaml-system.4.11.1 }". what to do?
olle has quit [Ping timeout: 265 seconds]
<octachron> I would propose to install 4.12.0 (or 4.11.2, if you really need 4.11), then no more conflict with your system version of ocaml.
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
vicfred has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
<safinaskar> octachron: thanks
safinaskar has left #ocaml [#ocaml]
caasih has quit [*.net *.split]
wonko7 has quit [*.net *.split]
clockish has quit [*.net *.split]
ansiwen has quit [*.net *.split]
tizoc has quit [*.net *.split]
infinity0 has quit [*.net *.split]
tristanC has quit [*.net *.split]
Leonidas has quit [*.net *.split]
mrd has quit [*.net *.split]
nore has quit [*.net *.split]
asm89 has quit [*.net *.split]
remexre has quit [*.net *.split]
eagleflo has quit [*.net *.split]
theblatte has quit [*.net *.split]
rntz2 has quit [*.net *.split]
seliopou has quit [*.net *.split]
Tuplanolla has quit [*.net *.split]
madroach has quit [*.net *.split]
ahf has quit [*.net *.split]
landonf has quit [*.net *.split]
troydm has quit [*.net *.split]
jsoo has quit [*.net *.split]
octachron has quit [*.net *.split]
haskell_1 has quit [*.net *.split]
drewolson has quit [*.net *.split]
Exagone313 has quit [*.net *.split]
rks` has quit [*.net *.split]
nicoo has quit [*.net *.split]
cantstanya has quit [*.net *.split]
andreas303 has quit [*.net *.split]
tryte has quit [*.net *.split]
henistein has quit [*.net *.split]
anton_5[m] has quit [*.net *.split]
Coldfusion[m] has quit [*.net *.split]
aspiwack[m] has quit [*.net *.split]
towel has quit [*.net *.split]
sspi__ has quit [*.net *.split]
jun has quit [*.net *.split]
vsiles has quit [*.net *.split]
Sumera[m] has quit [*.net *.split]
smondet[m] has quit [*.net *.split]
lnxw37d4 has quit [*.net *.split]
Tardigreat[m] has quit [*.net *.split]
runciter has quit [*.net *.split]
madgen_ has quit [*.net *.split]
toppler` has quit [*.net *.split]
Armael has quit [*.net *.split]
cross has quit [*.net *.split]
waleee-cl has quit [*.net *.split]
raver has quit [*.net *.split]
webshinra has quit [*.net *.split]
jbrown has quit [*.net *.split]
mrallen1 has quit [*.net *.split]
b20n has quit [*.net *.split]
notnotdan_ has quit [*.net *.split]
bytesighs has quit [*.net *.split]
ELLIOTTCABLE has quit [*.net *.split]
chewbranca has quit [*.net *.split]
higherorder__ has quit [*.net *.split]
cbarrett has quit [*.net *.split]
adi__________ has quit [*.net *.split]
artart78 has quit [*.net *.split]
JSharp has quit [*.net *.split]
bronsen has quit [*.net *.split]
dwt has quit [*.net *.split]
thizanne has quit [*.net *.split]
drakonis has quit [*.net *.split]
penguwin has quit [*.net *.split]
stux|RC has quit [*.net *.split]
OPeritel has quit [*.net *.split]
pippijn has quit [*.net *.split]
srax has quit [*.net *.split]
richbridger has quit [*.net *.split]
Eoco has quit [*.net *.split]
arecaceae has quit [*.net *.split]
Drup has quit [*.net *.split]
delysin has quit [*.net *.split]
dan64 has quit [*.net *.split]
johnelse has quit [*.net *.split]
c4rc4s has quit [*.net *.split]
shmibs has quit [*.net *.split]
mal`` has quit [*.net *.split]
so_ has quit [*.net *.split]
engil has quit [*.net *.split]
dieggsy has quit [*.net *.split]
nullcone has quit [*.net *.split]
angerman has quit [*.net *.split]
jeroud has quit [*.net *.split]
metadave has quit [*.net *.split]
robmyers has quit [*.net *.split]
avsm[m] has quit [*.net *.split]
radiopotin[m] has quit [*.net *.split]
aditi314 has quit [*.net *.split]
Amaan has quit [*.net *.split]
tinga has quit [*.net *.split]
haesbaert has quit [*.net *.split]
qwr has quit [*.net *.split]
steenuil has quit [*.net *.split]
greenbagels has quit [*.net *.split]
sadiq has quit [*.net *.split]
tane has quit [*.net *.split]
tmhoang520 has quit [*.net *.split]
Jesin has quit [*.net *.split]
jerith_ has quit [*.net *.split]
t-j-r has quit [*.net *.split]
xenu has quit [*.net *.split]
wagle has quit [*.net *.split]
vodkaInf1rno has quit [*.net *.split]
dmbaturin has quit [*.net *.split]
leah2 has quit [*.net *.split]
alexey has quit [*.net *.split]
dash has quit [*.net *.split]
labor[m] has quit [*.net *.split]
takside has quit [*.net *.split]
lisq has quit [*.net *.split]
theglass has quit [*.net *.split]
RalfJ has quit [*.net *.split]
Ekho has quit [*.net *.split]
Enjolras has quit [*.net *.split]
mosterdt__ has quit [*.net *.split]
astronavt has quit [*.net *.split]
infinigon_ has quit [*.net *.split]
Serpent7776 has quit [*.net *.split]
lobo has quit [*.net *.split]
noonien has quit [*.net *.split]
White_Flame has quit [*.net *.split]
jca has quit [*.net *.split]
nfc has quit [*.net *.split]
averell has quit [*.net *.split]
_habnabit has quit [*.net *.split]
Johann has quit [*.net *.split]
Putonlalla has quit [*.net *.split]
dinosaure has quit [*.net *.split]
SoF has quit [*.net *.split]
johnelse has joined #ocaml
landonf has joined #ocaml
shmibs has joined #ocaml
engil has joined #ocaml
dan64 has joined #ocaml
Drup has joined #ocaml
delysin has joined #ocaml
wonko7 has joined #ocaml
arecaceae has joined #ocaml
caasih has joined #ocaml
Tuplanolla has joined #ocaml
madroach has joined #ocaml
mal`` has joined #ocaml
so_ has joined #ocaml
ahf has joined #ocaml
clockish has joined #ocaml
rks` has joined #ocaml
troydm has joined #ocaml
tizoc has joined #ocaml
tristanC has joined #ocaml
Leonidas has joined #ocaml
infinity0 has joined #ocaml
rntz2 has joined #ocaml
seliopou has joined #ocaml
theblatte has joined #ocaml
remexre has joined #ocaml
asm89 has joined #ocaml
eagleflo has joined #ocaml
nore has joined #ocaml
Exagone313 has joined #ocaml
mrd has joined #ocaml
drewolson has joined #ocaml
ansiwen has joined #ocaml
haskell_1 has joined #ocaml
jsoo has joined #ocaml
octachron has joined #ocaml
henistein has joined #ocaml
dan64 has quit [Max SendQ exceeded]
cantstanya has joined #ocaml
nicoo has joined #ocaml
andreas303 has joined #ocaml
tryte has joined #ocaml
c4rc4s has joined #ocaml
cantstanya has quit [Max SendQ exceeded]
andreas303 has quit [Max SendQ exceeded]
tinga has joined #ocaml
angerman has joined #ocaml
nullcone has joined #ocaml
avsm[m] has joined #ocaml
jeroud has joined #ocaml
radiopotin[m] has joined #ocaml
aditi314 has joined #ocaml
haesbaert has joined #ocaml
Amaan has joined #ocaml
qwr has joined #ocaml
greenbagels has joined #ocaml
steenuil has joined #ocaml
sadiq has joined #ocaml
dieggsy has joined #ocaml
robmyers has joined #ocaml
metadave has joined #ocaml
jca has joined #ocaml
averell has joined #ocaml
White_Flame has joined #ocaml
_habnabit has joined #ocaml
nfc has joined #ocaml
Putonlalla has joined #ocaml
dinosaure has joined #ocaml
Johann has joined #ocaml
Serpent7776 has joined #ocaml
lobo has joined #ocaml
noonien has joined #ocaml
robmyers has quit [Ping timeout: 248 seconds]
dan64 has joined #ocaml
leah2 has joined #ocaml
theglass has joined #ocaml
astronavt has joined #ocaml
lisq has joined #ocaml
labor[m] has joined #ocaml
Ekho has joined #ocaml
RalfJ has joined #ocaml
Enjolras has joined #ocaml
dash has joined #ocaml
takside has joined #ocaml
alexey has joined #ocaml
infinigon_ has joined #ocaml
mosterdt__ has joined #ocaml
wonko7 has quit [Max SendQ exceeded]
tane has joined #ocaml
tmhoang520 has joined #ocaml
jerith_ has joined #ocaml
t-j-r has joined #ocaml
vodkaInf1rno has joined #ocaml
dmbaturin has joined #ocaml
xenu has joined #ocaml
wagle has joined #ocaml
rfv has quit [Ping timeout: 250 seconds]
terabit has quit [Ping timeout: 250 seconds]
anton_5[m] has joined #ocaml
aspiwack[m] has joined #ocaml
Coldfusion[m] has joined #ocaml
jun has joined #ocaml
towel has joined #ocaml
sspi__ has joined #ocaml
vsiles has joined #ocaml
dieggsy has quit [Ping timeout: 248 seconds]
smondet[m] has joined #ocaml
Sumera[m] has joined #ocaml
Tardigreat[m] has joined #ocaml
runciter has joined #ocaml
cross has joined #ocaml
madgen_ has joined #ocaml
Armael has joined #ocaml
lnxw37d4 has joined #ocaml
toppler` has joined #ocaml
Eoco has joined #ocaml
srax has joined #ocaml
penguwin has joined #ocaml
drakonis has joined #ocaml
pippijn has joined #ocaml
OPeritel has joined #ocaml
flux has quit [Ping timeout: 258 seconds]
elusive has joined #ocaml
SrPx has quit [Ping timeout: 250 seconds]
astronavt has quit [Max SendQ exceeded]
Ekho has quit [Max SendQ exceeded]
labor[m] has quit [Ping timeout: 246 seconds]
avsm[m] has quit [Ping timeout: 248 seconds]
aditi314 has quit [Ping timeout: 248 seconds]
radiopotin[m] has quit [Ping timeout: 248 seconds]
pqwy[m] has quit [Ping timeout: 258 seconds]
serif[m] has quit [Ping timeout: 258 seconds]
jimt[m] has quit [Ping timeout: 258 seconds]
peddie has quit [Ping timeout: 258 seconds]
BitPuffin has quit [Ping timeout: 258 seconds]
Sumera[m] has quit [Ping timeout: 272 seconds]
smondet[m] has quit [Ping timeout: 247 seconds]
lnxw37d4 has quit [Ping timeout: 247 seconds]
Tardigreat[m] has quit [Ping timeout: 272 seconds]
ELLIOTTCABLE has joined #ocaml
nullcone has quit [Ping timeout: 248 seconds]
b20n has joined #ocaml
adi__________ has joined #ocaml
raver has joined #ocaml
bytesighs has joined #ocaml
chewbranca has joined #ocaml
higherorder__ has joined #ocaml
bronsen has joined #ocaml
cbarrett has joined #ocaml
artart78 has joined #ocaml
webshinra has joined #ocaml
jbrown has joined #ocaml
dwt has joined #ocaml
thizanne has joined #ocaml
mrallen1 has joined #ocaml
notnotdan_ has joined #ocaml
Coldfusion[m] has quit [Ping timeout: 276 seconds]
aspiwack[m] has quit [Ping timeout: 276 seconds]
higherorder__ has quit [Ping timeout: 283 seconds]
dash has quit [Ping timeout: 246 seconds]
anton_5[m] has quit [Ping timeout: 276 seconds]
ahf has quit [Ping timeout: 260 seconds]
stux|RC has joined #ocaml
robmyers has joined #ocaml
cemerick has quit [Ping timeout: 258 seconds]
stephe has quit [Ping timeout: 250 seconds]
chewbranca has quit [Ping timeout: 265 seconds]
b20n has quit [Ping timeout: 265 seconds]
ahf has joined #ocaml
cemerick has joined #ocaml
cbarrett has quit [Ping timeout: 260 seconds]
higherorder__ has joined #ocaml
waleee-cl has joined #ocaml
b20n has joined #ocaml
rfv has joined #ocaml
JSharp has joined #ocaml
chewbranca has joined #ocaml
SrPx has joined #ocaml
stephe has joined #ocaml
terabit has joined #ocaml
JSharp has quit [Client Quit]
JSharp has joined #ocaml
cbarrett has joined #ocaml
nullcone has joined #ocaml
waleee-cl has quit []
waleee-cl has joined #ocaml
<d_bot> <Curzon> Like I heard Jane Street uses it for like trading?
waleee-cl has quit [Client Quit]
<drakonis> yes.
aecepoglu[m] has joined #ocaml
<d_bot> <froyo> I find the interaction beterrn or-patterns and when-guards a little annoying..
<d_bot> <froyo> `function A | B | C x when x < 2 -> ... | C x -> ...`
<d_bot> <froyo> won't work because the `when` guard binds to the whole or-pattern, not just its own clause. i.e.
<d_bot> <froyo> `function (A | B | C x when x < 2) -> ... | C x -> ...`
<d_bot> <froyo> not
<d_bot> <froyo> `function A | B | (C x when x < 2) -> ... | C x -> ...`
<d_bot> <froyo> I wonder what's the rationale
dash1 has joined #ocaml
waleee-cl has joined #ocaml
tane has quit [Quit: Leaving]
rpcope has quit [Ping timeout: 268 seconds]
pqwy[m] has joined #ocaml
radiopotin[m] has joined #ocaml
labor[m] has joined #ocaml
lnxw37d4 has joined #ocaml
Sumera[m] has joined #ocaml
BitPuffin has joined #ocaml
aditi314 has joined #ocaml
jimt[m] has joined #ocaml
dieggsy has joined #ocaml
peddie has joined #ocaml
Tardigreat[m] has joined #ocaml
smondet[m] has joined #ocaml
flux has joined #ocaml
aspiwack[m] has joined #ocaml
avsm[m] has joined #ocaml
anton_5[m] has joined #ocaml
Coldfusion[m] has joined #ocaml
serif[m] has joined #ocaml
elusive has quit [Ping timeout: 245 seconds]
c4rc4s has quit [Changing host]
c4rc4s has joined #ocaml
ahf has joined #ocaml
ahf has quit [Changing host]
dieggsy is now known as Guest50292
ELLIOTTCABLE is now known as Guest10365
terabit is now known as Guest17825
nullcone is now known as Guest43593
dan64 is now known as Guest19992
JSharp is now known as Guest98452
Jesin has joined #ocaml
astronavt has joined #ocaml
Guest98452 has quit []
JSharp has joined #ocaml
cantstanya has joined #ocaml
andreas303 has joined #ocaml
Ekho has joined #ocaml
Serpent7776 has quit [Quit: leaving]
<henistein> There is some easy way to slice a list list? Per example, get 1st quadrant of a list list
waleee-cl has quit []
waleee-cl has joined #ocaml
<d_bot> <score> many libraries provide a `List.take` function (not in Stdlib unfortunately) which you could use like: `List.take (List.length lst / 4) lst`
<d_bot> <score> if you don't have a "take", it's easy to write. e.g. `let rec take n = function x :: xs when n > 0 -> x :: take (pred n) xs | _ -> []`
<henistein> Oh this is exactly what I need, thank you
rpcope has joined #ocaml
Guest17825 is now known as terabit
terabit has joined #ocaml
terabit has joined #ocaml
terabit has quit [Changing host]
tomku has joined #ocaml