<mbuf>
If I try, evensl evens [[1; 2]; [3; 4]], I get "Error: This expression has type int but an expression was expected of type int list"
<mbuf>
[[1; 2]; [3; 4]] tells me it is of type int list list.
barockobamo2 has quit [Remote host closed the connection]
gravicappa has joined #ocaml
<def`>
evensl evens [[[1; 2]; [3; 4]]]
<def`>
There are three level of map: one in evens, two in evensl
<def`>
so you need a three level-deep list.
<mbuf>
def`, ahh! okay
barockobamo has joined #ocaml
gravicappa has quit [Ping timeout: 245 seconds]
Haudegen has joined #ocaml
ygrek has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 276 seconds]
vicfred has quit [Read error: Connection reset by peer]
vicfred has joined #ocaml
FreeBirdLjj has joined #ocaml
zolk3ri has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 265 seconds]
malina has joined #ocaml
barockobamo has quit [Remote host closed the connection]
malina has quit [Remote host closed the connection]
barockobamo has joined #ocaml
jao has joined #ocaml
barockobamo2 has joined #ocaml
barockobamo has quit [Ping timeout: 276 seconds]
laudecay has joined #ocaml
KeyJoo has joined #ocaml
malina has joined #ocaml
laudecay has quit [Ping timeout: 276 seconds]
laudecay has joined #ocaml
sgnb has quit [Remote host closed the connection]
<laudecay>
yo so i'm running out of memory trying to run a dune test and i've isolated the error to two lines where I do Cstruct.of_bytes b |> Cstruct.hexdump;
<laudecay>
the two bytes are of length 8 and 32 respectively and i'm really not allocating that much anywhere period
<companion_cube>
C bindings are tough, sorry, I'm not competent with cstruct either
<laudecay>
yeah np
_5HT has quit [Remote host closed the connection]
<dmbaturin>
Damn, ppxx uses hg on bitbucket.
<cemerick>
if variants without parameters are unboxed at runtime (per RWO, just an enumeration of ints), is there a reason why the same couldn't be done for single-constructor types with an int param (e.g. `type t = Foo of int`)?
<companion_cube>
it's possible, look for the `unboxed` attribute
<companion_cube>
(single case constructor, or single field record)
<cemerick>
I shall in a bit
<cemerick>
I'm inferring that that's not the case, given a change in total runtime after replacing an int type with one like the above
<companion_cube>
you need to ask for it
<companion_cube>
(and use a recent compiler, possibly with flambda)
JimmyRcom has joined #ocaml
JimmyRcom has quit [Max SendQ exceeded]
JimmyRcom has joined #ocaml
JimmyRcom has quit [Remote host closed the connection]
klntsky has quit [Remote host closed the connection]
klntsky has joined #ocaml
analogue has quit [Quit: later alligator]
malina has quit [Remote host closed the connection]
troydm has quit [Ping timeout: 245 seconds]
kakadu_ has joined #ocaml
TC01 has quit [Ping timeout: 265 seconds]
TC01_ has joined #ocaml
ravenou__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bitwinery has joined #ocaml
bitwinery has quit [Remote host closed the connection]
bitwinery has joined #ocaml
ygrek has joined #ocaml
laudecay has quit [Ping timeout: 258 seconds]
<cemerick>
mmm, ok
<cemerick>
oh, you mean ocaml.unboxed, got it
<companion_cube>
yes
zolk3ri has quit [Quit: leaving]
narimiran has quit [Ping timeout: 265 seconds]
Hrundi_V_Bakshi has joined #ocaml
olle has joined #ocaml
oriba has joined #ocaml
oriba has quit [Quit: WeeChat 2.6]
spew has quit [Quit: going home]
olle has quit [Quit: leaving]
jnavila has quit [Remote host closed the connection]
stux|RC-only has quit [Quit: Aloha!]
stux|RC-only has joined #ocaml
troydm has joined #ocaml
nullifidian has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
zolk3ri has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
kakadu_ has quit [Remote host closed the connection]
nullifidian_ has joined #ocaml
nullifidian has quit [Ping timeout: 240 seconds]
Hrundi_V_Bakshi has quit [Ping timeout: 276 seconds]
Haudegen has quit [Ping timeout: 265 seconds]
nullifidian__ has joined #ocaml
_5HT has joined #ocaml
nullifidian_ has quit [Ping timeout: 265 seconds]
_5HT has quit [Remote host closed the connection]
_5HT has joined #ocaml
guest334 has joined #ocaml
guest334 has quit [Remote host closed the connection]
b0bby__ has joined #ocaml
<b0bby__>
hello
<b0bby__>
I'm trying to learn ocaml and was trying to define the type:
<b0bby__>
type lookup_table = Lookup_table of ((Pair of int * string) list) * lookup_table | EmptyTable
<b0bby__>
Can someone please tell me what is wrong with it?
<dmbaturin>
b0bby__: You can't define one sum type inside another.
<dmbaturin>
type lookup_table = Lookup_table of ((int * string) list) * lookup_table | EmptyTable (* is likely what you want *)
<b0bby__>
that looks about right, thank you
_5HT has quit [Remote host closed the connection]
analogue has joined #ocaml
_5HT has joined #ocaml
<dmbaturin>
There's rather little point in named product types, so you likely don't want to name the pair type anyway.