on master help sign in
Get rid of IsSpecialContext
2d11a08Shane O'Brien
.direnv/cache-20.09-80qwwqg61b4ps96wnew file+1
@@ -0,0 +1 @@
1+export SSL_CERT_FILE=$'/no-cert-file.crt';export $'outputs'=$'out';export TERM=$'xterm-kitty';export $'stdenv'=$'/nix/store/f95jkch26wxmqd076bcm976qrn7ml46i-stdenv-linux';export $'out'=$'/nix/store/iddhvczyxnr2r4ll2q73n74kmf8p6nng-ghc-shell-for-rel8-0.1.0.0-0';export $'depsTargetTarget'='';export $'system'=$'x86_64-linux';export AR=$'ar';export NIX_CC=$'/nix/store/azayfhqyg9mjyv6rv9bcypi6ws8aqfmy-gcc-wrapper-9.3.0';export $'doCheck'='';export $'depsHostHost'='';export $'depsBuildTargetPropagated'='';export LANG=$'en_US.UTF-8';export TMP=$'/run/user/1000';export NIX_HARDENING_ENABLE=$'fortify stackprotector pic strictoverflow format relro bindnow';export $'installPhase'=$'echo $nativeBuildInputs $buildInputs > $out';export TEMP=$'/run/user/1000';export STRIP=$'strip';export NIX_ENFORCE_NO_NATIVE=1;export NIX_GHC_LIBDIR=$'/nix/store/8i51p87558f7yraklb9cpy69qjjfpvfp-ghc-8.8.4-with-packages/lib/ghc-8.8.4';export RANLIB=$'ranlib';export SHLVL=5;export LOGNAME=$'shane';export AS=$'as';export $'depsBuildBuild'='';export $'depsHostHostPropagated'='';export $'depsBuildBuildPropagated'='';export NIX_INDENT_MAKE=1;export NIX_BUILD_TOP=$'/run/user/1000';export OBJCOPY=$'objcopy';export $'propagatedNativeBuildInputs'='';export $'shellHook'='';export $'strictDeps'='';export IN_NIX_SHELL=$'pure';export $'NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu'=1;export HOME=$'/home/shane';export SHELL=$'/nix/store/68sm67lcd4pnmyhijpyh134a7ykgyjhq-bash-interactive-4.4-p23/bin/bash';export NIX_LDFLAGS=$'-rpath /nix/store/iddhvczyxnr2r4ll2q73n74kmf8p6nng-ghc-shell-for-rel8-0.1.0.0-0/lib64 -rpath /nix/store/iddhvczyxnr2r4ll2q73n74kmf8p6nng-ghc-shell-for-rel8-0.1.0.0-0/lib -L/nix/store/qxd21xy8mz37x9a2cwj7zaw8813a1c8q-ncurses-6.2/lib -L/nix/store/mqr1hbh7jmgpmdfd7bb0yr54brb1b9xy-libffi-3.3/lib -L/nix/store/ks724y9k5skmsr5y4gii28nfqrb1r5bj-gmp-6.2.0/lib -L/nix/store/qxd21xy8mz37x9a2cwj7zaw8813a1c8q-ncurses-6.2/lib -L/nix/store/mqr1hbh7jmgpmdfd7bb0yr54brb1b9xy-libffi-3.3/lib -L/nix/store/ks724y9k5skmsr5y4gii28nfqrb1r5bj-gmp-6.2.0/lib';export NIX_GHCPKG=$'/nix/store/8i51p87558f7yraklb9cpy69qjjfpvfp-ghc-8.8.4-with-packages/bin/ghc-pkg';export $'NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu'=1;export LOCALE_ARCHIVE=$'/nix/store/a2px4kdz1jm03f8ifr1pzir0csfmyrlv-glibc-locales-2.31/lib/locale/locale-archive';export HOST_PATH=$'/nix/store/qxd21xy8mz37x9a2cwj7zaw8813a1c8q-ncurses-6.2/bin:/nix/store/z1qvlavy35wanw5k54fvvfffws5bvigj-coreutils-8.31/bin:/nix/store/3fvzxz59gacagpwyzpfdiinc1yv46hw1-findutils-4.7.0/bin:/nix/store/vaawdmhkg9l7d96v3s2lyw3myfqincxg-diffutils-3.7/bin:/nix/store/89gvmj46vdnajvxsgyhg362gs6rxc1d5-gnused-4.8/bin:/nix/store/0kcx6s8gxysnygd8kxa502xfdfm1n28y-gnugrep-3.4/bin:/nix/store/g9qsf6rcy467dxa6gxdh4sw8wm5p6alg-gawk-5.1.0/bin:/nix/store/xlfmnfbqryr6s52xgaqfaljmiccrv2rk-gnutar-1.32/bin:/nix/store/kypvz2lggy5hxkjpgxdpwjqg01jav4l0-gzip-1.10/bin:/nix/store/szfj0xvd2qh071dgvh9klw08w035igjz-bzip2-1.0.6.0.1-bin/bin:/nix/store/9l508y7cvrqjd1n50jbr3fm2q9smmp92-gnumake-4.3/bin:/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin:/nix/store/3hpc26jvws80s0byn1lvi5jv0l1cxpps-patch-2.7.6/bin:/nix/store/dq7bh302s22v8y8mm5fmdfm6wcfh7mb1-xz-5.2.5-bin/bin';export DISPLAY=$':0';export CONFIG_SHELL=$'/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash';export PAGER=$'less -R';export TEMPDIR=$'/run/user/1000';export NIX_SSL_CERT_FILE=$'/no-cert-file.crt';export _=$'/nix/store/5qg4lik0wb8plnfwvbsw0rrkym532hb2-direnv-2.27.0/bin/direnv';export $'patches'='';export $'buildInputs'='';export $'phases'=$'installPhase';export OBJDUMP=$'objdump';export $'configureFlags'='';export $'shell'=$'/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash';export SOURCE_DATE_EPOCH=315532800;export STRINGS=$'strings';export $'depsTargetTargetPropagated'='';export $'propagatedBuildInputs'='';export __ETC_PROFILE_SOURCED=1;export $'builder'=$'/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash';export CC=$'gcc';export USER=$'shane';export NM=$'nm';export PATH=$'/nix/store/68sm67lcd4pnmyhijpyh134a7ykgyjhq-bash-interactive-4.4-p23/bin:/nix/store/8i51p87558f7yraklb9cpy69qjjfpvfp-ghc-8.8.4-with-packages/bin:/nix/store/ajib0wv150ah6nqbkn5b5kwmqldk368y-patchelf-0.12/bin:/nix/store/azayfhqyg9mjyv6rv9bcypi6ws8aqfmy-gcc-wrapper-9.3.0/bin:/nix/store/hq3ps9kak12kw08hgacpjr4y4i9ias2l-gcc-9.3.0/bin:/nix/store/5n4m6xy6dip5fqxc56xmzr72qgwv6cjg-glibc-2.31-bin/bin:/nix/store/z1qvlavy35wanw5k54fvvfffws5bvigj-coreutils-8.31/bin:/nix/store/4mc40rwfxfd6jvwd8ga3pq8xw68sn0px-binutils-wrapper-2.31.1/bin:/nix/store/b10shv9yqbgps47y0n8x7l7bq8fmp1i6-binutils-2.31.1/bin:/nix/store/5n4m6xy6dip5fqxc56xmzr72qgwv6cjg-glibc-2.31-bin/bin:/nix/store/z1qvlavy35wanw5k54fvvfffws5bvigj-coreutils-8.31/bin:/nix/store/qxd21xy8mz37x9a2cwj7zaw8813a1c8q-ncurses-6.2/bin:/nix/store/z1qvlavy35wanw5k54fvvfffws5bvigj-coreutils-8.31/bin:/nix/store/3fvzxz59gacagpwyzpfdiinc1yv46hw1-findutils-4.7.0/bin:/nix/store/vaawdmhkg9l7d96v3s2lyw3myfqincxg-diffutils-3.7/bin:/nix/store/89gvmj46vdnajvxsgyhg362gs6rxc1d5-gnused-4.8/bin:/nix/store/0kcx6s8gxysnygd8kxa502xfdfm1n28y-gnugrep-3.4/bin:/nix/store/g9qsf6rcy467dxa6gxdh4sw8wm5p6alg-gawk-5.1.0/bin:/nix/store/xlfmnfbqryr6s52xgaqfaljmiccrv2rk-gnutar-1.32/bin:/nix/store/kypvz2lggy5hxkjpgxdpwjqg01jav4l0-gzip-1.10/bin:/nix/store/szfj0xvd2qh071dgvh9klw08w035igjz-bzip2-1.0.6.0.1-bin/bin:/nix/store/9l508y7cvrqjd1n50jbr3fm2q9smmp92-gnumake-4.3/bin:/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin:/nix/store/3hpc26jvws80s0byn1lvi5jv0l1cxpps-patch-2.7.6/bin:/nix/store/dq7bh302s22v8y8mm5fmdfm6wcfh7mb1-xz-5.2.5-bin/bin';export READELF=$'readelf';export $'depsBuildTarget'='';export NIX_STORE=$'/nix/store';export $'doInstallCheck'='';export $'nativeBuildInputs'=$'/nix/store/8i51p87558f7yraklb9cpy69qjjfpvfp-ghc-8.8.4-with-packages';export TMPDIR=$'/run/user/1000';export $'name'=$'ghc-shell-for-rel8-0.1.0.0-0';export CXX=$'g++';export SIZE=$'size';export LD=$'ld';export NIX_BINTOOLS=$'/nix/store/4mc40rwfxfd6jvwd8ga3pq8xw68sn0px-binutils-wrapper-2.31.1';export NIX_GHC_DOCDIR=$'/nix/store/8i51p87558f7yraklb9cpy69qjjfpvfp-ghc-8.8.4-with-packages/share/doc/ghc/html';export NIX_BUILD_CORES=12;export NIX_GHC=$'/nix/store/8i51p87558f7yraklb9cpy69qjjfpvfp-ghc-8.8.4-with-packages/bin/ghc';
.direnv/cache-unknownnew file+1
@@ -0,0 +1 @@
1+export NIX_HARDENING_ENABLE=$'fortify stackprotector pic strictoverflow format relro bindnow';export $'propagatedBuildInputs'='';export $'stdenv'=$'/nix/store/f95jkch26wxmqd076bcm976qrn7ml46i-stdenv-linux';export LANG=$'en_US.UTF-8';export $'NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu'=1;export $'depsTargetTarget'='';export $'name'=$'ghc-shell-for-rel8';export NIX_BUILD_CORES=1;export $'depsBuildTargetPropagated'='';export SIZE=$'size';export $'nativeBuildInputs'=$'/nix/store/9qf8l6dx2wvpiqhrpb3yhxb6dfn9kkcj-ghc-shell-for-rel8-ghc-8.10.3-env /nix/store/j7rnwy3f0f3d5llv2dl8cbmk6yflvasf-cabal-install-exe-cabal-3.2.0.0 /nix/store/3j8zraqj3mjd907xr1vdhq0hypl912py-haskell-language-server-exe-haskell-language-server-0.9.0.0';export HOST_PATH=$'/nix/store/qxd21xy8mz37x9a2cwj7zaw8813a1c8q-ncurses-6.2/bin:/nix/store/dgb0w5fsdym9k2hazvnbhsknrbmbi8a2-numactl-2.0.13/bin:/nix/store/ddq5n5dn0riximm7wqnm6hzc58kcy9ra-postgresql-11.10/bin:/nix/store/z1qvlavy35wanw5k54fvvfffws5bvigj-coreutils-8.31/bin:/nix/store/3fvzxz59gacagpwyzpfdiinc1yv46hw1-findutils-4.7.0/bin:/nix/store/vaawdmhkg9l7d96v3s2lyw3myfqincxg-diffutils-3.7/bin:/nix/store/89gvmj46vdnajvxsgyhg362gs6rxc1d5-gnused-4.8/bin:/nix/store/0kcx6s8gxysnygd8kxa502xfdfm1n28y-gnugrep-3.4/bin:/nix/store/g9qsf6rcy467dxa6gxdh4sw8wm5p6alg-gawk-5.1.0/bin:/nix/store/xlfmnfbqryr6s52xgaqfaljmiccrv2rk-gnutar-1.32/bin:/nix/store/kypvz2lggy5hxkjpgxdpwjqg01jav4l0-gzip-1.10/bin:/nix/store/szfj0xvd2qh071dgvh9klw08w035igjz-bzip2-1.0.6.0.1-bin/bin:/nix/store/9l508y7cvrqjd1n50jbr3fm2q9smmp92-gnumake-4.3/bin:/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin:/nix/store/3hpc26jvws80s0byn1lvi5jv0l1cxpps-patch-2.7.6/bin:/nix/store/dq7bh302s22v8y8mm5fmdfm6wcfh7mb1-xz-5.2.5-bin/bin';export TERM=$'xterm-kitty';export TEMP=$'/run/user/1000';export STRINGS=$'strings';export $'buildInputs'=$'/nix/store/dbz14k20gjmh2zx2mbsyfqxk9kz6ya7b-aeson-lib-aeson-1.5.5.1 /nix/store/g9x4a6h5iy7cnxsdp3krwac3f0ag7bw3-case-insensitive-lib-case-insensitive-1.2.1.0 /nix/store/ww11yh0pk7w6lqqj2g15ir96incayk7k-casing-lib-casing-0.1.4.1 /nix/store/6wl9649xqy3s6rp5bpkh0wszc2578sy1-contravariant-lib-contravariant-1.5.3 /nix/store/nmqzc3sl7fmbac0hvdsdxqqym06gkv8i-hasql-lib-hasql-1.4.4.2 /nix/store/qzf032d3v1psi4nb7nm4shr6mg3dqazj-opaleye-lib-opaleye-0.7.1.0 /nix/store/fzmac1vm3kzzy3y7x07rj2k4wdla46g1-profunctors-lib-profunctors-5.6.1 /nix/store/akn54cqihw8j64ibvk494fb1idchzs6k-scientific-lib-scientific-0.3.6.2 /nix/store/hkdbhinfwbpwlvxi2mr9qg2p5jfz10px-semialign-lib-semialign-1.1.0.1 /nix/store/vpcfgmklxzdabg4rb0faza065wk0kp05-semigroupoids-lib-semigroupoids-5.3.5 /nix/store/m5whfq8q5n1a55civy3k8lyys80hd2i9-these-lib-these-1.1.1.1 /nix/store/sqm8driil33rdz3fykd0w3ca0d7nf4vl-uuid-lib-uuid-1.3.13 /nix/store/6ari9k9l9zsfc8xg5n282x9x407b3iqn-base-compat-lib-base-compat-0.11.2 /nix/store/bcm01zifkfiwca87bf0c61w7smyacfwg-doctest-lib-doctest-0.18 /nix/store/nmqzc3sl7fmbac0hvdsdxqqym06gkv8i-hasql-lib-hasql-1.4.4.2 /nix/store/1rkw5qdzl4c0djnr16hji896vmahfd8b-tmp-postgres-lib-tmp-postgres-1.34.1.0 /nix/store/g9x4a6h5iy7cnxsdp3krwac3f0ag7bw3-case-insensitive-lib-case-insensitive-1.2.1.0 /nix/store/nmqzc3sl7fmbac0hvdsdxqqym06gkv8i-hasql-lib-hasql-1.4.4.2 /nix/store/j6l18yvak7g8npcqadifhnfsidjycs9y-hedgehog-lib-hedgehog-1.0.4 /nix/store/3r9y5rn8d40fhlgj2kr31ynvpdwsb0s1-lifted-base-lib-lifted-base-0.2.3.12 /nix/store/limn4bknpjacrxkb4bikw1zk487hkls0-monad-control-lib-monad-control-1.0.2.3 /nix/store/akn54cqihw8j64ibvk494fb1idchzs6k-scientific-lib-scientific-0.3.6.2 /nix/store/n50fm5a14k1l47q40yvcln20flr8qnfq-tasty-lib-tasty-1.4.1 /nix/store/5fj36vxbnkvlypbgj7fxfa1y549l6c2m-tasty-hedgehog-lib-tasty-hedgehog-1.0.1.0 /nix/store/1rkw5qdzl4c0djnr16hji896vmahfd8b-tmp-postgres-lib-tmp-postgres-1.34.1.0 /nix/store/sqm8driil33rdz3fykd0w3ca0d7nf4vl-uuid-lib-uuid-1.3.13 /nix/store/ddq5n5dn0riximm7wqnm6hzc58kcy9ra-postgresql-11.10';export NIX_ENFORCE_NO_NATIVE=1;export $'depsHostHostPropagated'='';export $'builder'=$'/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash';export $'nobuildPhase'=$'echo\necho "This derivation is not meant to be built, aborting";\necho\nexit 1\n';export NIX_BINTOOLS=$'/nix/store/4mc40rwfxfd6jvwd8ga3pq8xw68sn0px-binutils-wrapper-2.31.1';export __ETC_PROFILE_SOURCED=1;export $'strictDeps'='';export NIX_INDENT_MAKE=1;export $'out'=$'/nix/store/piwzilbdah64na4m6vz5m85njp5qrphc-ghc-shell-for-rel8';export $'system'=$'x86_64-linux';export IN_NIX_SHELL=$'pure';export TEMPDIR=$'/run/user/1000';export NIX_SSL_CERT_FILE=$'/no-cert-file.crt';export $'installPhase'=$'echo "Shell for rel8"\necho $nativeBuildInputs $buildInputs > $out\n';export OBJDUMP=$'objdump';export $'depsBuildBuild'='';export NIX_STORE=$'/nix/store';export $'outputs'=$'out';export $'shell'=$'/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash';export LOCALE_ARCHIVE=$'/nix/store/a2px4kdz1jm03f8ifr1pzir0csfmyrlv-glibc-locales-2.31/lib/locale/locale-archive';export TMP=$'/run/user/1000';export SSL_CERT_FILE=$'/no-cert-file.crt';export $'doInstallCheck'='';export $'depsBuildBuildPropagated'='';export DISPLAY=$':0';export NIX_GHC_LIBDIR=$'/nix/store/9qf8l6dx2wvpiqhrpb3yhxb6dfn9kkcj-ghc-shell-for-rel8-ghc-8.10.3-env/lib/ghc-8.10.3';export $'depsTargetTargetPropagated'='';export AR=$'ar';export NIX_CC=$'/nix/store/azayfhqyg9mjyv6rv9bcypi6ws8aqfmy-gcc-wrapper-9.3.0';export $'configureFlags'='';export SHELL=$'/nix/store/2mx7v230y7drsp7hnjwxz0vjmiiqr953-bash-interactive-4.4-p23/bin/bash';export OBJCOPY=$'objcopy';export $'propagatedNativeBuildInputs'='';export $'phases'=$'installPhase';export AS=$'as';export PATH=$'/nix/store/2mx7v230y7drsp7hnjwxz0vjmiiqr953-bash-interactive-4.4-p23/bin:/nix/store/9qf8l6dx2wvpiqhrpb3yhxb6dfn9kkcj-ghc-shell-for-rel8-ghc-8.10.3-env/bin:/nix/store/azayfhqyg9mjyv6rv9bcypi6ws8aqfmy-gcc-wrapper-9.3.0/bin:/nix/store/hq3ps9kak12kw08hgacpjr4y4i9ias2l-gcc-9.3.0/bin:/nix/store/5n4m6xy6dip5fqxc56xmzr72qgwv6cjg-glibc-2.31-bin/bin:/nix/store/z1qvlavy35wanw5k54fvvfffws5bvigj-coreutils-8.31/bin:/nix/store/4mc40rwfxfd6jvwd8ga3pq8xw68sn0px-binutils-wrapper-2.31.1/bin:/nix/store/b10shv9yqbgps47y0n8x7l7bq8fmp1i6-binutils-2.31.1/bin:/nix/store/5n4m6xy6dip5fqxc56xmzr72qgwv6cjg-glibc-2.31-bin/bin:/nix/store/z1qvlavy35wanw5k54fvvfffws5bvigj-coreutils-8.31/bin:/nix/store/j7rnwy3f0f3d5llv2dl8cbmk6yflvasf-cabal-install-exe-cabal-3.2.0.0/bin:/nix/store/3j8zraqj3mjd907xr1vdhq0hypl912py-haskell-language-server-exe-haskell-language-server-0.9.0.0/bin:/nix/store/ajib0wv150ah6nqbkn5b5kwmqldk368y-patchelf-0.12/bin:/nix/store/qxd21xy8mz37x9a2cwj7zaw8813a1c8q-ncurses-6.2/bin:/nix/store/dgb0w5fsdym9k2hazvnbhsknrbmbi8a2-numactl-2.0.13/bin:/nix/store/ddq5n5dn0riximm7wqnm6hzc58kcy9ra-postgresql-11.10/bin:/nix/store/z1qvlavy35wanw5k54fvvfffws5bvigj-coreutils-8.31/bin:/nix/store/3fvzxz59gacagpwyzpfdiinc1yv46hw1-findutils-4.7.0/bin:/nix/store/vaawdmhkg9l7d96v3s2lyw3myfqincxg-diffutils-3.7/bin:/nix/store/89gvmj46vdnajvxsgyhg362gs6rxc1d5-gnused-4.8/bin:/nix/store/0kcx6s8gxysnygd8kxa502xfdfm1n28y-gnugrep-3.4/bin:/nix/store/g9qsf6rcy467dxa6gxdh4sw8wm5p6alg-gawk-5.1.0/bin:/nix/store/xlfmnfbqryr6s52xgaqfaljmiccrv2rk-gnutar-1.32/bin:/nix/store/kypvz2lggy5hxkjpgxdpwjqg01jav4l0-gzip-1.10/bin:/nix/store/szfj0xvd2qh071dgvh9klw08w035igjz-bzip2-1.0.6.0.1-bin/bin:/nix/store/9l508y7cvrqjd1n50jbr3fm2q9smmp92-gnumake-4.3/bin:/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin:/nix/store/3hpc26jvws80s0byn1lvi5jv0l1cxpps-patch-2.7.6/bin:/nix/store/dq7bh302s22v8y8mm5fmdfm6wcfh7mb1-xz-5.2.5-bin/bin';export STRIP=$'strip';export HOME=$'/home/shane';export NIX_CFLAGS_COMPILE=$' -isystem /nix/store/dgb0w5fsdym9k2hazvnbhsknrbmbi8a2-numactl-2.0.13/include -isystem /nix/store/ddq5n5dn0riximm7wqnm6hzc58kcy9ra-postgresql-11.10/include -isystem /nix/store/dgb0w5fsdym9k2hazvnbhsknrbmbi8a2-numactl-2.0.13/include -isystem /nix/store/ddq5n5dn0riximm7wqnm6hzc58kcy9ra-postgresql-11.10/include';export SOURCE_DATE_EPOCH=315532800;export $'exactDeps'='';export SHLVL=4;export NIX_BUILD_TOP=$'/run/user/1000';export LD=$'ld';export CC=$'gcc';export $'shellHook'='';export TMPDIR=$'/run/user/1000';export $'doCheck'='';export $'patches'='';export LOGNAME=$'shane';export $'depsHostHost'='';export _=$'/nix/store/3y11i4sj2wp0p5296gqhcllyp8jkxgla-direnv-2.27.0/bin/direnv';export USER=$'shane';export PAGER=$'less -R';export $'NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu'=1;export CXX=$'g++';export RANLIB=$'ranlib';export NM=$'nm';export NIX_LDFLAGS=$'-rpath /nix/store/piwzilbdah64na4m6vz5m85njp5qrphc-ghc-shell-for-rel8/lib64 -rpath /nix/store/piwzilbdah64na4m6vz5m85njp5qrphc-ghc-shell-for-rel8/lib -L/nix/store/qxd21xy8mz37x9a2cwj7zaw8813a1c8q-ncurses-6.2/lib -L/nix/store/mqr1hbh7jmgpmdfd7bb0yr54brb1b9xy-libffi-3.3/lib -L/nix/store/ks724y9k5skmsr5y4gii28nfqrb1r5bj-gmp-6.2.0/lib -L/nix/store/dgb0w5fsdym9k2hazvnbhsknrbmbi8a2-numactl-2.0.13/lib -L/nix/store/ddq5n5dn0riximm7wqnm6hzc58kcy9ra-postgresql-11.10/lib -L/nix/store/19jnmpbvrcn42di65hkm4j1pc0pa1dsj-postgresql-11.10-lib/lib -L/nix/store/qxd21xy8mz37x9a2cwj7zaw8813a1c8q-ncurses-6.2/lib -L/nix/store/mqr1hbh7jmgpmdfd7bb0yr54brb1b9xy-libffi-3.3/lib -L/nix/store/ks724y9k5skmsr5y4gii28nfqrb1r5bj-gmp-6.2.0/lib -L/nix/store/dgb0w5fsdym9k2hazvnbhsknrbmbi8a2-numactl-2.0.13/lib -L/nix/store/ddq5n5dn0riximm7wqnm6hzc58kcy9ra-postgresql-11.10/lib -L/nix/store/19jnmpbvrcn42di65hkm4j1pc0pa1dsj-postgresql-11.10-lib/lib';export CONFIG_SHELL=$'/nix/store/a3fc4zqaiak11jks9zd579mz5v0li8bg-bash-4.4-p23/bin/bash';export READELF=$'readelf';export $'depsBuildTarget'='';
.direnv/drvnew file+1
@@ -0,0 +1 @@
1+/nix/store/shp5xkz1yjqkbivlma7xn2cn3bnn498d-ghc-shell-for-rel8.drv
.envrcnew file+1
@@ -0,0 +1 @@
1+use_nix
src/Rel8/Query/SQL.hs+2−2
@@ -28,7 +28,7 @@ import Rel8.Expr.Opaleye ( toPrimExpr )
28import Rel8.Query ( Query )
28import Rel8.Query ( Query )
29import Rel8.Query.Opaleye ( toOpaleye )
29import Rel8.Query.Opaleye ( toOpaleye )
30import qualified Rel8.Query.Optimize as Rel8 ( optimize )
30import qualified Rel8.Query.Optimize as Rel8 ( optimize )
31−import Rel8.Schema.Context ( Col'(..), Name( Name ) )
31+import Rel8.Schema.Context ( Col(..) )
32import Rel8.Schema.HTable ( htabulateA, hfield )
32import Rel8.Schema.HTable ( htabulateA, hfield )
33import Rel8.Table ( Table, toColumns )
33import Rel8.Table ( Table, toColumns )
34import Rel8.Table.Name ( namesFromLabels )
34import Rel8.Table.Name ( namesFromLabels )
@@ -69,7 +69,7 @@ selectFrom (toColumns -> names) (toColumns -> exprs) query =
69 where
69 where
70 select = Opaleye.foldPrimQuery Opaleye.sqlQueryGenerator query
70 select = Opaleye.foldPrimQuery Opaleye.sqlQueryGenerator query
71 attributes = getConst $ htabulateA $ \field -> case hfield names field of
71 attributes = getConst $ htabulateA $ \field -> case hfield names field of
72− Col (Name name) -> case hfield exprs field of
72+ NameCol name -> case hfield exprs field of
73 DB (toPrimExpr -> expr) -> Const (pure (makeAttr name expr))
73 DB (toPrimExpr -> expr) -> Const (pure (makeAttr name expr))
74 makeAttr label expr =
74 makeAttr label expr =
75 (Opaleye.sqlExpr expr, Just (Opaleye.SqlColumn label))
75 (Opaleye.sqlExpr expr, Just (Opaleye.SqlColumn label))
src/Rel8/Schema/Column.hs+43−46
@@ -20,9 +20,11 @@ import GHC.TypeLits ( Symbol )
20import Prelude
20import Prelude
21
21
22-- rel8
22-- rel8
23+import Rel8.Aggregate ( Aggregate )
24+import Rel8.Expr ( Expr )
23import Rel8.Kind.Labels ( Labels )
25import Rel8.Kind.Labels ( Labels )
24import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
26import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
25−import Rel8.Schema.Context ( IsSpecialContext )
27+import Rel8.Schema.Context ( Name, Insertion )
26import Rel8.Schema.Field ( Field )
28import Rel8.Schema.Field ( Field )
27import qualified Rel8.Schema.Kind as K
29import qualified Rel8.Schema.Kind as K
28import Rel8.Schema.Nullability ( Unnullify )
30import Rel8.Schema.Nullability ( Unnullify )
@@ -112,61 +114,56 @@ type Column context a =
112 (UnwrapDefault (UnwrapLabel a))
114 (UnwrapDefault (UnwrapLabel a))
113
115
114
116
115−type IHEither :: Bool -> K.Context -> Type -> Type -> Type
116−type family IHEither isSpecialContext context where
117− IHEither 'False _ = EitherTable
118− IHEither 'True Identity = Either
119− IHEither 'True Structure = Shape2 'Either
120− IHEither 'True _ = EitherTable
121−
122−
123−type IHList :: Bool -> K.Context -> Type -> Type
124−type family IHList isSpecialContext context where
125− IHList 'False _ = ListTable
126− IHList 'True Identity = []
127− IHList 'True Structure = Shape1 'List
128− IHList 'True _ = ListTable
129−
130−
131−type IHMaybe :: Bool -> K.Context -> Type -> Type
132−type family IHMaybe isSpecialContext context where
133− IHMaybe 'False _ = MaybeTable
134− IHMaybe 'True Identity = Maybe
135− IHMaybe 'True Structure = Shape1 'Maybe
136− IHMaybe 'True _ = MaybeTable
137−
138−
139−type IHNonEmpty :: Bool -> K.Context -> Type -> Type
140−type family IHNonEmpty isSpecialContext context where
141− IHNonEmpty 'False _ = NonEmptyTable
142− IHNonEmpty 'True Identity = NonEmpty
143− IHNonEmpty 'True Structure = Shape1 'NonEmpty
144− IHNonEmpty 'True _ = NonEmptyTable
145−
146−
147−type IHThese :: Bool -> K.Context -> Type -> Type -> Type
148−type family IHThese isSpecialContext context where
149− IHThese 'False _ = TheseTable
150− IHThese 'True Identity = These
151− IHThese 'True Structure = Shape2 'These
152− IHThese 'True _ = TheseTable
153−
154−
155type HEither :: K.Context -> Type -> Type -> Type
117type HEither :: K.Context -> Type -> Type -> Type
156−type HEither context = IHEither (IsSpecialContext context) context
118+type family HEither context where
119+ HEither Structure = Shape2 'Either
120+ HEither Aggregate = EitherTable
121+ HEither Expr = EitherTable
122+ HEither Identity = Either
123+ HEither Insertion = EitherTable
124+ HEither Name = EitherTable
125+ HEither _ = Either
157
126
158
127
159type HList :: K.Context -> Type -> Type
128type HList :: K.Context -> Type -> Type
160−type HList context = IHList (IsSpecialContext context) context
129+type family HList context where
130+ HList Structure = Shape1 'List
131+ HList Aggregate = ListTable
132+ HList Expr = ListTable
133+ HList Identity = []
134+ HList Insertion = ListTable
135+ HList Name = ListTable
136+ HList _ = []
161
137
162
138
163type HMaybe :: K.Context -> Type -> Type
139type HMaybe :: K.Context -> Type -> Type
164−type HMaybe context = IHMaybe (IsSpecialContext context) context
140+type family HMaybe context where
141+ HMaybe Structure = Shape1 'Maybe
142+ HMaybe Aggregate = MaybeTable
143+ HMaybe Expr = MaybeTable
144+ HMaybe Identity = Maybe
145+ HMaybe Insertion = MaybeTable
146+ HMaybe Name = MaybeTable
147+ HMaybe _ = Maybe
165
148
166
149
167type HNonEmpty :: K.Context -> Type -> Type
150type HNonEmpty :: K.Context -> Type -> Type
168−type HNonEmpty context = IHNonEmpty (IsSpecialContext context) context
151+type family HNonEmpty context where
152+ HNonEmpty Structure = Shape1 'NonEmpty
153+ HNonEmpty Aggregate = NonEmptyTable
154+ HNonEmpty Expr = NonEmptyTable
155+ HNonEmpty Identity = NonEmpty
156+ HNonEmpty Insertion = NonEmptyTable
157+ HNonEmpty Name = NonEmptyTable
158+ HNonEmpty _ = NonEmpty
169
159
170
160
171type HThese :: K.Context -> Type -> Type -> Type
161type HThese :: K.Context -> Type -> Type -> Type
172−type HThese context = IHThese (IsSpecialContext context) context
162+type family HThese context where
163+ HThese Structure = Shape2 'These
164+ HThese Aggregate = TheseTable
165+ HThese Expr = TheseTable
166+ HThese Identity = These
167+ HThese Insertion = TheseTable
168+ HThese Name = TheseTable
169+ HThese _ = These
src/Rel8/Schema/Context.hs+20−49
@@ -1,23 +1,14 @@
1{-# language DataKinds #-}
1{-# language DataKinds #-}
2{-# language DerivingStrategies #-}
2{-# language DerivingStrategies #-}
3−{-# language FlexibleContexts #-}
4−{-# language FlexibleInstances #-}
5{-# language GADTs #-}
3{-# language GADTs #-}
6{-# language GeneralizedNewtypeDeriving #-}
4{-# language GeneralizedNewtypeDeriving #-}
7−{-# language MultiParamTypeClasses #-}
8−{-# language ScopedTypeVariables #-}
9−{-# language StandaloneDeriving #-}
10{-# language StandaloneKindSignatures #-}
5{-# language StandaloneKindSignatures #-}
11−{-# language TypeApplications #-}
12{-# language TypeFamilies #-}
6{-# language TypeFamilies #-}
13−{-# language UndecidableInstances #-}
14
7
15module Rel8.Schema.Context
8module Rel8.Schema.Context
16− ( Col'( .. )
17− , Interpretation, Col
9+ ( Interpretation, Col(..)
18 , Insertion(..)
10 , Insertion(..)
19 , Name(..)
11 , Name(..)
20− , IsSpecialContext
21 )
12 )
22where
13where
23
14
@@ -33,51 +24,41 @@ import Rel8.Expr ( Expr )
33import Rel8.Kind.Necessity ( Necessity( Optional, Required ) )
24import Rel8.Kind.Necessity ( Necessity( Optional, Required ) )
34import qualified Rel8.Schema.Kind as K
25import qualified Rel8.Schema.Kind as K
35import Rel8.Schema.Spec ( Spec( Spec ) )
26import Rel8.Schema.Spec ( Spec( Spec ) )
36−import Rel8.Schema.Structure ( Structure )
37
27
38
28
39−type Interpretation' :: Bool -> K.Context -> Constraint
29+type Interpretation :: K.Context -> Constraint
40−class IsSpecialContext f ~ isSpecial => Interpretation' isSpecial f where
30+class Interpretation context where
41− data Col' isSpecial f :: K.HContext
31+ data Col context :: K.HContext
42
32
43
33
44−instance Interpretation' 'True Aggregate where
34+instance Interpretation Aggregate where
45− data Col' 'True Aggregate _spec where
35+ data Col Aggregate _spec where
46 Aggregation :: ()
36 Aggregation :: ()
47 => Aggregate (Expr a)
37 => Aggregate (Expr a)
48− -> Col' 'True Aggregate ('Spec labels necessity db a)
38+ -> Col Aggregate ('Spec labels necessity db a)
49
39
50
40
51−instance Interpretation' 'True Expr where
41+instance Interpretation Expr where
52− data Col' 'True Expr _spec where
42+ data Col Expr _spec where
53 DB :: ()
43 DB :: ()
54 => { unDB :: Expr a }
44 => { unDB :: Expr a }
55− -> Col' 'True Expr ('Spec labels necessity db a)
45+ -> Col Expr ('Spec labels necessity db a)
56−
57−
58−instance Interpretation' 'True Identity where
59− data Col' 'True Identity _spec where
60− Result :: a -> Col' 'True Identity ('Spec labels necessity db a)
61−
62
46
63−instance Interpretation' 'True Insertion where
64− data Col' 'True Insertion _spec where
65− RequiredInsert :: Expr a -> Col' 'True Insertion ('Spec labels 'Required db a)
66− OptionalInsert :: Maybe (Expr a) -> Col' 'True Insertion ('Spec labels 'Optional db a)
67
47
48+instance Interpretation Identity where
49+ data Col Identity _spec where
50+ Result :: a -> Col Identity ('Spec labels necessity db a)
68
51
69−instance IsSpecialContext f ~ 'False => Interpretation' 'False f where
70− data Col' 'False f _spec where
71− Col :: f a -> Col' 'False f ('Spec labels necessity db a)
72
52
73−
74−type Interpretation :: K.Context -> Constraint
75−class Interpretation' (IsSpecialContext context) context => Interpretation context
76−instance Interpretation' (IsSpecialContext context) context => Interpretation context
53+instance Interpretation Insertion where
54+ data Col Insertion _spec where
55+ RequiredInsert :: Expr a -> Col Insertion ('Spec labels 'Required db a)
56+ OptionalInsert :: Maybe (Expr a) -> Col Insertion ('Spec labels 'Optional db a)
77
57
78
58
79−type Col :: K.Context -> K.HContext
59+instance Interpretation Name where
80−type Col context = Col' (IsSpecialContext context) context
60+ data Col Name _spec where
61+ NameCol :: String -> Col Name ('Spec labels necessity db a)
81
62
82
63
83type Insertion :: K.Context
64type Insertion :: K.Context
@@ -92,13 +73,3 @@ type Name :: K.Context
92newtype Name a = Name String
73newtype Name a = Name String
93 deriving stock Show
74 deriving stock Show
94 deriving newtype (IsString, Monoid, Semigroup)
75 deriving newtype (IsString, Monoid, Semigroup)
95−
96−
97−type IsSpecialContext :: K.Context -> Bool
98−type family IsSpecialContext context where
99− IsSpecialContext Aggregate = 'True
100− IsSpecialContext Expr = 'True
101− IsSpecialContext Insertion = 'True
102− IsSpecialContext Identity = 'True
103− IsSpecialContext Structure = 'True
104− IsSpecialContext _ = 'False
src/Rel8/Schema/Context/Identity.hs+1−1
@@ -19,7 +19,7 @@ import Data.List.NonEmpty ( NonEmpty )
19import Prelude hiding ( null )
19import Prelude hiding ( null )
20
20
21-- rel8
21-- rel8
22−import Rel8.Schema.Context ( Col, Col'( Result ) )
22+import Rel8.Schema.Context ( Col( Result ) )
23import Rel8.Schema.HTable ( HTable )
23import Rel8.Schema.HTable ( HTable )
24import Rel8.Schema.HTable.Either ( HEitherTable(..) )
24import Rel8.Schema.HTable.Either ( HEitherTable(..) )
25import Rel8.Schema.HTable.Identity ( HIdentity(..) )
25import Rel8.Schema.HTable.Identity ( HIdentity(..) )
src/Rel8/Schema/Context/Label.hs+5−12
@@ -20,10 +20,7 @@ import Prelude hiding ( null )
20-- rel8
20-- rel8
21import Rel8.Aggregate ( Aggregate )
21import Rel8.Aggregate ( Aggregate )
22import Rel8.Expr ( Expr )
22import Rel8.Expr ( Expr )
23−import Rel8.Schema.Context
23+import Rel8.Schema.Context ( Interpretation, Col(..), Insertion, Name )
24− ( Interpretation, Col, Col'(..), IsSpecialContext
25− , Insertion
26− )
27import qualified Rel8.Schema.Kind as K
24import qualified Rel8.Schema.Kind as K
28import Rel8.Schema.Spec ( Spec( Spec ) )
25import Rel8.Schema.Spec ( Spec( Spec ) )
29
26
@@ -64,11 +61,9 @@ instance Labelable Identity where
64 unlabeler (Result a) = Result a
61 unlabeler (Result a) = Result a
65
62
66
63
67−instance {-# OVERLAPPABLE #-} IsSpecialContext context ~ 'False =>
68− Labelable context
64+instance Labelable Name where
69− where
70− labeler (Col a) = Col a
65+ labeler (NameCol a) = NameCol a
71− unlabeler (Col a) = Col a
66+ unlabeler (NameCol a) = NameCol a
72
67
73
68
74type HLabelable :: K.HContext -> Constraint
69type HLabelable :: K.HContext -> Constraint
@@ -82,8 +77,6 @@ class HLabelable context where
82 -> context ('Spec labels necessity db a)
77 -> context ('Spec labels necessity db a)
83
78
84
79
85−instance (Labelable context, x ~ IsSpecialContext context) =>
86− HLabelable (Col' x context)
80+instance Labelable context => HLabelable (Col context) where
87− where
88 hlabeler = labeler
81 hlabeler = labeler
89 hunlabeler = unlabeler
82 hunlabeler = unlabeler
src/Rel8/Schema/Context/Nullify.hs+4−9
@@ -35,12 +35,7 @@ import Rel8.Expr.Null ( nullify, unsafeUnnullify )
35import Rel8.Expr.Opaleye ( fromPrimExpr, toPrimExpr )
35import Rel8.Expr.Opaleye ( fromPrimExpr, toPrimExpr )
36import Rel8.Kind.Labels ( KnownLabels, labelsSing, renderLabels )
36import Rel8.Kind.Labels ( KnownLabels, labelsSing, renderLabels )
37import Rel8.Kind.Necessity ( Necessity( Required ) )
37import Rel8.Kind.Necessity ( Necessity( Required ) )
38−import Rel8.Schema.Context
38+import Rel8.Schema.Context ( Interpretation, Col(..), Insertion, Name )
39− ( Interpretation
40− , Col, Col'(..)
41− , Insertion
42− , Name( Name )
43− )
44import qualified Rel8.Schema.Kind as K
39import qualified Rel8.Schema.Kind as K
45import Rel8.Schema.Nullability ( Nullability( Nullable, NonNullable ), Sql )
40import Rel8.Schema.Nullability ( Nullability( Nullable, NonNullable ), Sql )
46import Rel8.Schema.Spec ( Spec( Spec ), SSpec(..) )
41import Rel8.Schema.Spec ( Spec( Spec ), SSpec(..) )
@@ -121,8 +116,8 @@ instance Nullifiable Insertion where
121instance Nullifiable Name where
116instance Nullifiable Name where
122 encodeTag _ = nameFromLabel
117 encodeTag _ = nameFromLabel
123 decodeTag _ = mempty
118 decodeTag _ = mempty
124− nullifier _ _ (Col (Name name)) = Col (Name name)
119+ nullifier _ _ (NameCol name) = NameCol name
125− unnullifier _ _ (Col (Name name)) = Col (Name name)
120+ unnullifier _ _ (NameCol name) = NameCol name
126
121
127 {-# INLINABLE encodeTag #-}
122 {-# INLINABLE encodeTag #-}
128 {-# INLINABLE decodeTag #-}
123 {-# INLINABLE decodeTag #-}
@@ -160,4 +155,4 @@ undoGroupBy = getFirst . foldInputs go
160nameFromLabel :: forall labels necessity db a.
155nameFromLabel :: forall labels necessity db a.
161 KnownLabels labels => Col Name ('Spec labels necessity db a)
156 KnownLabels labels => Col Name ('Spec labels necessity db a)
162nameFromLabel = case labelsSing @labels of
157nameFromLabel = case labelsSing @labels of
163− labels -> Col (Name (NonEmpty.last (renderLabels labels)))
158+ labels -> NameCol (NonEmpty.last (renderLabels labels))
src/Rel8/Schema/Field.hs+9−15
@@ -1,7 +1,6 @@
1{-# language DataKinds #-}
1{-# language DataKinds #-}
2{-# language StandaloneKindSignatures #-}
2{-# language StandaloneKindSignatures #-}
3{-# language TypeFamilies #-}
3{-# language TypeFamilies #-}
4−{-# language UndecidableInstances #-}
5
4
6module Rel8.Schema.Field
5module Rel8.Schema.Field
7 ( Field
6 ( Field
@@ -18,23 +17,18 @@ import Rel8.Aggregate ( Aggregate )
18import Rel8.Expr ( Expr )
17import Rel8.Expr ( Expr )
19import Rel8.Kind.Labels ( Labels )
18import Rel8.Kind.Labels ( Labels )
20import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
19import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
21−import Rel8.Schema.Context ( Insertion, IsSpecialContext )
20+import Rel8.Schema.Context ( Insertion )
22import qualified Rel8.Schema.Kind as K
21import qualified Rel8.Schema.Kind as K
23import Rel8.Schema.Spec ( Spec( Spec ) )
22import Rel8.Schema.Spec ( Spec( Spec ) )
24import Rel8.Schema.Structure ( Structure, Shape( Column ), Shape1 )
23import Rel8.Schema.Structure ( Structure, Shape( Column ), Shape1 )
25
24
26
25
27−type IField :: Bool -> K.Context -> Labels -> Necessity -> Type -> Type -> Type
28−type family IField isSpecialContext labels context necessity db a where
29− IField 'False context _labels _necessity _db a = context a
30− IField 'True Identity _labels _necessity _db a = a
31− IField 'True Expr _labels _necessity _db a = Expr a
32− IField 'True Insertion _labels 'Required _db a = Expr a
33− IField 'True Insertion _labels 'Optional _db a = Maybe (Expr a)
34− IField 'True Aggregate _labels _necessity _db a = Aggregate (Expr a)
35− IField 'True Structure labels necessity db a = Shape1 'Column ('Spec labels necessity db a)
36−
37−
38type Field :: K.Context -> Labels -> Necessity -> Type -> Type -> Type
26type Field :: K.Context -> Labels -> Necessity -> Type -> Type -> Type
39−type Field context labels necessity db a =
27+type family Field labels context necessity db a where
40− IField (IsSpecialContext context) context labels necessity db a
28+ Field Identity _labels _necessity _db a = a
29+ Field Expr _labels _necessity _db a = Expr a
30+ Field Insertion _labels 'Required _db a = Expr a
31+ Field Insertion _labels 'Optional _db a = Maybe (Expr a)
32+ Field Aggregate _labels _necessity _db a = Aggregate (Expr a)
33+ Field Structure labels necessity db a = Shape1 'Column ('Spec labels necessity db a)
34+ Field context _labels _necessity _db a = context a
src/Rel8/Schema/Generic.hs+206−249
@@ -54,7 +54,6 @@ import Rel8.Schema.Context.Label
54 ( Labelable, labeler, unlabeler
54 ( Labelable, labeler, unlabeler
55 , hlabeler, hunlabeler
55 , hlabeler, hunlabeler
56 )
56 )
57−import Rel8.Schema.Context.Nullify ( Nullifiable )
58import Rel8.Schema.Field ( Field )
57import Rel8.Schema.Field ( Field )
59import Rel8.Schema.HTable ( HTable )
58import Rel8.Schema.HTable ( HTable )
60import Rel8.Schema.HTable.Either ( HEitherTable )
59import Rel8.Schema.HTable.Either ( HEitherTable )
@@ -92,48 +91,42 @@ import Rel8.Table.These ( TheseTable )
92import Data.These ( These )
91import Data.These ( These )
93
92
94
93
95−instance (Rel8able t, TableHelper (IsSpecialContext context) context) =>
94+instance (Rel8able t, TableHelper context) => Table context (t context) where
96− Table context (t context)
97− where
98 type Columns (t context) = GRep t
95 type Columns (t context) = GRep t
99 type Context (t context) = context
96 type Context (t context) = context
100 fromColumns = gfromColumns
97 fromColumns = gfromColumns
101 toColumns = gtoColumns
98 toColumns = gtoColumns
102
99
103
100
104−type TableHelper :: Bool -> K.Context -> Constraint
101+type TableHelper :: K.Context -> Constraint
105−class IsSpecialContext context ~ isSpecialContext =>
106− TableHelper isSpecialContext context
102+class TableHelper context where
107− where
108 gfromColumns :: Rel8able t => GRep t (Col context) -> t context
103 gfromColumns :: Rel8able t => GRep t (Col context) -> t context
109 gtoColumns :: Rel8able t => t context -> GRep t (Col context)
104 gtoColumns :: Rel8able t => t context -> GRep t (Col context)
110
105
111
106
112−instance TableHelper 'True Aggregate where
107+instance TableHelper Aggregate where
113 gfromColumns = fromAggregateColumns
108 gfromColumns = fromAggregateColumns
114 gtoColumns = toAggregateColumns
109 gtoColumns = toAggregateColumns
115
110
116
111
117−instance TableHelper 'True Expr where
112+instance TableHelper Expr where
118 gfromColumns = fromExprColumns
113 gfromColumns = fromExprColumns
119 gtoColumns = toExprColumns
114 gtoColumns = toExprColumns
120
115
121
116
122−instance TableHelper 'True Insertion where
117+instance TableHelper Insertion where
123 gfromColumns = fromInsertionColumns
118 gfromColumns = fromInsertionColumns
124 gtoColumns = toInsertionColumns
119 gtoColumns = toInsertionColumns
125
120
126
121
127−instance TableHelper 'True Identity where
122+instance TableHelper Identity where
128 gfromColumns = fromIdentityColumns
123 gfromColumns = fromIdentityColumns
129 gtoColumns = toIdentityColumns
124 gtoColumns = toIdentityColumns
130
125
131
126
132−instance (IsSpecialContext context ~ 'False, Labelable context, Nullifiable context) =>
133− TableHelper 'False context
127+instance TableHelper Name where
134− where
135− gfromColumns = fromUnspecialColumns
128+ gfromColumns = fromNameColumns
136− gtoColumns = toUnspecialColumns
129+ gtoColumns = toNameColumns
137
130
138
131
139-- | This type class allows you to define custom 'Table's using higher-kinded
132-- | This type class allows you to define custom 'Table's using higher-kinded
@@ -194,16 +187,8 @@ class HTable (GRep t) => Rel8able t where
194 fromIdentityColumns :: GRep t (Col Identity) -> t Identity
187 fromIdentityColumns :: GRep t (Col Identity) -> t Identity
195 toIdentityColumns :: t Identity -> GRep t (Col Identity)
188 toIdentityColumns :: t Identity -> GRep t (Col Identity)
196
189
197− fromUnspecialColumns ::
190+ fromNameColumns :: GRep t (Col Name) -> t Name
198− ( IsSpecialContext context ~ 'False
191+ toNameColumns :: t Name -> GRep t (Col Name)
199− , Labelable context, Nullifiable context
200− )
201− => GRep t (Col context) -> t context
202− toUnspecialColumns ::
203− ( IsSpecialContext context ~ 'False
204− , Labelable context, Nullifiable context
205− )
206− => t context -> GRep t (Col context)
207
192
208 type GRep t = GColumns (Rep (t Structure))
193 type GRep t = GColumns (Rep (t Structure))
209
194
@@ -263,19 +248,19 @@ class HTable (GRep t) => Rel8able t where
263 ) => t Identity -> GRep t (Col Identity)
248 ) => t Identity -> GRep t (Col Identity)
264 toIdentityColumns = toGColumns @_ @(Rep (t Structure)) . from
249 toIdentityColumns = toGColumns @_ @(Rep (t Structure)) . from
265
250
266− default fromUnspecialColumns ::
251+ default fromNameColumns ::
267− ( Generic (t context)
252+ ( Generic (t Name)
268 , GColumns (Rep (t Structure)) ~ GRep t
253 , GColumns (Rep (t Structure)) ~ GRep t
269− , GRel8able context (Rep (t Structure)) (Rep (t context))
254+ , GRel8able Name (Rep (t Structure)) (Rep (t Name))
270− ) => GRep t (Col context) -> t context
255+ ) => GRep t (Col Name) -> t Name
271− fromUnspecialColumns = to . fromGColumns @_ @(Rep (t Structure))
256+ fromNameColumns = to . fromGColumns @_ @(Rep (t Structure))
272
257
273− default toUnspecialColumns ::
258+ default toNameColumns ::
274− ( Generic (t context)
259+ ( Generic (t Name)
275 , GColumns (Rep (t Structure)) ~ GRep t
260 , GColumns (Rep (t Structure)) ~ GRep t
276− , GRel8able context (Rep (t Structure)) (Rep (t context))
261+ , GRel8able Name (Rep (t Structure)) (Rep (t Name))
277− ) => t context -> GRep t (Col context)
262+ ) => t Name -> GRep t (Col Name)
278− toUnspecialColumns = toGColumns @_ @(Rep (t Structure)) . from
263+ toNameColumns = toGColumns @_ @(Rep (t Structure)) . from
279
264
280
265
281type GColumns :: (Type -> Type) -> K.HTable
266type GColumns :: (Type -> Type) -> K.HTable
@@ -316,14 +301,14 @@ instance (GRel8able context structure1 rep1, GRel8able context structure2 rep2)
316
301
317
302
318instance
303instance
319− ( K1Table label isSpecialContext context isStructure structure a
304+ ( K1Table label context isStructure structure a
320 , meta ~ 'MetaSel ('Just label) _su _ss _ds
305 , meta ~ 'MetaSel ('Just label) _su _ss _ds
321 , structureK1 ~ K1 i structure
306 , structureK1 ~ K1 i structure
322 , k1 ~ K1 i a
307 , k1 ~ K1 i a
323 ) => GRel8able context (M1 S meta structureK1) (M1 S meta k1)
308 ) => GRel8able context (M1 S meta structureK1) (M1 S meta k1)
324 where
309 where
325− fromGColumns = M1 . K1 . fromK1Columns @label @_ @_ @_ @structure
310+ fromGColumns = M1 . K1 . fromK1Columns @label @_ @_ @structure
326− toGColumns (M1 (K1 a)) = toK1Columns @label @_ @_ @_ @structure a
311+ toGColumns (M1 (K1 a)) = toK1Columns @label @_ @_ @structure a
327
312
328
313
329type K1Columns :: Symbol -> Type -> K.HTable
314type K1Columns :: Symbol -> Type -> K.HTable
@@ -368,11 +353,9 @@ type family K1Columns label structure where
368 K1Columns label a = HLabel label (Columns a)
353 K1Columns label a = HLabel label (Columns a)
369
354
370
355
371−type K1Table :: Symbol -> Bool -> K.Context -> Bool -> Type -> Type -> Constraint
356+type K1Table :: Symbol -> K.Context -> Bool -> Type -> Type -> Constraint
372−class
373− ( isSpecialContext ~ IsSpecialContext context
374− , isStructure ~ IsStructure structure
357+class isStructure ~ IsStructure structure =>
375− ) => K1Table label isSpecialContext context isStructure structure a
358+ K1Table label context isStructure structure a
376 where
359 where
377 fromK1Columns :: K1Columns label structure (Col context) -> a
360 fromK1Columns :: K1Columns label structure (Col context) -> a
378 toK1Columns :: a -> K1Columns label structure (Col context)
361 toK1Columns :: a -> K1Columns label structure (Col context)
@@ -380,7 +363,7 @@ class
380
363
381instance
364instance
382 ( x ~ Field Aggregate '[] necessity db a
365 ( x ~ Field Aggregate '[] necessity db a
383− ) => K1Table label 'True Aggregate 'True (Shape1 'Column ('Spec '[] necessity db a)) x
366+ ) => K1Table label Aggregate 'True (Shape1 'Column ('Spec '[] necessity db a)) x
384 where
367 where
385 fromK1Columns (HIdentity (Aggregation a)) = a
368 fromK1Columns (HIdentity (Aggregation a)) = a
386 toK1Columns = HIdentity . Aggregation
369 toK1Columns = HIdentity . Aggregation
@@ -390,7 +373,7 @@ instance
390
373
391instance
374instance
392 ( x ~ Field Aggregate (label ': labels) necessity db a
375 ( x ~ Field Aggregate (label ': labels) necessity db a
393− ) => K1Table _label 'True Aggregate 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
376+ ) => K1Table _label Aggregate 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
394 where
377 where
395 fromK1Columns (HIdentity (Aggregation a)) = a
378 fromK1Columns (HIdentity (Aggregation a)) = a
396 toK1Columns = HIdentity . Aggregation
379 toK1Columns = HIdentity . Aggregation
@@ -400,7 +383,7 @@ instance
400
383
401instance
384instance
402 ( x ~ Field Expr '[] necessity db a
385 ( x ~ Field Expr '[] necessity db a
403− ) => K1Table label 'True Expr 'True (Shape1 'Column ('Spec '[] necessity db a)) x
386+ ) => K1Table label Expr 'True (Shape1 'Column ('Spec '[] necessity db a)) x
404 where
387 where
405 fromK1Columns (HIdentity (DB a)) = a
388 fromK1Columns (HIdentity (DB a)) = a
406 toK1Columns = HIdentity . DB
389 toK1Columns = HIdentity . DB
@@ -410,7 +393,7 @@ instance
410
393
411instance
394instance
412 ( x ~ Field Expr (label ': labels) necessity db a
395 ( x ~ Field Expr (label ': labels) necessity db a
413− ) => K1Table _label 'True Expr 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
396+ ) => K1Table _label Expr 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
414 where
397 where
415 fromK1Columns (HIdentity (DB a)) = a
398 fromK1Columns (HIdentity (DB a)) = a
416 toK1Columns = HIdentity . DB
399 toK1Columns = HIdentity . DB
@@ -421,7 +404,7 @@ instance
421instance
404instance
422 ( x ~ Field Insertion '[] necessity db a
405 ( x ~ Field Insertion '[] necessity db a
423 , KnownNecessity necessity
406 , KnownNecessity necessity
424− ) => K1Table label 'True Insertion 'True (Shape1 'Column ('Spec '[] necessity db a)) x
407+ ) => K1Table label Insertion 'True (Shape1 'Column ('Spec '[] necessity db a)) x
425 where
408 where
426 fromK1Columns (HIdentity insert) = case insert of
409 fromK1Columns (HIdentity insert) = case insert of
427 RequiredInsert a -> a
410 RequiredInsert a -> a
@@ -436,7 +419,7 @@ instance
436instance
419instance
437 ( x ~ Field Insertion (label ': labels) necessity db a
420 ( x ~ Field Insertion (label ': labels) necessity db a
438 , KnownNecessity necessity
421 , KnownNecessity necessity
439− ) => K1Table _label 'True Insertion 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
422+ ) => K1Table _label Insertion 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
440 where
423 where
441 fromK1Columns (HIdentity insert) = case insert of
424 fromK1Columns (HIdentity insert) = case insert of
442 RequiredInsert a -> a
425 RequiredInsert a -> a
@@ -450,7 +433,7 @@ instance
450
433
451instance
434instance
452 ( x ~ Field Identity '[] necessity db a
435 ( x ~ Field Identity '[] necessity db a
453− ) => K1Table label 'True Identity 'True (Shape1 'Column ('Spec '[] necessity db a)) x
436+ ) => K1Table label Identity 'True (Shape1 'Column ('Spec '[] necessity db a)) x
454 where
437 where
455 fromK1Columns (HIdentity (Result a)) = a
438 fromK1Columns (HIdentity (Result a)) = a
456 toK1Columns = HIdentity . Result
439 toK1Columns = HIdentity . Result
@@ -460,7 +443,7 @@ instance
460
443
461instance
444instance
462 ( x ~ Field Identity (label ': labels) necessity db a
445 ( x ~ Field Identity (label ': labels) necessity db a
463− ) => K1Table _label 'True Identity 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
446+ ) => K1Table _label Identity 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
464 where
447 where
465 fromK1Columns (HIdentity (Result a)) = a
448 fromK1Columns (HIdentity (Result a)) = a
466 toK1Columns = HIdentity . Result
449 toK1Columns = HIdentity . Result
@@ -469,24 +452,21 @@ instance
469
452
470
453
471instance
454instance
472− ( IsSpecialContext context ~ 'False
455+ ( x ~ Field Name '[] necessity db a
473− , x ~ context a
474− ) => K1Table _label 'False context 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
456+ ) => K1Table _label Name 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
475 where
457 where
476− fromK1Columns (HIdentity (Col a)) = a
458+ fromK1Columns (HIdentity (NameCol a)) = Name a
477− toK1Columns = HIdentity . Col
459+ toK1Columns (Name a) = HIdentity (NameCol a)
478 {-# INLINABLE fromK1Columns #-}
460 {-# INLINABLE fromK1Columns #-}
479 {-# INLINABLE toK1Columns #-}
461 {-# INLINABLE toK1Columns #-}
480
462
481
463
482instance
464instance
483− ( IsSpecialContext context ~ 'False
465+ ( x ~ Field Name (label ': labels) necessity db a
484− , x ~ context a
485− , Labelable context
486− ) => K1Table label 'False context 'True (Shape1 'Column ('Spec '[] necessity db a)) x
466+ ) => K1Table label Name 'True (Shape1 'Column ('Spec '[] necessity db a)) x
487 where
467 where
488− fromK1Columns = (\(Col a) -> a) . unlabeler . unHIdentity
468+ fromK1Columns = Name . (\(NameCol a) -> a) . unlabeler . unHIdentity
489− toK1Columns = HIdentity . labeler . Col
469+ toK1Columns = HIdentity . labeler . NameCol . (\(Name a) -> a)
490 {-# INLINABLE fromK1Columns #-}
470 {-# INLINABLE fromK1Columns #-}
491 {-# INLINABLE toK1Columns #-}
471 {-# INLINABLE toK1Columns #-}
492
472
@@ -494,21 +474,21 @@ instance
494instance
474instance
495 ( HTable (K1Columns "Left" structure1)
475 ( HTable (K1Columns "Left" structure1)
496 , HTable (K1Columns "Right" structure2)
476 , HTable (K1Columns "Right" structure2)
497− , K1Table "Left" 'True Aggregate (IsStructure structure1) structure1 a
477+ , K1Table "Left" Aggregate (IsStructure structure1) structure1 a
498− , K1Table "Right" 'True Aggregate (IsStructure structure2) structure2 b
478+ , K1Table "Right" Aggregate (IsStructure structure2) structure2 b
499 , e ~ EitherTable a b
479 , e ~ EitherTable a b
500− ) => K1Table label 'True Aggregate 'True (Shape2 'Either structure1 structure2) e
480+ ) => K1Table label Aggregate 'True (Shape2 'Either structure1 structure2) e
501 where
481 where
502 fromK1Columns =
482 fromK1Columns =
503 fromColumns2
483 fromColumns2
504− (fromK1Columns @"Left" @_ @_ @_ @structure1)
484+ (fromK1Columns @"Left" @_ @_ @structure1)
505− (fromK1Columns @"Right" @_ @_ @_ @structure2) .
485+ (fromK1Columns @"Right" @_ @_ @structure2) .
506 hunlabel unlabeler
486 hunlabel unlabeler
507 toK1Columns =
487 toK1Columns =
508 hlabel labeler .
488 hlabel labeler .
509 toColumns2
489 toColumns2
510− (toK1Columns @"Left" @_ @_ @_ @structure1)
490+ (toK1Columns @"Left" @_ @_ @structure1)
511− (toK1Columns @"Right" @_ @_ @_ @structure2)
491+ (toK1Columns @"Right" @_ @_ @structure2)
512 {-# INLINABLE fromK1Columns #-}
492 {-# INLINABLE fromK1Columns #-}
513 {-# INLINABLE toK1Columns #-}
493 {-# INLINABLE toK1Columns #-}
514
494
@@ -516,21 +496,21 @@ instance
516instance
496instance
517 ( HTable (K1Columns "Left" structure1)
497 ( HTable (K1Columns "Left" structure1)
518 , HTable (K1Columns "Right" structure2)
498 , HTable (K1Columns "Right" structure2)
519− , K1Table "Left" 'True Expr (IsStructure structure1) structure1 a
499+ , K1Table "Left" Expr (IsStructure structure1) structure1 a
520− , K1Table "Right" 'True Expr (IsStructure structure2) structure2 b
500+ , K1Table "Right" Expr (IsStructure structure2) structure2 b
521 , e ~ EitherTable a b
501 , e ~ EitherTable a b
522− ) => K1Table label 'True Expr 'True (Shape2 'Either structure1 structure2) e
502+ ) => K1Table label Expr 'True (Shape2 'Either structure1 structure2) e
523 where
503 where
524 fromK1Columns =
504 fromK1Columns =
525 fromColumns2
505 fromColumns2
526− (fromK1Columns @"Left" @_ @_ @_ @structure1)
506+ (fromK1Columns @"Left" @_ @_ @structure1)
527− (fromK1Columns @"Right" @_ @_ @_ @structure2) .
507+ (fromK1Columns @"Right" @_ @_ @structure2) .
528 hunlabel unlabeler
508 hunlabel unlabeler
529 toK1Columns =
509 toK1Columns =
530 hlabel labeler .
510 hlabel labeler .
531 toColumns2
511 toColumns2
532− (toK1Columns @"Left" @_ @_ @_ @structure1)
512+ (toK1Columns @"Left" @_ @_ @structure1)
533− (toK1Columns @"Right" @_ @_ @_ @structure2)
513+ (toK1Columns @"Right" @_ @_ @structure2)
534 {-# INLINABLE fromK1Columns #-}
514 {-# INLINABLE fromK1Columns #-}
535 {-# INLINABLE toK1Columns #-}
515 {-# INLINABLE toK1Columns #-}
536
516
@@ -538,21 +518,21 @@ instance
538instance
518instance
539 ( HTable (K1Columns "Left" structure1)
519 ( HTable (K1Columns "Left" structure1)
540 , HTable (K1Columns "Right" structure2)
520 , HTable (K1Columns "Right" structure2)
541− , K1Table "Left" 'True Insertion (IsStructure structure1) structure1 a
521+ , K1Table "Left" Insertion (IsStructure structure1) structure1 a
542− , K1Table "Right" 'True Insertion (IsStructure structure2) structure2 b
522+ , K1Table "Right" Insertion (IsStructure structure2) structure2 b
543 , e ~ EitherTable a b
523 , e ~ EitherTable a b
544− ) => K1Table label 'True Insertion 'True (Shape2 'Either structure1 structure2) e
524+ ) => K1Table label Insertion 'True (Shape2 'Either structure1 structure2) e
545 where
525 where
546 fromK1Columns =
526 fromK1Columns =
547 fromColumns2
527 fromColumns2
548− (fromK1Columns @"Left" @_ @_ @_ @structure1)
528+ (fromK1Columns @"Left" @_ @_ @structure1)
549− (fromK1Columns @"Right" @_ @_ @_ @structure2) .
529+ (fromK1Columns @"Right" @_ @_ @structure2) .
550 hunlabel unlabeler
530 hunlabel unlabeler
551 toK1Columns =
531 toK1Columns =
552 hlabel labeler .
532 hlabel labeler .
553 toColumns2
533 toColumns2
554− (toK1Columns @"Left" @_ @_ @_ @structure1)
534+ (toK1Columns @"Left" @_ @_ @structure1)
555− (toK1Columns @"Right" @_ @_ @_ @structure2)
535+ (toK1Columns @"Right" @_ @_ @structure2)
556 {-# INLINABLE fromK1Columns #-}
536 {-# INLINABLE fromK1Columns #-}
557 {-# INLINABLE toK1Columns #-}
537 {-# INLINABLE toK1Columns #-}
558
538
@@ -560,23 +540,23 @@ instance
560instance
540instance
561 ( HTable (K1Columns "Left" structure1)
541 ( HTable (K1Columns "Left" structure1)
562 , HTable (K1Columns "Right" structure2)
542 , HTable (K1Columns "Right" structure2)
563− , K1Table "Left" 'True Identity (IsStructure structure1) structure1 a
543+ , K1Table "Left" Identity (IsStructure structure1) structure1 a
564− , K1Table "Right" 'True Identity (IsStructure structure2) structure2 b
544+ , K1Table "Right" Identity (IsStructure structure2) structure2 b
565 , e ~ Either a b
545 , e ~ Either a b
566− ) => K1Table label 'True Identity 'True (Shape2 'Either structure1 structure2) e
546+ ) => K1Table label Identity 'True (Shape2 'Either structure1 structure2) e
567 where
547 where
568 fromK1Columns
548 fromK1Columns
569 = bimap
549 = bimap
570− (fromK1Columns @"Left" @_ @_ @_ @structure1)
550+ (fromK1Columns @"Left" @_ @_ @structure1)
571− (fromK1Columns @"Right" @_ @_ @_ @structure2)
551+ (fromK1Columns @"Right" @_ @_ @structure2)
572 . fromHEitherTable
552 . fromHEitherTable
573 . hunlabel unlabeler
553 . hunlabel unlabeler
574 toK1Columns
554 toK1Columns
575 = hlabel labeler
555 = hlabel labeler
576 . toHEitherTable
556 . toHEitherTable
577 . bimap
557 . bimap
578− (toK1Columns @"Left" @_ @_ @_ @structure1)
558+ (toK1Columns @"Left" @_ @_ @structure1)
579− (toK1Columns @"Right" @_ @_ @_ @structure2)
559+ (toK1Columns @"Right" @_ @_ @structure2)
580 {-# INLINABLE fromK1Columns #-}
560 {-# INLINABLE fromK1Columns #-}
581 {-# INLINABLE toK1Columns #-}
561 {-# INLINABLE toK1Columns #-}
582
562
@@ -584,34 +564,30 @@ instance
584instance
564instance
585 ( HTable (K1Columns "Left" structure1)
565 ( HTable (K1Columns "Left" structure1)
586 , HTable (K1Columns "Right" structure2)
566 , HTable (K1Columns "Right" structure2)
587− , K1Table "Left" 'False context (IsStructure structure1) structure1 a
567+ , K1Table "Left" Name (IsStructure structure1) structure1 a
588− , K1Table "Right" 'False context (IsStructure structure2) structure2 b
568+ , K1Table "Right" Name (IsStructure structure2) structure2 b
589− , IsSpecialContext context ~ 'False
590− , Labelable context
591− , Nullifiable context
592 , e ~ EitherTable a b
569 , e ~ EitherTable a b
593− ) => K1Table label 'False context 'True (Shape2 'Either structure1 structure2) e
570+ ) => K1Table label Name 'True (Shape2 'Either structure1 structure2) e
594 where
571 where
595 fromK1Columns =
572 fromK1Columns =
596 fromColumns2
573 fromColumns2
597− (fromK1Columns @"Left" @_ @_ @_ @structure1)
574+ (fromK1Columns @"Left" @_ @_ @structure1)
598− (fromK1Columns @"Right" @_ @_ @_ @structure2) .
575+ (fromK1Columns @"Right" @_ @_ @structure2) .
599 hunlabel unlabeler
576 hunlabel unlabeler
600 toK1Columns =
577 toK1Columns =
601 hlabel labeler .
578 hlabel labeler .
602 toColumns2
579 toColumns2
603− (toK1Columns @"Left" @_ @_ @_ @structure1)
580+ (toK1Columns @"Left" @_ @_ @structure1)
604− (toK1Columns @"Right" @_ @_ @_ @structure2)
581+ (toK1Columns @"Right" @_ @_ @structure2)
605 {-# INLINABLE fromK1Columns #-}
582 {-# INLINABLE fromK1Columns #-}
606 {-# INLINABLE toK1Columns #-}
583 {-# INLINABLE toK1Columns #-}
607
584
608
585
609instance
586instance
610− ( K1Table label 'True Aggregate (IsStructure structure) structure a
611− , Table Aggregate a
587+ ( Table Aggregate a
612 , K1Columns label structure ~ HLabel label (Columns a)
588 , K1Columns label structure ~ HLabel label (Columns a)
613 , as ~ ListTable a
589 , as ~ ListTable a
614− ) => K1Table label 'True Aggregate 'True (Shape1 'List structure) as
590+ ) => K1Table label Aggregate 'True (Shape1 'List structure) as
615 where
591 where
616 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
592 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
617 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
593 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -620,11 +596,10 @@ instance
620
596
621
597
622instance
598instance
623− ( K1Table label 'True Expr (IsStructure structure) structure a
624− , Table Expr a
599+ ( Table Expr a
625 , K1Columns label structure ~ HLabel label (Columns a)
600 , K1Columns label structure ~ HLabel label (Columns a)
626 , as ~ ListTable a
601 , as ~ ListTable a
627− ) => K1Table label 'True Expr 'True (Shape1 'List structure) as
602+ ) => K1Table label Expr 'True (Shape1 'List structure) as
628 where
603 where
629 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
604 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
630 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
605 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -633,11 +608,10 @@ instance
633
608
634
609
635instance
610instance
636− ( K1Table label 'True Insertion (IsStructure structure) structure a
637− , Table Insertion a
611+ ( Table Insertion a
638 , K1Columns label structure ~ HLabel label (Columns a)
612 , K1Columns label structure ~ HLabel label (Columns a)
639 , as ~ ListTable a
613 , as ~ ListTable a
640− ) => K1Table label 'True Insertion 'True (Shape1 'List structure) as
614+ ) => K1Table label Insertion 'True (Shape1 'List structure) as
641 where
615 where
642 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
616 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
643 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
617 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -646,25 +620,22 @@ instance
646
620
647
621
648instance
622instance
649− ( K1Table label 'True Identity (IsStructure structure) structure a
623+ ( K1Table label Identity (IsStructure structure) structure a
650 , HTable (K1Columns label structure)
624 , HTable (K1Columns label structure)
651 , as ~ [a]
625 , as ~ [a]
652− ) => K1Table label 'True Identity 'True (Shape1 'List structure) as
626+ ) => K1Table label Identity 'True (Shape1 'List structure) as
653 where
627 where
654− fromK1Columns = fmap (fromK1Columns @label @'True @Identity @_ @structure) . fromHListTable
628+ fromK1Columns = fmap (fromK1Columns @label @_ @_ @structure) . fromHListTable
655− toK1Columns = toHListTable . fmap (toK1Columns @label @'True @Identity @_ @structure)
629+ toK1Columns = toHListTable . fmap (toK1Columns @label @_ @_ @structure)
656 {-# INLINABLE fromK1Columns #-}
630 {-# INLINABLE fromK1Columns #-}
657 {-# INLINABLE toK1Columns #-}
631 {-# INLINABLE toK1Columns #-}
658
632
659
633
660instance
634instance
661− ( K1Table label 'False context (IsStructure structure) structure a
662− , IsSpecialContext context ~ 'False
663− , Table context a
635+ ( Table Name a
664 , K1Columns label structure ~ HLabel label (Columns a)
636 , K1Columns label structure ~ HLabel label (Columns a)
665− , Labelable context
666 , as ~ ListTable a
637 , as ~ ListTable a
667− ) => K1Table label 'False context 'True (Shape1 'List structure) as
638+ ) => K1Table label Name 'True (Shape1 'List structure) as
668 where
639 where
669 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
640 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
670 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
641 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -674,95 +645,91 @@ instance
674
645
675instance
646instance
676 ( HTable (K1Columns "Just" structure)
647 ( HTable (K1Columns "Just" structure)
677− , K1Table "Just" 'True Aggregate (IsStructure structure) structure a
648+ , K1Table "Just" Aggregate (IsStructure structure) structure a
678 , ma ~ MaybeTable a
649 , ma ~ MaybeTable a
679− ) => K1Table label 'True Aggregate 'True (Shape1 'Maybe structure) ma
650+ ) => K1Table label Aggregate 'True (Shape1 'Maybe structure) ma
680 where
651 where
681 fromK1Columns =
652 fromK1Columns =
682− fromColumns1 (fromK1Columns @"Just" @_ @_ @_ @structure) .
653+ fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
683 hunlabel unlabeler
654 hunlabel unlabeler
684 toK1Columns =
655 toK1Columns =
685 hlabel labeler .
656 hlabel labeler .
686− toColumns1 (toK1Columns @"Just" @_ @_ @_ @structure)
657+ toColumns1 (toK1Columns @"Just" @_ @_ @structure)
687 {-# INLINABLE fromK1Columns #-}
658 {-# INLINABLE fromK1Columns #-}
688 {-# INLINABLE toK1Columns #-}
659 {-# INLINABLE toK1Columns #-}
689
660
690
661
691instance
662instance
692 ( HTable (K1Columns "Just" structure)
663 ( HTable (K1Columns "Just" structure)
693− , K1Table "Just" 'True Expr (IsStructure structure) structure a
664+ , K1Table "Just" Expr (IsStructure structure) structure a
694 , ma ~ MaybeTable a
665 , ma ~ MaybeTable a
695− ) => K1Table label 'True Expr 'True (Shape1 'Maybe structure) ma
666+ ) => K1Table label Expr 'True (Shape1 'Maybe structure) ma
696 where
667 where
697 fromK1Columns =
668 fromK1Columns =
698− fromColumns1 (fromK1Columns @"Just" @_ @_ @_ @structure) .
669+ fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
699 hunlabel unlabeler
670 hunlabel unlabeler
700 toK1Columns =
671 toK1Columns =
701 hlabel labeler .
672 hlabel labeler .
702− toColumns1 (toK1Columns @"Just" @_ @_ @_ @structure)
673+ toColumns1 (toK1Columns @"Just" @_ @_ @structure)
703 {-# INLINABLE fromK1Columns #-}
674 {-# INLINABLE fromK1Columns #-}
704 {-# INLINABLE toK1Columns #-}
675 {-# INLINABLE toK1Columns #-}
705
676
706
677
707instance
678instance
708 ( HTable (K1Columns "Just" structure)
679 ( HTable (K1Columns "Just" structure)
709− , K1Table "Just" 'True Insertion (IsStructure structure) structure a
680+ , K1Table "Just" Insertion (IsStructure structure) structure a
710 , ma ~ MaybeTable a
681 , ma ~ MaybeTable a
711− ) => K1Table label 'True Insertion 'True (Shape1 'Maybe structure) ma
682+ ) => K1Table label Insertion 'True (Shape1 'Maybe structure) ma
712 where
683 where
713 fromK1Columns =
684 fromK1Columns =
714− fromColumns1 (fromK1Columns @"Just" @_ @_ @_ @structure) .
685+ fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
715 hunlabel unlabeler
686 hunlabel unlabeler
716 toK1Columns =
687 toK1Columns =
717 hlabel labeler .
688 hlabel labeler .
718− toColumns1 (toK1Columns @"Just" @_ @_ @_ @structure)
689+ toColumns1 (toK1Columns @"Just" @_ @_ @structure)
719 {-# INLINABLE fromK1Columns #-}
690 {-# INLINABLE fromK1Columns #-}
720 {-# INLINABLE toK1Columns #-}
691 {-# INLINABLE toK1Columns #-}
721
692
722
693
723instance
694instance
724 ( HTable (K1Columns "Just" structure)
695 ( HTable (K1Columns "Just" structure)
725− , K1Table "Just" 'True Identity (IsStructure structure) structure a
696+ , K1Table "Just" Identity (IsStructure structure) structure a
726 , ma ~ Maybe a
697 , ma ~ Maybe a
727− ) => K1Table label 'True Identity 'True (Shape1 'Maybe structure) ma
698+ ) => K1Table label Identity 'True (Shape1 'Maybe structure) ma
728 where
699 where
729 fromK1Columns
700 fromK1Columns
730− = fmap (fromK1Columns @"Just" @_ @_ @_ @structure)
701+ = fmap (fromK1Columns @"Just" @_ @_ @structure)
731 . fromHMaybeTable
702 . fromHMaybeTable
732 . hunlabel unlabeler
703 . hunlabel unlabeler
733 toK1Columns
704 toK1Columns
734 = hlabel labeler
705 = hlabel labeler
735 . toHMaybeTable
706 . toHMaybeTable
736− . fmap (toK1Columns @"Just" @_ @_ @_ @structure)
707+ . fmap (toK1Columns @"Just" @_ @_ @structure)
737 {-# INLINABLE fromK1Columns #-}
708 {-# INLINABLE fromK1Columns #-}
738 {-# INLINABLE toK1Columns #-}
709 {-# INLINABLE toK1Columns #-}
739
710
740
711
741instance
712instance
742 ( HTable (K1Columns "Just" structure)
713 ( HTable (K1Columns "Just" structure)
743− , K1Table "Just" 'False context (IsStructure structure) structure a
714+ , K1Table "Just" Name (IsStructure structure) structure a
744− , IsSpecialContext context ~ 'False
745− , Labelable context
746− , Nullifiable context
747 , ma ~ MaybeTable a
715 , ma ~ MaybeTable a
748− ) => K1Table label 'False context 'True (Shape1 'Maybe structure) ma
716+ ) => K1Table label Name 'True (Shape1 'Maybe structure) ma
749 where
717 where
750 fromK1Columns =
718 fromK1Columns =
751− fromColumns1 (fromK1Columns @"Just" @_ @_ @_ @structure) .
719+ fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
752 hunlabel unlabeler
720 hunlabel unlabeler
753 toK1Columns =
721 toK1Columns =
754 hlabel labeler .
722 hlabel labeler .
755− toColumns1 (toK1Columns @"Just" @_ @_ @_ @structure)
723+ toColumns1 (toK1Columns @"Just" @_ @_ @structure)
756 {-# INLINABLE fromK1Columns #-}
724 {-# INLINABLE fromK1Columns #-}
757 {-# INLINABLE toK1Columns #-}
725 {-# INLINABLE toK1Columns #-}
758
726
759
727
760instance
728instance
761− ( K1Table label 'True Aggregate (IsStructure structure) structure a
762− , Table Aggregate a
729+ ( Table Aggregate a
763 , K1Columns label structure ~ HLabel label (Columns a)
730 , K1Columns label structure ~ HLabel label (Columns a)
764 , as ~ NonEmptyTable a
731 , as ~ NonEmptyTable a
765− ) => K1Table label 'True Aggregate 'True (Shape1 'NonEmpty structure) as
732+ ) => K1Table label Aggregate 'True (Shape1 'NonEmpty structure) as
766 where
733 where
767 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
734 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
768 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
735 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -771,11 +738,10 @@ instance
771
738
772
739
773instance
740instance
774− ( K1Table label 'True Expr (IsStructure structure) structure a
775− , Table Expr a
741+ ( Table Expr a
776 , K1Columns label structure ~ HLabel label (Columns a)
742 , K1Columns label structure ~ HLabel label (Columns a)
777 , as ~ NonEmptyTable a
743 , as ~ NonEmptyTable a
778− ) => K1Table label 'True Expr 'True (Shape1 'NonEmpty structure) as
744+ ) => K1Table label Expr 'True (Shape1 'NonEmpty structure) as
779 where
745 where
780 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
746 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
781 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
747 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -784,11 +750,10 @@ instance
784
750
785
751
786instance
752instance
787− ( K1Table label 'True Insertion (IsStructure structure) structure a
788− , Table Insertion a
753+ ( Table Insertion a
789 , K1Columns label structure ~ HLabel label (Columns a)
754 , K1Columns label structure ~ HLabel label (Columns a)
790 , as ~ NonEmptyTable a
755 , as ~ NonEmptyTable a
791− ) => K1Table label 'True Insertion 'True (Shape1 'NonEmpty structure) as
756+ ) => K1Table label Insertion 'True (Shape1 'NonEmpty structure) as
792 where
757 where
793 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
758 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
794 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
759 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -797,25 +762,22 @@ instance
797
762
798
763
799instance
764instance
800− ( K1Table label 'True Identity (IsStructure structure) structure a
765+ ( K1Table label Identity (IsStructure structure) structure a
801 , HTable (K1Columns label structure)
766 , HTable (K1Columns label structure)
802 , as ~ NonEmpty a
767 , as ~ NonEmpty a
803− ) => K1Table label 'True Identity 'True (Shape1 'NonEmpty structure) as
768+ ) => K1Table label Identity 'True (Shape1 'NonEmpty structure) as
804 where
769 where
805− fromK1Columns = fmap (fromK1Columns @label @'True @Identity @_ @structure) . fromHNonEmptyTable
770+ fromK1Columns = fmap (fromK1Columns @label @_ @_ @structure) . fromHNonEmptyTable
806− toK1Columns = toHNonEmptyTable . fmap (toK1Columns @label @'True @Identity @_ @structure)
771+ toK1Columns = toHNonEmptyTable . fmap (toK1Columns @label @_ @_ @structure)
807 {-# INLINABLE fromK1Columns #-}
772 {-# INLINABLE fromK1Columns #-}
808 {-# INLINABLE toK1Columns #-}
773 {-# INLINABLE toK1Columns #-}
809
774
810
775
811instance
776instance
812− ( K1Table label 'False context (IsStructure structure) structure a
813− , IsSpecialContext context ~ 'False
814− , Table context a
777+ ( Table Name a
815 , K1Columns label structure ~ HLabel label (Columns a)
778 , K1Columns label structure ~ HLabel label (Columns a)
816− , Labelable context
817 , as ~ NonEmptyTable a
779 , as ~ NonEmptyTable a
818− ) => K1Table label 'False context 'True (Shape1 'NonEmpty structure) as
780+ ) => K1Table label Name 'True (Shape1 'NonEmpty structure) as
819 where
781 where
820 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
782 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
821 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
783 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -826,21 +788,21 @@ instance
826instance
788instance
827 ( HTable (K1Columns "Here" structure1)
789 ( HTable (K1Columns "Here" structure1)
828 , HTable (K1Columns "There" structure2)
790 , HTable (K1Columns "There" structure2)
829− , K1Table "Here" 'True Aggregate (IsStructure structure1) structure1 a
791+ , K1Table "Here" Aggregate (IsStructure structure1) structure1 a
830− , K1Table "There" 'True Aggregate (IsStructure structure2) structure2 b
792+ , K1Table "There" Aggregate (IsStructure structure2) structure2 b
831 , e ~ TheseTable a b
793 , e ~ TheseTable a b
832− ) => K1Table label 'True Aggregate 'True (Shape2 'These structure1 structure2) e
794+ ) => K1Table label Aggregate 'True (Shape2 'These structure1 structure2) e
833 where
795 where
834 fromK1Columns =
796 fromK1Columns =
835 fromColumns2
797 fromColumns2
836− (fromK1Columns @"Here" @_ @_ @_ @structure1)
798+ (fromK1Columns @"Here" @_ @_ @structure1)
837− (fromK1Columns @"There" @_ @_ @_ @structure2) .
799+ (fromK1Columns @"There" @_ @_ @structure2) .
838 hunlabel unlabeler
800 hunlabel unlabeler
839 toK1Columns =
801 toK1Columns =
840 hlabel labeler .
802 hlabel labeler .
841 toColumns2
803 toColumns2
842− (toK1Columns @"Here" @_ @_ @_ @structure1)
804+ (toK1Columns @"Here" @_ @_ @structure1)
843− (toK1Columns @"There" @_ @_ @_ @structure2)
805+ (toK1Columns @"There" @_ @_ @structure2)
844 {-# INLINABLE fromK1Columns #-}
806 {-# INLINABLE fromK1Columns #-}
845 {-# INLINABLE toK1Columns #-}
807 {-# INLINABLE toK1Columns #-}
846
808
@@ -848,21 +810,21 @@ instance
848instance
810instance
849 ( HTable (K1Columns "Here" structure1)
811 ( HTable (K1Columns "Here" structure1)
850 , HTable (K1Columns "There" structure2)
812 , HTable (K1Columns "There" structure2)
851− , K1Table "Here" 'True Expr (IsStructure structure1) structure1 a
813+ , K1Table "Here" Expr (IsStructure structure1) structure1 a
852− , K1Table "There" 'True Expr (IsStructure structure2) structure2 b
814+ , K1Table "There" Expr (IsStructure structure2) structure2 b
853 , e ~ TheseTable a b
815 , e ~ TheseTable a b
854− ) => K1Table label 'True Expr 'True (Shape2 'These structure1 structure2) e
816+ ) => K1Table label Expr 'True (Shape2 'These structure1 structure2) e
855 where
817 where
856 fromK1Columns =
818 fromK1Columns =
857 fromColumns2
819 fromColumns2
858− (fromK1Columns @"Here" @_ @_ @_ @structure1)
820+ (fromK1Columns @"Here" @_ @_ @structure1)
859− (fromK1Columns @"There" @_ @_ @_ @structure2) .
821+ (fromK1Columns @"There" @_ @_ @structure2) .
860 hunlabel unlabeler
822 hunlabel unlabeler
861 toK1Columns =
823 toK1Columns =
862 hlabel labeler .
824 hlabel labeler .
863 toColumns2
825 toColumns2
864− (toK1Columns @"Here" @_ @_ @_ @structure1)
826+ (toK1Columns @"Here" @_ @_ @structure1)
865− (toK1Columns @"There" @_ @_ @_ @structure2)
827+ (toK1Columns @"There" @_ @_ @structure2)
866 {-# INLINABLE fromK1Columns #-}
828 {-# INLINABLE fromK1Columns #-}
867 {-# INLINABLE toK1Columns #-}
829 {-# INLINABLE toK1Columns #-}
868
830
@@ -870,21 +832,21 @@ instance
870instance
832instance
871 ( HTable (K1Columns "Here" structure1)
833 ( HTable (K1Columns "Here" structure1)
872 , HTable (K1Columns "There" structure2)
834 , HTable (K1Columns "There" structure2)
873− , K1Table "Here" 'True Insertion (IsStructure structure1) structure1 a
835+ , K1Table "Here" Insertion (IsStructure structure1) structure1 a
874− , K1Table "There" 'True Insertion (IsStructure structure2) structure2 b
836+ , K1Table "There" Insertion (IsStructure structure2) structure2 b
875 , e ~ TheseTable a b
837 , e ~ TheseTable a b
876− ) => K1Table label 'True Insertion 'True (Shape2 'These structure1 structure2) e
838+ ) => K1Table label Insertion 'True (Shape2 'These structure1 structure2) e
877 where
839 where
878 fromK1Columns =
840 fromK1Columns =
879 fromColumns2
841 fromColumns2
880− (fromK1Columns @"Here" @_ @_ @_ @structure1)
842+ (fromK1Columns @"Here" @_ @_ @structure1)
881− (fromK1Columns @"There" @_ @_ @_ @structure2) .
843+ (fromK1Columns @"There" @_ @_ @structure2) .
882 hunlabel unlabeler
844 hunlabel unlabeler
883 toK1Columns =
845 toK1Columns =
884 hlabel labeler .
846 hlabel labeler .
885 toColumns2
847 toColumns2
886− (toK1Columns @"Here" @_ @_ @_ @structure1)
848+ (toK1Columns @"Here" @_ @_ @structure1)
887− (toK1Columns @"There" @_ @_ @_ @structure2)
849+ (toK1Columns @"There" @_ @_ @structure2)
888 {-# INLINABLE fromK1Columns #-}
850 {-# INLINABLE fromK1Columns #-}
889 {-# INLINABLE toK1Columns #-}
851 {-# INLINABLE toK1Columns #-}
890
852
@@ -892,23 +854,23 @@ instance
892instance
854instance
893 ( HTable (K1Columns "Here" structure1)
855 ( HTable (K1Columns "Here" structure1)
894 , HTable (K1Columns "There" structure2)
856 , HTable (K1Columns "There" structure2)
895− , K1Table "Here" 'True Identity (IsStructure structure1) structure1 a
857+ , K1Table "Here" Identity (IsStructure structure1) structure1 a
896− , K1Table "There" 'True Identity (IsStructure structure2) structure2 b
858+ , K1Table "There" Identity (IsStructure structure2) structure2 b
897 , e ~ These a b
859 , e ~ These a b
898− ) => K1Table label 'True Identity 'True (Shape2 'These structure1 structure2) e
860+ ) => K1Table label Identity 'True (Shape2 'These structure1 structure2) e
899 where
861 where
900 fromK1Columns
862 fromK1Columns
901 = bimap
863 = bimap
902− (fromK1Columns @"Here" @_ @_ @_ @structure1)
864+ (fromK1Columns @"Here" @_ @_ @structure1)
903− (fromK1Columns @"There" @_ @_ @_ @structure2)
865+ (fromK1Columns @"There" @_ @_ @structure2)
904 . fromHTheseTable
866 . fromHTheseTable
905 . hunlabel unlabeler
867 . hunlabel unlabeler
906 toK1Columns
868 toK1Columns
907 = hlabel labeler
869 = hlabel labeler
908 . toHTheseTable
870 . toHTheseTable
909 . bimap
871 . bimap
910− (toK1Columns @"Here" @_ @_ @_ @structure1)
872+ (toK1Columns @"Here" @_ @_ @structure1)
911− (toK1Columns @"There" @_ @_ @_ @structure2)
873+ (toK1Columns @"There" @_ @_ @structure2)
912 {-# INLINABLE fromK1Columns #-}
874 {-# INLINABLE fromK1Columns #-}
913 {-# INLINABLE toK1Columns #-}
875 {-# INLINABLE toK1Columns #-}
914
876
@@ -916,110 +878,106 @@ instance
916instance
878instance
917 ( HTable (K1Columns "Here" structure1)
879 ( HTable (K1Columns "Here" structure1)
918 , HTable (K1Columns "There" structure2)
880 , HTable (K1Columns "There" structure2)
919− , K1Table "Here" 'False context (IsStructure structure1) structure1 a
881+ , K1Table "Here" Name (IsStructure structure1) structure1 a
920− , K1Table "There" 'False context (IsStructure structure2) structure2 b
882+ , K1Table "There" Name (IsStructure structure2) structure2 b
921− , IsSpecialContext context ~ 'False
922− , Labelable context
923− , Nullifiable context
924 , e ~ TheseTable a b
883 , e ~ TheseTable a b
925− ) => K1Table label 'False context 'True (Shape2 'These structure1 structure2) e
884+ ) => K1Table label Name 'True (Shape2 'These structure1 structure2) e
926 where
885 where
927 fromK1Columns =
886 fromK1Columns =
928 fromColumns2
887 fromColumns2
929− (fromK1Columns @"Here" @_ @_ @_ @structure1)
888+ (fromK1Columns @"Here" @_ @_ @structure1)
930− (fromK1Columns @"There" @_ @_ @_ @structure2) .
889+ (fromK1Columns @"There" @_ @_ @structure2) .
931 hunlabel unlabeler
890 hunlabel unlabeler
932 toK1Columns =
891 toK1Columns =
933 hlabel labeler .
892 hlabel labeler .
934 toColumns2
893 toColumns2
935− (toK1Columns @"Here" @_ @_ @_ @structure1)
894+ (toK1Columns @"Here" @_ @_ @structure1)
936− (toK1Columns @"There" @_ @_ @_ @structure2)
895+ (toK1Columns @"There" @_ @_ @structure2)
937 {-# INLINABLE fromK1Columns #-}
896 {-# INLINABLE fromK1Columns #-}
938 {-# INLINABLE toK1Columns #-}
897 {-# INLINABLE toK1Columns #-}
939
898
940
899
941−
942instance
900instance
943− ( K1Table "fst" isSpecialContext context (IsStructure structure1) structure1 a1
901+ ( K1Table "fst" context (IsStructure structure1) structure1 a1
944− , K1Table "snd" isSpecialContext context (IsStructure structure2) structure2 a2
902+ , K1Table "snd" context (IsStructure structure2) structure2 a2
945 , HTable (K1Columns "fst" structure1)
903 , HTable (K1Columns "fst" structure1)
946 , HTable (K1Columns "snd" structure2)
904 , HTable (K1Columns "snd" structure2)
947 , Labelable context
905 , Labelable context
948 , a ~ (a1, a2)
906 , a ~ (a1, a2)
949− ) => K1Table label isSpecialContext context 'True (structure1, structure2) a
907+ ) => K1Table label context 'True (structure1, structure2) a
950 where
908 where
951 fromK1Columns (hunlabel unlabeler -> (HPair a b)) =
909 fromK1Columns (hunlabel unlabeler -> (HPair a b)) =
952− ( fromK1Columns @"fst" @_ @_ @_ @structure1 a
910+ ( fromK1Columns @"fst" @_ @_ @structure1 a
953− , fromK1Columns @"snd" @_ @_ @_ @structure2 b
911+ , fromK1Columns @"snd" @_ @_ @structure2 b
954 )
912 )
955 toK1Columns (a, b) = hlabel labeler $ HPair
913 toK1Columns (a, b) = hlabel labeler $ HPair
956− { hfst = toK1Columns @"fst" @_ @_ @_ @structure1 a
914+ { hfst = toK1Columns @"fst" @_ @_ @structure1 a
957− , hsnd = toK1Columns @"snd" @_ @_ @_ @structure2 b
915+ , hsnd = toK1Columns @"snd" @_ @_ @structure2 b
958 }
916 }
959 {-# INLINABLE fromK1Columns #-}
917 {-# INLINABLE fromK1Columns #-}
960 {-# INLINABLE toK1Columns #-}
918 {-# INLINABLE toK1Columns #-}
961
919
962
920
963instance
921instance
964− ( K1Table "fst" isSpecialContext context (IsStructure structure1) structure1 a1
922+ ( K1Table "fst" context (IsStructure structure1) structure1 a1
965− , K1Table "snd" isSpecialContext context (IsStructure structure2) structure2 a2
923+ , K1Table "snd" context (IsStructure structure2) structure2 a2
966− , K1Table "trd" isSpecialContext context (IsStructure structure3) structure3 a3
924+ , K1Table "trd" context (IsStructure structure3) structure3 a3
967 , HTable (K1Columns "fst" structure1)
925 , HTable (K1Columns "fst" structure1)
968 , HTable (K1Columns "snd" structure2)
926 , HTable (K1Columns "snd" structure2)
969 , HTable (K1Columns "trd" structure3)
927 , HTable (K1Columns "trd" structure3)
970 , Labelable context
928 , Labelable context
971 , a ~ (a1, a2, a3)
929 , a ~ (a1, a2, a3)
972− ) => K1Table label isSpecialContext context 'True (structure1, structure2, structure3) a
930+ ) => K1Table label context 'True (structure1, structure2, structure3) a
973 where
931 where
974 fromK1Columns (hunlabel unlabeler -> (HTrio a b c)) =
932 fromK1Columns (hunlabel unlabeler -> (HTrio a b c)) =
975− ( fromK1Columns @"fst" @_ @_ @_ @structure1 a
933+ ( fromK1Columns @"fst" @_ @_ @structure1 a
976− , fromK1Columns @"snd" @_ @_ @_ @structure2 b
934+ , fromK1Columns @"snd" @_ @_ @structure2 b
977− , fromK1Columns @"trd" @_ @_ @_ @structure3 c
935+ , fromK1Columns @"trd" @_ @_ @structure3 c
978 )
936 )
979 toK1Columns (a, b, c) = hlabel labeler $ HTrio
937 toK1Columns (a, b, c) = hlabel labeler $ HTrio
980− { hfst = toK1Columns @"fst" @_ @_ @_ @structure1 a
938+ { hfst = toK1Columns @"fst" @_ @_ @structure1 a
981− , hsnd = toK1Columns @"snd" @_ @_ @_ @structure2 b
939+ , hsnd = toK1Columns @"snd" @_ @_ @structure2 b
982− , htrd = toK1Columns @"trd" @_ @_ @_ @structure3 c
940+ , htrd = toK1Columns @"trd" @_ @_ @structure3 c
983 }
941 }
984 {-# INLINABLE fromK1Columns #-}
942 {-# INLINABLE fromK1Columns #-}
985 {-# INLINABLE toK1Columns #-}
943 {-# INLINABLE toK1Columns #-}
986
944
987
945
988instance
946instance
989− ( K1Table "fst" isSpecialContext context (IsStructure structure1) structure1 a1
947+ ( K1Table "fst" context (IsStructure structure1) structure1 a1
990− , K1Table "snd" isSpecialContext context (IsStructure structure2) structure2 a2
948+ , K1Table "snd" context (IsStructure structure2) structure2 a2
991− , K1Table "trd" isSpecialContext context (IsStructure structure3) structure3 a3
949+ , K1Table "trd" context (IsStructure structure3) structure3 a3
992− , K1Table "frt" isSpecialContext context (IsStructure structure3) structure4 a4
950+ , K1Table "frt" context (IsStructure structure3) structure4 a4
993 , HTable (K1Columns "fst" structure1)
951 , HTable (K1Columns "fst" structure1)
994 , HTable (K1Columns "snd" structure2)
952 , HTable (K1Columns "snd" structure2)
995 , HTable (K1Columns "trd" structure3)
953 , HTable (K1Columns "trd" structure3)
996 , HTable (K1Columns "frt" structure4)
954 , HTable (K1Columns "frt" structure4)
997 , Labelable context
955 , Labelable context
998 , a ~ (a1, a2, a3, a4)
956 , a ~ (a1, a2, a3, a4)
999− ) => K1Table label isSpecialContext context 'True (structure1, structure2, structure3, structure4) a
957+ ) => K1Table label context 'True (structure1, structure2, structure3, structure4) a
1000 where
958 where
1001 fromK1Columns (hunlabel unlabeler -> (HQuartet a b c d)) =
959 fromK1Columns (hunlabel unlabeler -> (HQuartet a b c d)) =
1002− ( fromK1Columns @"fst" @_ @_ @_ @structure1 a
960+ ( fromK1Columns @"fst" @_ @_ @structure1 a
1003− , fromK1Columns @"snd" @_ @_ @_ @structure2 b
961+ , fromK1Columns @"snd" @_ @_ @structure2 b
1004− , fromK1Columns @"trd" @_ @_ @_ @structure3 c
962+ , fromK1Columns @"trd" @_ @_ @structure3 c
1005− , fromK1Columns @"frt" @_ @_ @_ @structure4 d
963+ , fromK1Columns @"frt" @_ @_ @structure4 d
1006 )
964 )
1007 toK1Columns (a, b, c, d) = hlabel labeler $ HQuartet
965 toK1Columns (a, b, c, d) = hlabel labeler $ HQuartet
1008− { hfst = toK1Columns @"fst" @_ @_ @_ @structure1 a
966+ { hfst = toK1Columns @"fst" @_ @_ @structure1 a
1009− , hsnd = toK1Columns @"snd" @_ @_ @_ @structure2 b
967+ , hsnd = toK1Columns @"snd" @_ @_ @structure2 b
1010− , htrd = toK1Columns @"trd" @_ @_ @_ @structure3 c
968+ , htrd = toK1Columns @"trd" @_ @_ @structure3 c
1011− , hfrt = toK1Columns @"frt" @_ @_ @_ @structure4 d
969+ , hfrt = toK1Columns @"frt" @_ @_ @structure4 d
1012 }
970 }
1013 {-# INLINABLE fromK1Columns #-}
971 {-# INLINABLE fromK1Columns #-}
1014 {-# INLINABLE toK1Columns #-}
972 {-# INLINABLE toK1Columns #-}
1015
973
1016
974
1017instance
975instance
1018− ( K1Table "fst" isSpecialContext context (IsStructure structure1) structure1 a1
976+ ( K1Table "fst" context (IsStructure structure1) structure1 a1
1019− , K1Table "snd" isSpecialContext context (IsStructure structure2) structure2 a2
977+ , K1Table "snd" context (IsStructure structure2) structure2 a2
1020− , K1Table "trd" isSpecialContext context (IsStructure structure3) structure3 a3
978+ , K1Table "trd" context (IsStructure structure3) structure3 a3
1021− , K1Table "frt" isSpecialContext context (IsStructure structure3) structure4 a4
979+ , K1Table "frt" context (IsStructure structure3) structure4 a4
1022− , K1Table "fft" isSpecialContext context (IsStructure structure3) structure5 a5
980+ , K1Table "fft" context (IsStructure structure3) structure5 a5
1023 , HTable (K1Columns "fst" structure1)
981 , HTable (K1Columns "fst" structure1)
1024 , HTable (K1Columns "snd" structure2)
982 , HTable (K1Columns "snd" structure2)
1025 , HTable (K1Columns "trd" structure3)
983 , HTable (K1Columns "trd" structure3)
@@ -1027,34 +985,33 @@ instance
1027 , HTable (K1Columns "fft" structure5)
985 , HTable (K1Columns "fft" structure5)
1028 , Labelable context
986 , Labelable context
1029 , a ~ (a1, a2, a3, a4, a5)
987 , a ~ (a1, a2, a3, a4, a5)
1030− ) => K1Table label isSpecialContext context 'True (structure1, structure2, structure3, structure4, structure5) a
988+ ) => K1Table label context 'True (structure1, structure2, structure3, structure4, structure5) a
1031 where
989 where
1032 fromK1Columns (hunlabel unlabeler -> (HQuintet a b c d e)) =
990 fromK1Columns (hunlabel unlabeler -> (HQuintet a b c d e)) =
1033− ( fromK1Columns @"fst" @_ @_ @_ @structure1 a
991+ ( fromK1Columns @"fst" @_ @_ @structure1 a
1034− , fromK1Columns @"snd" @_ @_ @_ @structure2 b
992+ , fromK1Columns @"snd" @_ @_ @structure2 b
1035− , fromK1Columns @"trd" @_ @_ @_ @structure3 c
993+ , fromK1Columns @"trd" @_ @_ @structure3 c
1036− , fromK1Columns @"frt" @_ @_ @_ @structure4 d
994+ , fromK1Columns @"frt" @_ @_ @structure4 d
1037− , fromK1Columns @"fft" @_ @_ @_ @structure5 e
995+ , fromK1Columns @"fft" @_ @_ @structure5 e
1038 )
996 )
1039 toK1Columns (a, b, c, d, e) = hlabel labeler $ HQuintet
997 toK1Columns (a, b, c, d, e) = hlabel labeler $ HQuintet
1040− { hfst = toK1Columns @"fst" @_ @_ @_ @structure1 a
998+ { hfst = toK1Columns @"fst" @_ @_ @structure1 a
1041− , hsnd = toK1Columns @"snd" @_ @_ @_ @structure2 b
999+ , hsnd = toK1Columns @"snd" @_ @_ @structure2 b
1042− , htrd = toK1Columns @"trd" @_ @_ @_ @structure3 c
1000+ , htrd = toK1Columns @"trd" @_ @_ @structure3 c
1043− , hfrt = toK1Columns @"frt" @_ @_ @_ @structure4 d
1001+ , hfrt = toK1Columns @"frt" @_ @_ @structure4 d
1044− , hfft = toK1Columns @"fft" @_ @_ @_ @structure5 e
1002+ , hfft = toK1Columns @"fft" @_ @_ @structure5 e
1045 }
1003 }
1046 {-# INLINABLE fromK1Columns #-}
1004 {-# INLINABLE fromK1Columns #-}
1047 {-# INLINABLE toK1Columns #-}
1005 {-# INLINABLE toK1Columns #-}
1048
1006
1049
1007
1050instance
1008instance
1051− ( IsSpecialContext context ~ isSpecialContext
1052− , IsStructure structure ~ 'False
1009+ ( IsStructure structure ~ 'False
1053 , K1Columns label structure ~ HLabel label (Columns structure)
1010 , K1Columns label structure ~ HLabel label (Columns structure)
1054 , Columns structure ~ Columns a
1011 , Columns structure ~ Columns a
1055 , Labelable context
1012 , Labelable context
1056 , Table context a
1013 , Table context a
1057− ) => K1Table label isSpecialContext context 'False structure a
1014+ ) => K1Table label context 'False structure a
1058 where
1015 where
1059 fromK1Columns = fromColumns . hunlabel unlabeler
1016 fromK1Columns = fromColumns . hunlabel unlabeler
1060 toK1Columns = hlabel labeler . toColumns
1017 toK1Columns = hlabel labeler . toColumns
src/Rel8/Table.hs+9−15
@@ -23,9 +23,7 @@ import Prelude
23import Rel8.Aggregate ( Aggregate )
23import Rel8.Aggregate ( Aggregate )
24import Rel8.Expr ( Expr )
24import Rel8.Expr ( Expr )
25import Rel8.Opaque ( Opaque, Opaque1 )
25import Rel8.Opaque ( Opaque, Opaque1 )
26−import Rel8.Schema.Context
26+import Rel8.Schema.Context ( Col(..), Insertion(..), Name(..) )
27− ( Col, Col'(..), Insertion(..), Name, IsSpecialContext
28− )
29import Rel8.Schema.Context.Label ( Labelable, labeler, unlabeler )
27import Rel8.Schema.Context.Label ( Labelable, labeler, unlabeler )
30import Rel8.Schema.HTable ( HTable, hfield, hspecs, htabulate, htabulateA )
28import Rel8.Schema.HTable ( HTable, hfield, hspecs, htabulate, htabulateA )
31import Rel8.Schema.HTable.Identity ( HIdentity(..) )
29import Rel8.Schema.HTable.Identity ( HIdentity(..) )
@@ -63,22 +61,18 @@ class (HTable (Columns a), context ~ Context a) => Table context a | a -> contex
63
61
64
62
65-- | Any 'HTable' is also a 'Table'.
63-- | Any 'HTable' is also a 'Table'.
66−instance (HTable t, x ~ IsSpecialContext context) =>
67− Table context (t (Col' x context))
64+instance HTable t => Table context (t (Col context)) where
68− where
69− type Columns (t (Col' x context)) = t
65+ type Columns (t (Col context)) = t
70− type Context (t (Col' x context)) = context
66+ type Context (t (Col context)) = context
71
67
72 toColumns = id
68 toColumns = id
73 fromColumns = id
69 fromColumns = id
74
70
75
71
76-- | Any context is trivially a table.
72-- | Any context is trivially a table.
77−instance (KnownSpec spec, x ~ IsSpecialContext context) =>
78− Table context (Col' x context spec)
73+instance KnownSpec spec => Table context (Col context spec) where
79− where
80− type Columns (Col' x context spec) = HIdentity spec
74+ type Columns (Col context spec) = HIdentity spec
81− type Context (Col' x context spec) = context
75+ type Context (Col context spec) = context
82
76
83 toColumns = HIdentity
77 toColumns = HIdentity
84 fromColumns = unHIdentity
78 fromColumns = unHIdentity
@@ -123,8 +117,8 @@ instance Sql DBType a => Table Name (Name a) where
123 type Columns (Name a) = HType a
117 type Columns (Name a) = HType a
124 type Context (Name a) = Name
118 type Context (Name a) = Name
125
119
126− toColumns a = HType (Col a)
120+ toColumns (Name a) = HType (NameCol a)
127− fromColumns (HType (Col a)) = a
121+ fromColumns (HType (NameCol a)) = Name a
128
122
129
123
130instance
124instance
src/Rel8/Table/Aggregate.hs+1−1
@@ -21,7 +21,7 @@ import Prelude
21import Rel8.Aggregate ( Aggregate )
21import Rel8.Aggregate ( Aggregate )
22import Rel8.Expr ( Expr )
22import Rel8.Expr ( Expr )
23import Rel8.Expr.Aggregate ( listAggExpr, nonEmptyAggExpr, sgroupByExpr )
23import Rel8.Expr.Aggregate ( listAggExpr, nonEmptyAggExpr, sgroupByExpr )
24−import Rel8.Schema.Context ( Col'(..) )
24+import Rel8.Schema.Context ( Col(..) )
25import Rel8.Schema.Dict ( Dict( Dict ) )
25import Rel8.Schema.Dict ( Dict( Dict ) )
26import Rel8.Schema.HTable ( htabulate, hfield, hdicts, hspecs )
26import Rel8.Schema.HTable ( htabulate, hfield, hdicts, hspecs )
27import Rel8.Schema.HTable.Vectorize ( hvectorize )
27import Rel8.Schema.HTable.Vectorize ( hvectorize )
src/Rel8/Table/Bool.hs+1−1
@@ -14,7 +14,7 @@ import Prelude
14-- rel8
14-- rel8
15import Rel8.Expr ( Expr )
15import Rel8.Expr ( Expr )
16import Rel8.Expr.Bool ( boolExpr, caseExpr )
16import Rel8.Expr.Bool ( boolExpr, caseExpr )
17−import Rel8.Schema.Context ( Col'(..) )
17+import Rel8.Schema.Context ( Col(..) )
18import Rel8.Schema.HTable ( htabulate, hfield )
18import Rel8.Schema.HTable ( htabulate, hfield )
19import Rel8.Table ( Table, fromColumns, toColumns )
19import Rel8.Table ( Table, fromColumns, toColumns )
20
20
src/Rel8/Table/Eq.hs+1−1
@@ -27,7 +27,7 @@ import Rel8.Expr ( Expr )
27import Rel8.Expr.Bool ( (||.), (&&.) )
27import Rel8.Expr.Bool ( (||.), (&&.) )
28import Rel8.Expr.Eq ( seq, sne )
28import Rel8.Expr.Eq ( seq, sne )
29import Rel8.Opaque ( Opaque )
29import Rel8.Opaque ( Opaque )
30−import Rel8.Schema.Context ( Col'(..) )
30+import Rel8.Schema.Context ( Col(..) )
31import Rel8.Schema.Dict ( Dict( Dict ) )
31import Rel8.Schema.Dict ( Dict( Dict ) )
32import Rel8.Schema.HTable
32import Rel8.Schema.HTable
33 ( HConstrainTable
33 ( HConstrainTable
src/Rel8/Table/Insert.hs+1−1
@@ -14,7 +14,7 @@ import Prelude
14
14
15-- rel8
15-- rel8
16import Rel8.Kind.Necessity ( SNecessity( SOptional, SRequired ) )
16import Rel8.Kind.Necessity ( SNecessity( SOptional, SRequired ) )
17−import Rel8.Schema.Context ( Col'(..) )
17+import Rel8.Schema.Context ( Col(..) )
18import Rel8.Schema.HTable ( hfield, htabulate, hspecs )
18import Rel8.Schema.HTable ( hfield, htabulate, hspecs )
19import Rel8.Schema.Spec ( SSpec(..) )
19import Rel8.Schema.Spec ( SSpec(..) )
20import Rel8.Table ( fromColumns, toColumns )
20import Rel8.Table ( fromColumns, toColumns )
src/Rel8/Table/List.hs+1−1
@@ -17,7 +17,7 @@ import Prelude
17-- rel8
17-- rel8
18import Rel8.Expr ( Expr )
18import Rel8.Expr ( Expr )
19import Rel8.Expr.Array ( sappend, sempty )
19import Rel8.Expr.Array ( sappend, sempty )
20−import Rel8.Schema.Context ( Col, Col'(..) )
20+import Rel8.Schema.Context ( Col(..) )
21import Rel8.Schema.HTable.List ( HListTable )
21import Rel8.Schema.HTable.List ( HListTable )
22import Rel8.Schema.HTable.Vectorize ( happend, hempty )
22import Rel8.Schema.HTable.Vectorize ( happend, hempty )
23import Rel8.Table ( Table, Context, Columns, fromColumns, toColumns )
23import Rel8.Table ( Table, Context, Columns, fromColumns, toColumns )
src/Rel8/Table/Name.hs+4−4
@@ -26,7 +26,7 @@ import Text.Casing ( quietSnake )
26-- rel8
26-- rel8
27import Rel8.Expr ( Expr )
27import Rel8.Expr ( Expr )
28import Rel8.Kind.Labels ( renderLabels )
28import Rel8.Kind.Labels ( renderLabels )
29−import Rel8.Schema.Context ( Col'(..), Name( Name ) )
29+import Rel8.Schema.Context ( Col(..), Name )
30import Rel8.Schema.HTable ( htabulate, htabulateA, hfield, hspecs )
30import Rel8.Schema.HTable ( htabulate, htabulateA, hfield, hspecs )
31import Rel8.Schema.Spec ( SSpec(..) )
31import Rel8.Schema.Spec ( SSpec(..) )
32import Rel8.Table ( Table, Columns, Context, fromColumns, toColumns )
32import Rel8.Table ( Table, Columns, Context, fromColumns, toColumns )
@@ -42,14 +42,14 @@ namesFromLabelsWith :: Table Name a
42 => (NonEmpty String -> String) -> a
42 => (NonEmpty String -> String) -> a
43namesFromLabelsWith f = fromColumns $ htabulate $ \field ->
43namesFromLabelsWith f = fromColumns $ htabulate $ \field ->
44 case hfield hspecs field of
44 case hfield hspecs field of
45− SSpec {labels} -> Col (Name (f (renderLabels labels)))
45+ SSpec {labels} -> NameCol (f (renderLabels labels))
46
46
47
47
48showExprs :: Table Expr a => a -> [(String, String)]
48showExprs :: Table Expr a => a -> [(String, String)]
49showExprs as = case (namesFromLabels, toColumns as) of
49showExprs as = case (namesFromLabels, toColumns as) of
50 (names, exprs) -> getConst $ htabulateA $ \field ->
50 (names, exprs) -> getConst $ htabulateA $ \field ->
51 case (hfield names field, hfield exprs field) of
51 case (hfield names field, hfield exprs field) of
52− (Col (Name name), DB expr) -> Const [(name, show expr)]
52+ (NameCol name, DB expr) -> Const [(name, show expr)]
53
53
54
54
55showLabels :: forall a. Table (Context a) a => a -> [NonEmpty String]
55showLabels :: forall a. Table (Context a) a => a -> [NonEmpty String]
@@ -61,4 +61,4 @@ showLabels _ = getConst $
61showNames :: forall a. Table Name a => a -> [String]
61showNames :: forall a. Table Name a => a -> [String]
62showNames (toColumns -> names) = getConst $
62showNames (toColumns -> names) = getConst $
63 htabulateA @(Columns a) $ \field -> case hfield names field of
63 htabulateA @(Columns a) $ \field -> case hfield names field of
64− Col (Name name) -> Const [name]
64+ NameCol name -> Const [name]
src/Rel8/Table/NonEmpty.hs+1−1
@@ -17,7 +17,7 @@ import Prelude
17-- rel8
17-- rel8
18import Rel8.Expr ( Expr )
18import Rel8.Expr ( Expr )
19import Rel8.Expr.Array ( sappend1 )
19import Rel8.Expr.Array ( sappend1 )
20−import Rel8.Schema.Context ( Col, Col'(..) )
20+import Rel8.Schema.Context ( Col(..) )
21import Rel8.Schema.HTable.NonEmpty ( HNonEmptyTable )
21import Rel8.Schema.HTable.NonEmpty ( HNonEmptyTable )
22import Rel8.Schema.HTable.Vectorize ( happend )
22import Rel8.Schema.HTable.Vectorize ( happend )
23import Rel8.Table ( Table, Context, Columns, fromColumns, toColumns )
23import Rel8.Table ( Table, Context, Columns, fromColumns, toColumns )
src/Rel8/Table/Opaleye.hs+2−2
@@ -41,7 +41,7 @@ import Rel8.Expr.Opaleye
41 , fromColumn, toColumn
41 , fromColumn, toColumn
42 )
42 )
43import Rel8.Kind.Necessity ( SNecessity( SRequired, SOptional ) )
43import Rel8.Kind.Necessity ( SNecessity( SRequired, SOptional ) )
44−import Rel8.Schema.Context ( Col, Col'(..), Insertion, Name(..) )
44+import Rel8.Schema.Context ( Col(..), Insertion, Name(..) )
45import Rel8.Schema.HTable ( htabulateA, hfield, htraverse, hspecs )
45import Rel8.Schema.HTable ( htabulateA, hfield, htraverse, hspecs )
46import Rel8.Schema.Spec ( SSpec(..) )
46import Rel8.Schema.Spec ( SSpec(..) )
47import Rel8.Schema.Table ( TableSchema(..) )
47import Rel8.Schema.Table ( TableSchema(..) )
@@ -96,7 +96,7 @@ tableFields (toColumns -> names) = dimap toColumns fromColumns $
96 name -> lmap (`hfield` field) (go specs name)
96 name -> lmap (`hfield` field) (go specs name)
97 where
97 where
98 go :: SSpec spec -> Col Name spec -> Opaleye.TableFields (Col Insertion spec) (Col Expr spec)
98 go :: SSpec spec -> Col Name spec -> Opaleye.TableFields (Col Insertion spec) (Col Expr spec)
99− go SSpec {necessity, info, nullability} (Col (Name name)) =
99+ go SSpec {necessity, info, nullability} (NameCol name) =
100 case necessity of
100 case necessity of
101 SRequired ->
101 SRequired ->
102 lmap (\(RequiredInsert a) -> toColumn $ toPrimExpr a) $
102 lmap (\(RequiredInsert a) -> toColumn $ toPrimExpr a) $
src/Rel8/Table/Ord.hs+1−1
@@ -25,7 +25,7 @@ import Rel8.Expr.Bool ( (||.), (&&.), false, true )
25import Rel8.Expr.Eq ( seq )
25import Rel8.Expr.Eq ( seq )
26import Rel8.Expr.Ord ( slt, sgt)
26import Rel8.Expr.Ord ( slt, sgt)
27import Rel8.Opaque ( Opaque )
27import Rel8.Opaque ( Opaque )
28−import Rel8.Schema.Context ( Col'(..) )
28+import Rel8.Schema.Context ( Col(..) )
29import Rel8.Schema.Dict ( Dict( Dict ) )
29import Rel8.Schema.Dict ( Dict( Dict ) )
30import Rel8.Schema.HTable
30import Rel8.Schema.HTable
31 ( HConstrainTable
31 ( HConstrainTable
src/Rel8/Table/Recontextualize.hs+4−5
@@ -25,7 +25,7 @@ import Prelude ()
25import Rel8.Aggregate ( Aggregate )
25import Rel8.Aggregate ( Aggregate )
26import Rel8.Expr ( Expr )
26import Rel8.Expr ( Expr )
27import Rel8.Opaque ( Opaque, Opaque1 )
27import Rel8.Opaque ( Opaque, Opaque1 )
28−import Rel8.Schema.Context ( Col', Insertion, Name, IsSpecialContext )
28+import Rel8.Schema.Context ( Col(..), Insertion, Name )
29import Rel8.Schema.Context.Label ( Labelable )
29import Rel8.Schema.Context.Label ( Labelable )
30import Rel8.Schema.HTable ( HTable )
30import Rel8.Schema.HTable ( HTable )
31import qualified Rel8.Schema.Kind as K
31import qualified Rel8.Schema.Kind as K
@@ -50,8 +50,8 @@ class
50 , b from -> a
50 , b from -> a
51
51
52
52
53−instance (KnownSpec spec, x ~ IsSpecialContext from, y ~ IsSpecialContext to) =>
53+instance KnownSpec spec =>
54− Recontextualize from to (Col' x from spec) (Col' y to spec)
54+ Recontextualize from to (Col from spec) (Col to spec)
55
55
56
56
57instance Sql DBType a =>
57instance Sql DBType a =>
@@ -143,8 +143,7 @@ instance Sql DBType a => Recontextualize Name Name (Name a) (Name a)
143instance Recontextualize from to (Opaque1 from a) (Opaque1 to a)
143instance Recontextualize from to (Opaque1 from a) (Opaque1 to a)
144
144
145
145
146−instance (HTable t, x ~ IsSpecialContext from, y ~ IsSpecialContext to) =>
147− Recontextualize from to (t (Col' x from)) (t (Col' y to))
146+instance HTable t => Recontextualize from to (t (Col from)) (t (Col to))
148
147
149
148
150instance
149instance
src/Rel8/Table/Serialize.hs+7−7
@@ -31,7 +31,7 @@ import qualified Hasql.Decoders as Hasql
31import Rel8.Expr ( Expr )
31import Rel8.Expr ( Expr )
32import Rel8.Expr.Serialize ( slitExpr, sparseValue )
32import Rel8.Expr.Serialize ( slitExpr, sparseValue )
33import Rel8.Opaque ( Opaque )
33import Rel8.Opaque ( Opaque )
34−import Rel8.Schema.Context ( Col, Col'(..) )
34+import Rel8.Schema.Context ( Col(..) )
35import Rel8.Schema.Context.Identity
35import Rel8.Schema.Context.Identity
36 ( fromHEitherTable, toHEitherTable
36 ( fromHEitherTable, toHEitherTable
37 , fromHListTable, toHListTable
37 , fromHListTable, toHListTable
@@ -77,7 +77,7 @@ type family IsPlainColumn a where
77 IsPlainColumn (_, _, _, _) = 'False
77 IsPlainColumn (_, _, _, _) = 'False
78 IsPlainColumn (_, _, _, _, _) = 'False
78 IsPlainColumn (_, _, _, _, _) = 'False
79 IsPlainColumn (_ Identity) = 'False
79 IsPlainColumn (_ Identity) = 'False
80− IsPlainColumn (_ (Col' _ Identity _)) = 'False
80+ IsPlainColumn (_ (Col Identity _)) = 'False
81 IsPlainColumn (Identity _) = 'False
81 IsPlainColumn (Identity _) = 'False
82 IsPlainColumn _ = 'True
82 IsPlainColumn _ = 'True
83
83
@@ -94,8 +94,8 @@ type family IsTabular a where
94 IsTabular (_, _, _, _) = 'True
94 IsTabular (_, _, _, _) = 'True
95 IsTabular (_, _, _, _, _) = 'True
95 IsTabular (_, _, _, _, _) = 'True
96 IsTabular (_ Identity) = 'True
96 IsTabular (_ Identity) = 'True
97− IsTabular (_ (Col' _ Identity)) = 'True
97+ IsTabular (_ (Col Identity)) = 'True
98− IsTabular (Col' _ Identity _) = 'True
98+ IsTabular (Col Identity _) = 'True
99 IsTabular _ = 'False
99 IsTabular _ = 'False
100
100
101
101
@@ -398,7 +398,7 @@ instance
398 , isTabular ~ 'True
398 , isTabular ~ 'True
399 , isSpecial ~ 'True
399 , isSpecial ~ 'True
400 , x ~ Col Expr spec
400 , x ~ Col Expr spec
401− ) => ExprsFor 'False isTabular (Col' isSpecial Identity spec) x
401+ ) => ExprsFor 'False isTabular (Col Identity spec) x
402 where
402 where
403 fromIdentity = fromColumns
403 fromIdentity = fromColumns
404 toIdentity = toColumns
404 toIdentity = toColumns
@@ -407,7 +407,7 @@ instance
407type FromExprs :: Type -> Type
407type FromExprs :: Type -> Type
408type family FromExprs a where
408type family FromExprs a where
409 FromExprs (Expr a) = a
409 FromExprs (Expr a) = a
410− FromExprs (Col' _ Expr spec) = Col Identity spec
410+ FromExprs (Col Expr spec) = Col Identity spec
411 FromExprs (EitherTable a b) = Either (FromExprs a) (FromExprs b)
411 FromExprs (EitherTable a b) = Either (FromExprs a) (FromExprs b)
412 FromExprs (ListTable a) = [FromExprs a]
412 FromExprs (ListTable a) = [FromExprs a]
413 FromExprs (MaybeTable a) = Maybe (FromExprs a)
413 FromExprs (MaybeTable a) = Maybe (FromExprs a)
@@ -420,7 +420,7 @@ type family FromExprs a where
420 FromExprs (a, b, c, d, e) =
420 FromExprs (a, b, c, d, e) =
421 (FromExprs a, FromExprs b, FromExprs c, FromExprs d, FromExprs e)
421 (FromExprs a, FromExprs b, FromExprs c, FromExprs d, FromExprs e)
422 FromExprs (t Expr) = t Identity
422 FromExprs (t Expr) = t Identity
423− FromExprs (t (Col' _ Expr)) = t (Col Identity)
423+ FromExprs (t (Col Expr)) = t (Col Identity)
424
424
425
425
426-- | @Serializable@ witnesses the one-to-one correspondence between the type
426-- | @Serializable@ witnesses the one-to-one correspondence between the type
src/Rel8/Table/Undefined.hs+1−1
@@ -13,7 +13,7 @@ import Prelude hiding ( undefined )
13-- rel8
13-- rel8
14import Rel8.Expr ( Expr )
14import Rel8.Expr ( Expr )
15import Rel8.Expr.Null ( snull, unsafeUnnullify )
15import Rel8.Expr.Null ( snull, unsafeUnnullify )
16−import Rel8.Schema.Context ( Col'(..) )
16+import Rel8.Schema.Context ( Col(..) )
17import Rel8.Schema.HTable ( htabulate, hfield, hspecs )
17import Rel8.Schema.HTable ( htabulate, hfield, hspecs )
18import Rel8.Schema.Nullability ( Nullability( Nullable, NonNullable ) )
18import Rel8.Schema.Nullability ( Nullability( Nullable, NonNullable ) )
19import Rel8.Schema.Spec ( SSpec(..) )
19import Rel8.Schema.Spec ( SSpec(..) )