#!/usr/bin/env perl6

use Mathematica::Serializer;
use Data::Generators;
use Data::Reshapers;

say encode-to-wl([ "a" => 23, "karma" => 'interest', "instance" => 1/3, "ary" => Whatever, "condo" => Nil]):!encoded-head;

my $df = random-tabular-dataset(3,3);

say $df.raku;
say encode-to-wl($df);

my $dfLong = to-long-format($df);
say $dfLong;
say $dfLong.WHAT;

say encode-to-wl($dfLong);


my @rand[4;3;2];

say @rand.elems;
my $ind = 0;
# Have to use hard-coded values:
# #ERROR: Partially dimensioned views of shaped arrays not yet implemented. Sorry.
for ^@rand.elems -> $i {
    for ^3 -> $j {
        for ^2 -> $k {
            @rand[$i;$j;$k] = $ind++ ~ '-' ~ ($i, $j, $k).join(':') ~ '-' ~ random-word()
        }}}
say @rand;

say encode-to-wl(@rand);

say encode-to-wl((DateTime.new(2022,1,1,2,9,0), DateTime.new(2022,1,1,11,35,0), DateTime.new(2022,1,1,11,36,0)).Seq);