on master help sign in
Get rid of IsSpecialContext
commit2d11a08d2d15e4be72c9352860499ef844f042a9 authorShane O'Brien <shane.obrien@circuithub.com> dateWed 24 Mar 2021, 14:37 (6 years ago) parentf88c519
25 files changed+328−424
.direnv/cache-20.09-80qwwqg61b4ps96w+1 .direnv/cache-unknown+1 .direnv/drv+1 .envrc+1 src/Rel8/Query/SQL.hs+2−2 src/Rel8/Schema/Column.hs+43−46 src/Rel8/Schema/Context.hs+20−49 src/Rel8/Schema/Context/Identity.hs+1−1 src/Rel8/Schema/Context/Label.hs+5−12 src/Rel8/Schema/Context/Nullify.hs+4−9 src/Rel8/Schema/Field.hs+9−15 src/Rel8/Schema/Generic.hs+206−249 src/Rel8/Table.hs+9−15 src/Rel8/Table/Aggregate.hs+1−1 src/Rel8/Table/Bool.hs+1−1 src/Rel8/Table/Eq.hs+1−1 src/Rel8/Table/Insert.hs+1−1 src/Rel8/Table/List.hs+1−1 src/Rel8/Table/Name.hs+4−4 src/Rel8/Table/NonEmpty.hs+1−1 src/Rel8/Table/Opaleye.hs+2−2 src/Rel8/Table/Ord.hs+1−1 src/Rel8/Table/Recontextualize.hs+4−5 src/Rel8/Table/Serialize.hs+7−7 src/Rel8/Table/Undefined.hs+1−1
.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 )
2828import Rel8.Query ( Query )
2929import Rel8.Query.Opaleye ( toOpaleye )
3030import qualified Rel8.Query.Optimize as Rel8 ( optimize )
31−import Rel8.Schema.Context ( Col'(..), Name( Name ) )
31+import Rel8.Schema.Context ( Col(..) )
3232import Rel8.Schema.HTable ( htabulateA, hfield )
3333import Rel8.Table ( Table, toColumns )
3434import Rel8.Table.Name ( namesFromLabels )
@@ -69,7 +69,7 @@ selectFrom (toColumns -> names) (toColumns -> exprs) query =
6969 where
7070 select = Opaleye.foldPrimQuery Opaleye.sqlQueryGenerator query
7171 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
7373 DB (toPrimExpr -> expr) -> Const (pure (makeAttr name expr))
7474 makeAttr label expr =
7575 (Opaleye.sqlExpr expr, Just (Opaleye.SqlColumn label))
src/Rel8/Schema/Column.hs+43−46
@@ -20,9 +20,11 @@ import GHC.TypeLits ( Symbol )
2020import Prelude
2121
2222-- rel8
23+import Rel8.Aggregate ( Aggregate )
24+import Rel8.Expr ( Expr )
2325import Rel8.Kind.Labels ( Labels )
2426import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
25−import Rel8.Schema.Context ( IsSpecialContext )
27+import Rel8.Schema.Context ( Name, Insertion )
2628import Rel8.Schema.Field ( Field )
2729import qualified Rel8.Schema.Kind as K
2830import Rel8.Schema.Nullability ( Unnullify )
@@ -112,61 +114,56 @@ type Column context a =
112114 (UnwrapDefault (UnwrapLabel a))
113115
114116
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−
155117type 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
157126
158127
159128type 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 _ = []
161137
162138
163139type 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
165148
166149
167150type 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
169159
170160
171161type 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 @@
11{-# language DataKinds #-}
22{-# language DerivingStrategies #-}
3−{-# language FlexibleContexts #-}
4−{-# language FlexibleInstances #-}
53{-# language GADTs #-}
64{-# language GeneralizedNewtypeDeriving #-}
7−{-# language MultiParamTypeClasses #-}
8−{-# language ScopedTypeVariables #-}
9−{-# language StandaloneDeriving #-}
105{-# language StandaloneKindSignatures #-}
11−{-# language TypeApplications #-}
126{-# language TypeFamilies #-}
13−{-# language UndecidableInstances #-}
147
158module Rel8.Schema.Context
16− ( Col'( .. )
17− , Interpretation, Col
9+ ( Interpretation, Col(..)
1810 , Insertion(..)
1911 , Name(..)
20− , IsSpecialContext
2112 )
2213where
2314
@@ -33,51 +24,41 @@ import Rel8.Expr ( Expr )
3324import Rel8.Kind.Necessity ( Necessity( Optional, Required ) )
3425import qualified Rel8.Schema.Kind as K
3526import Rel8.Schema.Spec ( Spec( Spec ) )
36−import Rel8.Schema.Structure ( Structure )
3727
3828
39−type Interpretation' :: Bool -> K.Context -> Constraint
40−class IsSpecialContext f ~ isSpecial => Interpretation' isSpecial f where
41− data Col' isSpecial f :: K.HContext
29+type Interpretation :: K.Context -> Constraint
30+class Interpretation context where
31+ data Col context :: K.HContext
4232
4333
44−instance Interpretation' 'True Aggregate where
45− data Col' 'True Aggregate _spec where
34+instance Interpretation Aggregate where
35+ data Col Aggregate _spec where
4636 Aggregation :: ()
4737 => Aggregate (Expr a)
48− -> Col' 'True Aggregate ('Spec labels necessity db a)
38+ -> Col Aggregate ('Spec labels necessity db a)
4939
5040
51−instance Interpretation' 'True Expr where
52− data Col' 'True Expr _spec where
41+instance Interpretation Expr where
42+ data Col Expr _spec where
5343 DB :: ()
5444 => { unDB :: Expr a }
55− -> Col' 'True 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−
45+ -> Col Expr ('Spec labels necessity db a)
6246
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)
6747
48+instance Interpretation Identity where
49+ data Col Identity _spec where
50+ Result :: a -> Col Identity ('Spec labels necessity db a)
6851
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)
7252
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)
7757
7858
79−type Col :: K.Context -> K.HContext
80−type Col context = Col' (IsSpecialContext context) context
59+instance Interpretation Name where
60+ data Col Name _spec where
61+ NameCol :: String -> Col Name ('Spec labels necessity db a)
8162
8263
8364type Insertion :: K.Context
@@ -92,13 +73,3 @@ type Name :: K.Context
9273newtype Name a = Name String
9374 deriving stock Show
9475 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 )
1919import Prelude hiding ( null )
2020
2121-- rel8
22−import Rel8.Schema.Context ( Col, Col'( Result ) )
22+import Rel8.Schema.Context ( Col( Result ) )
2323import Rel8.Schema.HTable ( HTable )
2424import Rel8.Schema.HTable.Either ( HEitherTable(..) )
2525import Rel8.Schema.HTable.Identity ( HIdentity(..) )
src/Rel8/Schema/Context/Label.hs+5−12
@@ -20,10 +20,7 @@ import Prelude hiding ( null )
2020-- rel8
2121import Rel8.Aggregate ( Aggregate )
2222import Rel8.Expr ( Expr )
23−import Rel8.Schema.Context
24− ( Interpretation, Col, Col'(..), IsSpecialContext
25− , Insertion
26− )
23+import Rel8.Schema.Context ( Interpretation, Col(..), Insertion, Name )
2724import qualified Rel8.Schema.Kind as K
2825import Rel8.Schema.Spec ( Spec( Spec ) )
2926
@@ -64,11 +61,9 @@ instance Labelable Identity where
6461 unlabeler (Result a) = Result a
6562
6663
67−instance {-# OVERLAPPABLE #-} IsSpecialContext context ~ 'False =>
68− Labelable context
69− where
70− labeler (Col a) = Col a
71− unlabeler (Col a) = Col a
64+instance Labelable Name where
65+ labeler (NameCol a) = NameCol a
66+ unlabeler (NameCol a) = NameCol a
7267
7368
7469type HLabelable :: K.HContext -> Constraint
@@ -82,8 +77,6 @@ class HLabelable context where
8277 -> context ('Spec labels necessity db a)
8378
8479
85−instance (Labelable context, x ~ IsSpecialContext context) =>
86− HLabelable (Col' x context)
87− where
80+instance Labelable context => HLabelable (Col context) where
8881 hlabeler = labeler
8982 hunlabeler = unlabeler
src/Rel8/Schema/Context/Nullify.hs+4−9
@@ -35,12 +35,7 @@ import Rel8.Expr.Null ( nullify, unsafeUnnullify )
3535import Rel8.Expr.Opaleye ( fromPrimExpr, toPrimExpr )
3636import Rel8.Kind.Labels ( KnownLabels, labelsSing, renderLabels )
3737import Rel8.Kind.Necessity ( Necessity( Required ) )
38−import Rel8.Schema.Context
39− ( Interpretation
40− , Col, Col'(..)
41− , Insertion
42− , Name( Name )
43− )
38+import Rel8.Schema.Context ( Interpretation, Col(..), Insertion, Name )
4439import qualified Rel8.Schema.Kind as K
4540import Rel8.Schema.Nullability ( Nullability( Nullable, NonNullable ), Sql )
4641import Rel8.Schema.Spec ( Spec( Spec ), SSpec(..) )
@@ -121,8 +116,8 @@ instance Nullifiable Insertion where
121116instance Nullifiable Name where
122117 encodeTag _ = nameFromLabel
123118 decodeTag _ = mempty
124− nullifier _ _ (Col (Name name)) = Col (Name name)
125− unnullifier _ _ (Col (Name name)) = Col (Name name)
119+ nullifier _ _ (NameCol name) = NameCol name
120+ unnullifier _ _ (NameCol name) = NameCol name
126121
127122 {-# INLINABLE encodeTag #-}
128123 {-# INLINABLE decodeTag #-}
@@ -160,4 +155,4 @@ undoGroupBy = getFirst . foldInputs go
160155nameFromLabel :: forall labels necessity db a.
161156 KnownLabels labels => Col Name ('Spec labels necessity db a)
162157nameFromLabel = 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 @@
11{-# language DataKinds #-}
22{-# language StandaloneKindSignatures #-}
33{-# language TypeFamilies #-}
4−{-# language UndecidableInstances #-}
54
65module Rel8.Schema.Field
76 ( Field
@@ -18,23 +17,18 @@ import Rel8.Aggregate ( Aggregate )
1817import Rel8.Expr ( Expr )
1918import Rel8.Kind.Labels ( Labels )
2019import Rel8.Kind.Necessity ( Necessity( Required, Optional ) )
21−import Rel8.Schema.Context ( Insertion, IsSpecialContext )
20+import Rel8.Schema.Context ( Insertion )
2221import qualified Rel8.Schema.Kind as K
2322import Rel8.Schema.Spec ( Spec( Spec ) )
2423import Rel8.Schema.Structure ( Structure, Shape( Column ), Shape1 )
2524
2625
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−
3826type Field :: K.Context -> Labels -> Necessity -> Type -> Type -> Type
39−type Field context labels necessity db a =
40− IField (IsSpecialContext context) context labels necessity db a
27+type family Field labels context necessity db a where
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
5454 ( Labelable, labeler, unlabeler
5555 , hlabeler, hunlabeler
5656 )
57−import Rel8.Schema.Context.Nullify ( Nullifiable )
5857import Rel8.Schema.Field ( Field )
5958import Rel8.Schema.HTable ( HTable )
6059import Rel8.Schema.HTable.Either ( HEitherTable )
@@ -92,48 +91,42 @@ import Rel8.Table.These ( TheseTable )
9291import Data.These ( These )
9392
9493
95−instance (Rel8able t, TableHelper (IsSpecialContext context) context) =>
96− Table context (t context)
97− where
94+instance (Rel8able t, TableHelper context) => Table context (t context) where
9895 type Columns (t context) = GRep t
9996 type Context (t context) = context
10097 fromColumns = gfromColumns
10198 toColumns = gtoColumns
10299
103100
104−type TableHelper :: Bool -> K.Context -> Constraint
105−class IsSpecialContext context ~ isSpecialContext =>
106− TableHelper isSpecialContext context
107− where
101+type TableHelper :: K.Context -> Constraint
102+class TableHelper context where
108103 gfromColumns :: Rel8able t => GRep t (Col context) -> t context
109104 gtoColumns :: Rel8able t => t context -> GRep t (Col context)
110105
111106
112−instance TableHelper 'True Aggregate where
107+instance TableHelper Aggregate where
113108 gfromColumns = fromAggregateColumns
114109 gtoColumns = toAggregateColumns
115110
116111
117−instance TableHelper 'True Expr where
112+instance TableHelper Expr where
118113 gfromColumns = fromExprColumns
119114 gtoColumns = toExprColumns
120115
121116
122−instance TableHelper 'True Insertion where
117+instance TableHelper Insertion where
123118 gfromColumns = fromInsertionColumns
124119 gtoColumns = toInsertionColumns
125120
126121
127−instance TableHelper 'True Identity where
122+instance TableHelper Identity where
128123 gfromColumns = fromIdentityColumns
129124 gtoColumns = toIdentityColumns
130125
131126
132−instance (IsSpecialContext context ~ 'False, Labelable context, Nullifiable context) =>
133− TableHelper 'False context
134− where
135− gfromColumns = fromUnspecialColumns
136− gtoColumns = toUnspecialColumns
127+instance TableHelper Name where
128+ gfromColumns = fromNameColumns
129+ gtoColumns = toNameColumns
137130
138131
139132-- | This type class allows you to define custom 'Table's using higher-kinded
@@ -194,16 +187,8 @@ class HTable (GRep t) => Rel8able t where
194187 fromIdentityColumns :: GRep t (Col Identity) -> t Identity
195188 toIdentityColumns :: t Identity -> GRep t (Col Identity)
196189
197− fromUnspecialColumns ::
198− ( IsSpecialContext context ~ 'False
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)
190+ fromNameColumns :: GRep t (Col Name) -> t Name
191+ toNameColumns :: t Name -> GRep t (Col Name)
207192
208193 type GRep t = GColumns (Rep (t Structure))
209194
@@ -263,19 +248,19 @@ class HTable (GRep t) => Rel8able t where
263248 ) => t Identity -> GRep t (Col Identity)
264249 toIdentityColumns = toGColumns @_ @(Rep (t Structure)) . from
265250
266− default fromUnspecialColumns ::
267− ( Generic (t context)
251+ default fromNameColumns ::
252+ ( Generic (t Name)
268253 , GColumns (Rep (t Structure)) ~ GRep t
269− , GRel8able context (Rep (t Structure)) (Rep (t context))
270− ) => GRep t (Col context) -> t context
271− fromUnspecialColumns = to . fromGColumns @_ @(Rep (t Structure))
254+ , GRel8able Name (Rep (t Structure)) (Rep (t Name))
255+ ) => GRep t (Col Name) -> t Name
256+ fromNameColumns = to . fromGColumns @_ @(Rep (t Structure))
272257
273− default toUnspecialColumns ::
274− ( Generic (t context)
258+ default toNameColumns ::
259+ ( Generic (t Name)
275260 , GColumns (Rep (t Structure)) ~ GRep t
276− , GRel8able context (Rep (t Structure)) (Rep (t context))
277− ) => t context -> GRep t (Col context)
278− toUnspecialColumns = toGColumns @_ @(Rep (t Structure)) . from
261+ , GRel8able Name (Rep (t Structure)) (Rep (t Name))
262+ ) => t Name -> GRep t (Col Name)
263+ toNameColumns = toGColumns @_ @(Rep (t Structure)) . from
279264
280265
281266type GColumns :: (Type -> Type) -> K.HTable
@@ -316,14 +301,14 @@ instance (GRel8able context structure1 rep1, GRel8able context structure2 rep2)
316301
317302
318303instance
319− ( K1Table label isSpecialContext context isStructure structure a
304+ ( K1Table label context isStructure structure a
320305 , meta ~ 'MetaSel ('Just label) _su _ss _ds
321306 , structureK1 ~ K1 i structure
322307 , k1 ~ K1 i a
323308 ) => GRel8able context (M1 S meta structureK1) (M1 S meta k1)
324309 where
325− fromGColumns = M1 . K1 . fromK1Columns @label @_ @_ @_ @structure
326− toGColumns (M1 (K1 a)) = toK1Columns @label @_ @_ @_ @structure a
310+ fromGColumns = M1 . K1 . fromK1Columns @label @_ @_ @structure
311+ toGColumns (M1 (K1 a)) = toK1Columns @label @_ @_ @structure a
327312
328313
329314type K1Columns :: Symbol -> Type -> K.HTable
@@ -368,11 +353,9 @@ type family K1Columns label structure where
368353 K1Columns label a = HLabel label (Columns a)
369354
370355
371−type K1Table :: Symbol -> Bool -> K.Context -> Bool -> Type -> Type -> Constraint
372−class
373− ( isSpecialContext ~ IsSpecialContext context
374− , isStructure ~ IsStructure structure
375− ) => K1Table label isSpecialContext context isStructure structure a
356+type K1Table :: Symbol -> K.Context -> Bool -> Type -> Type -> Constraint
357+class isStructure ~ IsStructure structure =>
358+ K1Table label context isStructure structure a
376359 where
377360 fromK1Columns :: K1Columns label structure (Col context) -> a
378361 toK1Columns :: a -> K1Columns label structure (Col context)
@@ -380,7 +363,7 @@ class
380363
381364instance
382365 ( 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
384367 where
385368 fromK1Columns (HIdentity (Aggregation a)) = a
386369 toK1Columns = HIdentity . Aggregation
@@ -390,7 +373,7 @@ instance
390373
391374instance
392375 ( 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
394377 where
395378 fromK1Columns (HIdentity (Aggregation a)) = a
396379 toK1Columns = HIdentity . Aggregation
@@ -400,7 +383,7 @@ instance
400383
401384instance
402385 ( 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
404387 where
405388 fromK1Columns (HIdentity (DB a)) = a
406389 toK1Columns = HIdentity . DB
@@ -410,7 +393,7 @@ instance
410393
411394instance
412395 ( 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
414397 where
415398 fromK1Columns (HIdentity (DB a)) = a
416399 toK1Columns = HIdentity . DB
@@ -421,7 +404,7 @@ instance
421404instance
422405 ( x ~ Field Insertion '[] necessity db a
423406 , 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
425408 where
426409 fromK1Columns (HIdentity insert) = case insert of
427410 RequiredInsert a -> a
@@ -436,7 +419,7 @@ instance
436419instance
437420 ( x ~ Field Insertion (label ': labels) necessity db a
438421 , 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
440423 where
441424 fromK1Columns (HIdentity insert) = case insert of
442425 RequiredInsert a -> a
@@ -450,7 +433,7 @@ instance
450433
451434instance
452435 ( 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
454437 where
455438 fromK1Columns (HIdentity (Result a)) = a
456439 toK1Columns = HIdentity . Result
@@ -460,7 +443,7 @@ instance
460443
461444instance
462445 ( 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
464447 where
465448 fromK1Columns (HIdentity (Result a)) = a
466449 toK1Columns = HIdentity . Result
@@ -469,24 +452,21 @@ instance
469452
470453
471454instance
472− ( IsSpecialContext context ~ 'False
473− , x ~ context a
474− ) => K1Table _label 'False context 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
455+ ( x ~ Field Name '[] necessity db a
456+ ) => K1Table _label Name 'True (Shape1 'Column ('Spec (label ': labels) necessity db a)) x
475457 where
476− fromK1Columns (HIdentity (Col a)) = a
477− toK1Columns = HIdentity . Col
458+ fromK1Columns (HIdentity (NameCol a)) = Name a
459+ toK1Columns (Name a) = HIdentity (NameCol a)
478460 {-# INLINABLE fromK1Columns #-}
479461 {-# INLINABLE toK1Columns #-}
480462
481463
482464instance
483− ( IsSpecialContext context ~ 'False
484− , x ~ context a
485− , Labelable context
486− ) => K1Table label 'False context 'True (Shape1 'Column ('Spec '[] necessity db a)) x
465+ ( x ~ Field Name (label ': labels) necessity db a
466+ ) => K1Table label Name 'True (Shape1 'Column ('Spec '[] necessity db a)) x
487467 where
488− fromK1Columns = (\(Col a) -> a) . unlabeler . unHIdentity
489− toK1Columns = HIdentity . labeler . Col
468+ fromK1Columns = Name . (\(NameCol a) -> a) . unlabeler . unHIdentity
469+ toK1Columns = HIdentity . labeler . NameCol . (\(Name a) -> a)
490470 {-# INLINABLE fromK1Columns #-}
491471 {-# INLINABLE toK1Columns #-}
492472
@@ -494,21 +474,21 @@ instance
494474instance
495475 ( HTable (K1Columns "Left" structure1)
496476 , HTable (K1Columns "Right" structure2)
497− , K1Table "Left" 'True Aggregate (IsStructure structure1) structure1 a
498− , K1Table "Right" 'True Aggregate (IsStructure structure2) structure2 b
477+ , K1Table "Left" Aggregate (IsStructure structure1) structure1 a
478+ , K1Table "Right" Aggregate (IsStructure structure2) structure2 b
499479 , 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
501481 where
502482 fromK1Columns =
503483 fromColumns2
504− (fromK1Columns @"Left" @_ @_ @_ @structure1)
505− (fromK1Columns @"Right" @_ @_ @_ @structure2) .
484+ (fromK1Columns @"Left" @_ @_ @structure1)
485+ (fromK1Columns @"Right" @_ @_ @structure2) .
506486 hunlabel unlabeler
507487 toK1Columns =
508488 hlabel labeler .
509489 toColumns2
510− (toK1Columns @"Left" @_ @_ @_ @structure1)
511− (toK1Columns @"Right" @_ @_ @_ @structure2)
490+ (toK1Columns @"Left" @_ @_ @structure1)
491+ (toK1Columns @"Right" @_ @_ @structure2)
512492 {-# INLINABLE fromK1Columns #-}
513493 {-# INLINABLE toK1Columns #-}
514494
@@ -516,21 +496,21 @@ instance
516496instance
517497 ( HTable (K1Columns "Left" structure1)
518498 , HTable (K1Columns "Right" structure2)
519− , K1Table "Left" 'True Expr (IsStructure structure1) structure1 a
520− , K1Table "Right" 'True Expr (IsStructure structure2) structure2 b
499+ , K1Table "Left" Expr (IsStructure structure1) structure1 a
500+ , K1Table "Right" Expr (IsStructure structure2) structure2 b
521501 , 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
523503 where
524504 fromK1Columns =
525505 fromColumns2
526− (fromK1Columns @"Left" @_ @_ @_ @structure1)
527− (fromK1Columns @"Right" @_ @_ @_ @structure2) .
506+ (fromK1Columns @"Left" @_ @_ @structure1)
507+ (fromK1Columns @"Right" @_ @_ @structure2) .
528508 hunlabel unlabeler
529509 toK1Columns =
530510 hlabel labeler .
531511 toColumns2
532− (toK1Columns @"Left" @_ @_ @_ @structure1)
533− (toK1Columns @"Right" @_ @_ @_ @structure2)
512+ (toK1Columns @"Left" @_ @_ @structure1)
513+ (toK1Columns @"Right" @_ @_ @structure2)
534514 {-# INLINABLE fromK1Columns #-}
535515 {-# INLINABLE toK1Columns #-}
536516
@@ -538,21 +518,21 @@ instance
538518instance
539519 ( HTable (K1Columns "Left" structure1)
540520 , HTable (K1Columns "Right" structure2)
541− , K1Table "Left" 'True Insertion (IsStructure structure1) structure1 a
542− , K1Table "Right" 'True Insertion (IsStructure structure2) structure2 b
521+ , K1Table "Left" Insertion (IsStructure structure1) structure1 a
522+ , K1Table "Right" Insertion (IsStructure structure2) structure2 b
543523 , 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
545525 where
546526 fromK1Columns =
547527 fromColumns2
548− (fromK1Columns @"Left" @_ @_ @_ @structure1)
549− (fromK1Columns @"Right" @_ @_ @_ @structure2) .
528+ (fromK1Columns @"Left" @_ @_ @structure1)
529+ (fromK1Columns @"Right" @_ @_ @structure2) .
550530 hunlabel unlabeler
551531 toK1Columns =
552532 hlabel labeler .
553533 toColumns2
554− (toK1Columns @"Left" @_ @_ @_ @structure1)
555− (toK1Columns @"Right" @_ @_ @_ @structure2)
534+ (toK1Columns @"Left" @_ @_ @structure1)
535+ (toK1Columns @"Right" @_ @_ @structure2)
556536 {-# INLINABLE fromK1Columns #-}
557537 {-# INLINABLE toK1Columns #-}
558538
@@ -560,23 +540,23 @@ instance
560540instance
561541 ( HTable (K1Columns "Left" structure1)
562542 , HTable (K1Columns "Right" structure2)
563− , K1Table "Left" 'True Identity (IsStructure structure1) structure1 a
564− , K1Table "Right" 'True Identity (IsStructure structure2) structure2 b
543+ , K1Table "Left" Identity (IsStructure structure1) structure1 a
544+ , K1Table "Right" Identity (IsStructure structure2) structure2 b
565545 , 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
567547 where
568548 fromK1Columns
569549 = bimap
570− (fromK1Columns @"Left" @_ @_ @_ @structure1)
571− (fromK1Columns @"Right" @_ @_ @_ @structure2)
550+ (fromK1Columns @"Left" @_ @_ @structure1)
551+ (fromK1Columns @"Right" @_ @_ @structure2)
572552 . fromHEitherTable
573553 . hunlabel unlabeler
574554 toK1Columns
575555 = hlabel labeler
576556 . toHEitherTable
577557 . bimap
578− (toK1Columns @"Left" @_ @_ @_ @structure1)
579− (toK1Columns @"Right" @_ @_ @_ @structure2)
558+ (toK1Columns @"Left" @_ @_ @structure1)
559+ (toK1Columns @"Right" @_ @_ @structure2)
580560 {-# INLINABLE fromK1Columns #-}
581561 {-# INLINABLE toK1Columns #-}
582562
@@ -584,34 +564,30 @@ instance
584564instance
585565 ( HTable (K1Columns "Left" structure1)
586566 , HTable (K1Columns "Right" structure2)
587− , K1Table "Left" 'False context (IsStructure structure1) structure1 a
588− , K1Table "Right" 'False context (IsStructure structure2) structure2 b
589− , IsSpecialContext context ~ 'False
590− , Labelable context
591− , Nullifiable context
567+ , K1Table "Left" Name (IsStructure structure1) structure1 a
568+ , K1Table "Right" Name (IsStructure structure2) structure2 b
592569 , 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
594571 where
595572 fromK1Columns =
596573 fromColumns2
597− (fromK1Columns @"Left" @_ @_ @_ @structure1)
598− (fromK1Columns @"Right" @_ @_ @_ @structure2) .
574+ (fromK1Columns @"Left" @_ @_ @structure1)
575+ (fromK1Columns @"Right" @_ @_ @structure2) .
599576 hunlabel unlabeler
600577 toK1Columns =
601578 hlabel labeler .
602579 toColumns2
603− (toK1Columns @"Left" @_ @_ @_ @structure1)
604− (toK1Columns @"Right" @_ @_ @_ @structure2)
580+ (toK1Columns @"Left" @_ @_ @structure1)
581+ (toK1Columns @"Right" @_ @_ @structure2)
605582 {-# INLINABLE fromK1Columns #-}
606583 {-# INLINABLE toK1Columns #-}
607584
608585
609586instance
610− ( K1Table label 'True Aggregate (IsStructure structure) structure a
611− , Table Aggregate a
587+ ( Table Aggregate a
612588 , K1Columns label structure ~ HLabel label (Columns a)
613589 , as ~ ListTable a
614− ) => K1Table label 'True Aggregate 'True (Shape1 'List structure) as
590+ ) => K1Table label Aggregate 'True (Shape1 'List structure) as
615591 where
616592 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
617593 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -620,11 +596,10 @@ instance
620596
621597
622598instance
623− ( K1Table label 'True Expr (IsStructure structure) structure a
624− , Table Expr a
599+ ( Table Expr a
625600 , K1Columns label structure ~ HLabel label (Columns a)
626601 , as ~ ListTable a
627− ) => K1Table label 'True Expr 'True (Shape1 'List structure) as
602+ ) => K1Table label Expr 'True (Shape1 'List structure) as
628603 where
629604 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
630605 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -633,11 +608,10 @@ instance
633608
634609
635610instance
636− ( K1Table label 'True Insertion (IsStructure structure) structure a
637− , Table Insertion a
611+ ( Table Insertion a
638612 , K1Columns label structure ~ HLabel label (Columns a)
639613 , as ~ ListTable a
640− ) => K1Table label 'True Insertion 'True (Shape1 'List structure) as
614+ ) => K1Table label Insertion 'True (Shape1 'List structure) as
641615 where
642616 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
643617 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -646,25 +620,22 @@ instance
646620
647621
648622instance
649− ( K1Table label 'True Identity (IsStructure structure) structure a
623+ ( K1Table label Identity (IsStructure structure) structure a
650624 , HTable (K1Columns label structure)
651625 , as ~ [a]
652− ) => K1Table label 'True Identity 'True (Shape1 'List structure) as
626+ ) => K1Table label Identity 'True (Shape1 'List structure) as
653627 where
654− fromK1Columns = fmap (fromK1Columns @label @'True @Identity @_ @structure) . fromHListTable
655− toK1Columns = toHListTable . fmap (toK1Columns @label @'True @Identity @_ @structure)
628+ fromK1Columns = fmap (fromK1Columns @label @_ @_ @structure) . fromHListTable
629+ toK1Columns = toHListTable . fmap (toK1Columns @label @_ @_ @structure)
656630 {-# INLINABLE fromK1Columns #-}
657631 {-# INLINABLE toK1Columns #-}
658632
659633
660634instance
661− ( K1Table label 'False context (IsStructure structure) structure a
662− , IsSpecialContext context ~ 'False
663− , Table context a
635+ ( Table Name a
664636 , K1Columns label structure ~ HLabel label (Columns a)
665− , Labelable context
666637 , as ~ ListTable a
667− ) => K1Table label 'False context 'True (Shape1 'List structure) as
638+ ) => K1Table label Name 'True (Shape1 'List structure) as
668639 where
669640 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
670641 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -674,95 +645,91 @@ instance
674645
675646instance
676647 ( HTable (K1Columns "Just" structure)
677− , K1Table "Just" 'True Aggregate (IsStructure structure) structure a
648+ , K1Table "Just" Aggregate (IsStructure structure) structure a
678649 , ma ~ MaybeTable a
679− ) => K1Table label 'True Aggregate 'True (Shape1 'Maybe structure) ma
650+ ) => K1Table label Aggregate 'True (Shape1 'Maybe structure) ma
680651 where
681652 fromK1Columns =
682− fromColumns1 (fromK1Columns @"Just" @_ @_ @_ @structure) .
653+ fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
683654 hunlabel unlabeler
684655 toK1Columns =
685656 hlabel labeler .
686− toColumns1 (toK1Columns @"Just" @_ @_ @_ @structure)
657+ toColumns1 (toK1Columns @"Just" @_ @_ @structure)
687658 {-# INLINABLE fromK1Columns #-}
688659 {-# INLINABLE toK1Columns #-}
689660
690661
691662instance
692663 ( HTable (K1Columns "Just" structure)
693− , K1Table "Just" 'True Expr (IsStructure structure) structure a
664+ , K1Table "Just" Expr (IsStructure structure) structure a
694665 , ma ~ MaybeTable a
695− ) => K1Table label 'True Expr 'True (Shape1 'Maybe structure) ma
666+ ) => K1Table label Expr 'True (Shape1 'Maybe structure) ma
696667 where
697668 fromK1Columns =
698− fromColumns1 (fromK1Columns @"Just" @_ @_ @_ @structure) .
669+ fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
699670 hunlabel unlabeler
700671 toK1Columns =
701672 hlabel labeler .
702− toColumns1 (toK1Columns @"Just" @_ @_ @_ @structure)
673+ toColumns1 (toK1Columns @"Just" @_ @_ @structure)
703674 {-# INLINABLE fromK1Columns #-}
704675 {-# INLINABLE toK1Columns #-}
705676
706677
707678instance
708679 ( HTable (K1Columns "Just" structure)
709− , K1Table "Just" 'True Insertion (IsStructure structure) structure a
680+ , K1Table "Just" Insertion (IsStructure structure) structure a
710681 , ma ~ MaybeTable a
711− ) => K1Table label 'True Insertion 'True (Shape1 'Maybe structure) ma
682+ ) => K1Table label Insertion 'True (Shape1 'Maybe structure) ma
712683 where
713684 fromK1Columns =
714− fromColumns1 (fromK1Columns @"Just" @_ @_ @_ @structure) .
685+ fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
715686 hunlabel unlabeler
716687 toK1Columns =
717688 hlabel labeler .
718− toColumns1 (toK1Columns @"Just" @_ @_ @_ @structure)
689+ toColumns1 (toK1Columns @"Just" @_ @_ @structure)
719690 {-# INLINABLE fromK1Columns #-}
720691 {-# INLINABLE toK1Columns #-}
721692
722693
723694instance
724695 ( HTable (K1Columns "Just" structure)
725− , K1Table "Just" 'True Identity (IsStructure structure) structure a
696+ , K1Table "Just" Identity (IsStructure structure) structure a
726697 , ma ~ Maybe a
727− ) => K1Table label 'True Identity 'True (Shape1 'Maybe structure) ma
698+ ) => K1Table label Identity 'True (Shape1 'Maybe structure) ma
728699 where
729700 fromK1Columns
730− = fmap (fromK1Columns @"Just" @_ @_ @_ @structure)
701+ = fmap (fromK1Columns @"Just" @_ @_ @structure)
731702 . fromHMaybeTable
732703 . hunlabel unlabeler
733704 toK1Columns
734705 = hlabel labeler
735706 . toHMaybeTable
736− . fmap (toK1Columns @"Just" @_ @_ @_ @structure)
707+ . fmap (toK1Columns @"Just" @_ @_ @structure)
737708 {-# INLINABLE fromK1Columns #-}
738709 {-# INLINABLE toK1Columns #-}
739710
740711
741712instance
742713 ( HTable (K1Columns "Just" structure)
743− , K1Table "Just" 'False context (IsStructure structure) structure a
744− , IsSpecialContext context ~ 'False
745− , Labelable context
746− , Nullifiable context
714+ , K1Table "Just" Name (IsStructure structure) structure a
747715 , ma ~ MaybeTable a
748− ) => K1Table label 'False context 'True (Shape1 'Maybe structure) ma
716+ ) => K1Table label Name 'True (Shape1 'Maybe structure) ma
749717 where
750718 fromK1Columns =
751− fromColumns1 (fromK1Columns @"Just" @_ @_ @_ @structure) .
719+ fromColumns1 (fromK1Columns @"Just" @_ @_ @structure) .
752720 hunlabel unlabeler
753721 toK1Columns =
754722 hlabel labeler .
755− toColumns1 (toK1Columns @"Just" @_ @_ @_ @structure)
723+ toColumns1 (toK1Columns @"Just" @_ @_ @structure)
756724 {-# INLINABLE fromK1Columns #-}
757725 {-# INLINABLE toK1Columns #-}
758726
759727
760728instance
761− ( K1Table label 'True Aggregate (IsStructure structure) structure a
762− , Table Aggregate a
729+ ( Table Aggregate a
763730 , K1Columns label structure ~ HLabel label (Columns a)
764731 , as ~ NonEmptyTable a
765− ) => K1Table label 'True Aggregate 'True (Shape1 'NonEmpty structure) as
732+ ) => K1Table label Aggregate 'True (Shape1 'NonEmpty structure) as
766733 where
767734 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
768735 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -771,11 +738,10 @@ instance
771738
772739
773740instance
774− ( K1Table label 'True Expr (IsStructure structure) structure a
775− , Table Expr a
741+ ( Table Expr a
776742 , K1Columns label structure ~ HLabel label (Columns a)
777743 , as ~ NonEmptyTable a
778− ) => K1Table label 'True Expr 'True (Shape1 'NonEmpty structure) as
744+ ) => K1Table label Expr 'True (Shape1 'NonEmpty structure) as
779745 where
780746 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
781747 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -784,11 +750,10 @@ instance
784750
785751
786752instance
787− ( K1Table label 'True Insertion (IsStructure structure) structure a
788− , Table Insertion a
753+ ( Table Insertion a
789754 , K1Columns label structure ~ HLabel label (Columns a)
790755 , as ~ NonEmptyTable a
791− ) => K1Table label 'True Insertion 'True (Shape1 'NonEmpty structure) as
756+ ) => K1Table label Insertion 'True (Shape1 'NonEmpty structure) as
792757 where
793758 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
794759 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -797,25 +762,22 @@ instance
797762
798763
799764instance
800− ( K1Table label 'True Identity (IsStructure structure) structure a
765+ ( K1Table label Identity (IsStructure structure) structure a
801766 , HTable (K1Columns label structure)
802767 , as ~ NonEmpty a
803− ) => K1Table label 'True Identity 'True (Shape1 'NonEmpty structure) as
768+ ) => K1Table label Identity 'True (Shape1 'NonEmpty structure) as
804769 where
805− fromK1Columns = fmap (fromK1Columns @label @'True @Identity @_ @structure) . fromHNonEmptyTable
806− toK1Columns = toHNonEmptyTable . fmap (toK1Columns @label @'True @Identity @_ @structure)
770+ fromK1Columns = fmap (fromK1Columns @label @_ @_ @structure) . fromHNonEmptyTable
771+ toK1Columns = toHNonEmptyTable . fmap (toK1Columns @label @_ @_ @structure)
807772 {-# INLINABLE fromK1Columns #-}
808773 {-# INLINABLE toK1Columns #-}
809774
810775
811776instance
812− ( K1Table label 'False context (IsStructure structure) structure a
813− , IsSpecialContext context ~ 'False
814− , Table context a
777+ ( Table Name a
815778 , K1Columns label structure ~ HLabel label (Columns a)
816− , Labelable context
817779 , as ~ NonEmptyTable a
818− ) => K1Table label 'False context 'True (Shape1 'NonEmpty structure) as
780+ ) => K1Table label Name 'True (Shape1 'NonEmpty structure) as
819781 where
820782 fromK1Columns = fromColumns . hrelabel (hunlabel hunlabeler)
821783 toK1Columns = hrelabel (hlabel hlabeler) . toColumns
@@ -826,21 +788,21 @@ instance
826788instance
827789 ( HTable (K1Columns "Here" structure1)
828790 , HTable (K1Columns "There" structure2)
829− , K1Table "Here" 'True Aggregate (IsStructure structure1) structure1 a
830− , K1Table "There" 'True Aggregate (IsStructure structure2) structure2 b
791+ , K1Table "Here" Aggregate (IsStructure structure1) structure1 a
792+ , K1Table "There" Aggregate (IsStructure structure2) structure2 b
831793 , 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
833795 where
834796 fromK1Columns =
835797 fromColumns2
836− (fromK1Columns @"Here" @_ @_ @_ @structure1)
837− (fromK1Columns @"There" @_ @_ @_ @structure2) .
798+ (fromK1Columns @"Here" @_ @_ @structure1)
799+ (fromK1Columns @"There" @_ @_ @structure2) .
838800 hunlabel unlabeler
839801 toK1Columns =
840802 hlabel labeler .
841803 toColumns2
842− (toK1Columns @"Here" @_ @_ @_ @structure1)
843− (toK1Columns @"There" @_ @_ @_ @structure2)
804+ (toK1Columns @"Here" @_ @_ @structure1)
805+ (toK1Columns @"There" @_ @_ @structure2)
844806 {-# INLINABLE fromK1Columns #-}
845807 {-# INLINABLE toK1Columns #-}
846808
@@ -848,21 +810,21 @@ instance
848810instance
849811 ( HTable (K1Columns "Here" structure1)
850812 , HTable (K1Columns "There" structure2)
851− , K1Table "Here" 'True Expr (IsStructure structure1) structure1 a
852− , K1Table "There" 'True Expr (IsStructure structure2) structure2 b
813+ , K1Table "Here" Expr (IsStructure structure1) structure1 a
814+ , K1Table "There" Expr (IsStructure structure2) structure2 b
853815 , 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
855817 where
856818 fromK1Columns =
857819 fromColumns2
858− (fromK1Columns @"Here" @_ @_ @_ @structure1)
859− (fromK1Columns @"There" @_ @_ @_ @structure2) .
820+ (fromK1Columns @"Here" @_ @_ @structure1)
821+ (fromK1Columns @"There" @_ @_ @structure2) .
860822 hunlabel unlabeler
861823 toK1Columns =
862824 hlabel labeler .
863825 toColumns2
864− (toK1Columns @"Here" @_ @_ @_ @structure1)
865− (toK1Columns @"There" @_ @_ @_ @structure2)
826+ (toK1Columns @"Here" @_ @_ @structure1)
827+ (toK1Columns @"There" @_ @_ @structure2)
866828 {-# INLINABLE fromK1Columns #-}
867829 {-# INLINABLE toK1Columns #-}
868830
@@ -870,21 +832,21 @@ instance
870832instance
871833 ( HTable (K1Columns "Here" structure1)
872834 , HTable (K1Columns "There" structure2)
873− , K1Table "Here" 'True Insertion (IsStructure structure1) structure1 a
874− , K1Table "There" 'True Insertion (IsStructure structure2) structure2 b
835+ , K1Table "Here" Insertion (IsStructure structure1) structure1 a
836+ , K1Table "There" Insertion (IsStructure structure2) structure2 b
875837 , 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
877839 where
878840 fromK1Columns =
879841 fromColumns2
880− (fromK1Columns @"Here" @_ @_ @_ @structure1)
881− (fromK1Columns @"There" @_ @_ @_ @structure2) .
842+ (fromK1Columns @"Here" @_ @_ @structure1)
843+ (fromK1Columns @"There" @_ @_ @structure2) .
882844 hunlabel unlabeler
883845 toK1Columns =
884846 hlabel labeler .
885847 toColumns2
886− (toK1Columns @"Here" @_ @_ @_ @structure1)
887− (toK1Columns @"There" @_ @_ @_ @structure2)
848+ (toK1Columns @"Here" @_ @_ @structure1)
849+ (toK1Columns @"There" @_ @_ @structure2)
888850 {-# INLINABLE fromK1Columns #-}
889851 {-# INLINABLE toK1Columns #-}
890852
@@ -892,23 +854,23 @@ instance
892854instance
893855 ( HTable (K1Columns "Here" structure1)
894856 , HTable (K1Columns "There" structure2)
895− , K1Table "Here" 'True Identity (IsStructure structure1) structure1 a
896− , K1Table "There" 'True Identity (IsStructure structure2) structure2 b
857+ , K1Table "Here" Identity (IsStructure structure1) structure1 a
858+ , K1Table "There" Identity (IsStructure structure2) structure2 b
897859 , 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
899861 where
900862 fromK1Columns
901863 = bimap
902− (fromK1Columns @"Here" @_ @_ @_ @structure1)
903− (fromK1Columns @"There" @_ @_ @_ @structure2)
864+ (fromK1Columns @"Here" @_ @_ @structure1)
865+ (fromK1Columns @"There" @_ @_ @structure2)
904866 . fromHTheseTable
905867 . hunlabel unlabeler
906868 toK1Columns
907869 = hlabel labeler
908870 . toHTheseTable
909871 . bimap
910− (toK1Columns @"Here" @_ @_ @_ @structure1)
911− (toK1Columns @"There" @_ @_ @_ @structure2)
872+ (toK1Columns @"Here" @_ @_ @structure1)
873+ (toK1Columns @"There" @_ @_ @structure2)
912874 {-# INLINABLE fromK1Columns #-}
913875 {-# INLINABLE toK1Columns #-}
914876
@@ -916,110 +878,106 @@ instance
916878instance
917879 ( HTable (K1Columns "Here" structure1)
918880 , HTable (K1Columns "There" structure2)
919− , K1Table "Here" 'False context (IsStructure structure1) structure1 a
920− , K1Table "There" 'False context (IsStructure structure2) structure2 b
921− , IsSpecialContext context ~ 'False
922− , Labelable context
923− , Nullifiable context
881+ , K1Table "Here" Name (IsStructure structure1) structure1 a
882+ , K1Table "There" Name (IsStructure structure2) structure2 b
924883 , 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
926885 where
927886 fromK1Columns =
928887 fromColumns2
929− (fromK1Columns @"Here" @_ @_ @_ @structure1)
930− (fromK1Columns @"There" @_ @_ @_ @structure2) .
888+ (fromK1Columns @"Here" @_ @_ @structure1)
889+ (fromK1Columns @"There" @_ @_ @structure2) .
931890 hunlabel unlabeler
932891 toK1Columns =
933892 hlabel labeler .
934893 toColumns2
935− (toK1Columns @"Here" @_ @_ @_ @structure1)
936− (toK1Columns @"There" @_ @_ @_ @structure2)
894+ (toK1Columns @"Here" @_ @_ @structure1)
895+ (toK1Columns @"There" @_ @_ @structure2)
937896 {-# INLINABLE fromK1Columns #-}
938897 {-# INLINABLE toK1Columns #-}
939898
940899
941−
942900instance
943− ( K1Table "fst" isSpecialContext context (IsStructure structure1) structure1 a1
944− , K1Table "snd" isSpecialContext context (IsStructure structure2) structure2 a2
901+ ( K1Table "fst" context (IsStructure structure1) structure1 a1
902+ , K1Table "snd" context (IsStructure structure2) structure2 a2
945903 , HTable (K1Columns "fst" structure1)
946904 , HTable (K1Columns "snd" structure2)
947905 , Labelable context
948906 , a ~ (a1, a2)
949− ) => K1Table label isSpecialContext context 'True (structure1, structure2) a
907+ ) => K1Table label context 'True (structure1, structure2) a
950908 where
951909 fromK1Columns (hunlabel unlabeler -> (HPair a b)) =
952− ( fromK1Columns @"fst" @_ @_ @_ @structure1 a
953− , fromK1Columns @"snd" @_ @_ @_ @structure2 b
910+ ( fromK1Columns @"fst" @_ @_ @structure1 a
911+ , fromK1Columns @"snd" @_ @_ @structure2 b
954912 )
955913 toK1Columns (a, b) = hlabel labeler $ HPair
956− { hfst = toK1Columns @"fst" @_ @_ @_ @structure1 a
957− , hsnd = toK1Columns @"snd" @_ @_ @_ @structure2 b
914+ { hfst = toK1Columns @"fst" @_ @_ @structure1 a
915+ , hsnd = toK1Columns @"snd" @_ @_ @structure2 b
958916 }
959917 {-# INLINABLE fromK1Columns #-}
960918 {-# INLINABLE toK1Columns #-}
961919
962920
963921instance
964− ( K1Table "fst" isSpecialContext context (IsStructure structure1) structure1 a1
965− , K1Table "snd" isSpecialContext context (IsStructure structure2) structure2 a2
966− , K1Table "trd" isSpecialContext context (IsStructure structure3) structure3 a3
922+ ( K1Table "fst" context (IsStructure structure1) structure1 a1
923+ , K1Table "snd" context (IsStructure structure2) structure2 a2
924+ , K1Table "trd" context (IsStructure structure3) structure3 a3
967925 , HTable (K1Columns "fst" structure1)
968926 , HTable (K1Columns "snd" structure2)
969927 , HTable (K1Columns "trd" structure3)
970928 , Labelable context
971929 , a ~ (a1, a2, a3)
972− ) => K1Table label isSpecialContext context 'True (structure1, structure2, structure3) a
930+ ) => K1Table label context 'True (structure1, structure2, structure3) a
973931 where
974932 fromK1Columns (hunlabel unlabeler -> (HTrio a b c)) =
975− ( fromK1Columns @"fst" @_ @_ @_ @structure1 a
976− , fromK1Columns @"snd" @_ @_ @_ @structure2 b
977− , fromK1Columns @"trd" @_ @_ @_ @structure3 c
933+ ( fromK1Columns @"fst" @_ @_ @structure1 a
934+ , fromK1Columns @"snd" @_ @_ @structure2 b
935+ , fromK1Columns @"trd" @_ @_ @structure3 c
978936 )
979937 toK1Columns (a, b, c) = hlabel labeler $ HTrio
980− { hfst = toK1Columns @"fst" @_ @_ @_ @structure1 a
981− , hsnd = toK1Columns @"snd" @_ @_ @_ @structure2 b
982− , htrd = toK1Columns @"trd" @_ @_ @_ @structure3 c
938+ { hfst = toK1Columns @"fst" @_ @_ @structure1 a
939+ , hsnd = toK1Columns @"snd" @_ @_ @structure2 b
940+ , htrd = toK1Columns @"trd" @_ @_ @structure3 c
983941 }
984942 {-# INLINABLE fromK1Columns #-}
985943 {-# INLINABLE toK1Columns #-}
986944
987945
988946instance
989− ( K1Table "fst" isSpecialContext context (IsStructure structure1) structure1 a1
990− , K1Table "snd" isSpecialContext context (IsStructure structure2) structure2 a2
991− , K1Table "trd" isSpecialContext context (IsStructure structure3) structure3 a3
992− , K1Table "frt" isSpecialContext context (IsStructure structure3) structure4 a4
947+ ( K1Table "fst" context (IsStructure structure1) structure1 a1
948+ , K1Table "snd" context (IsStructure structure2) structure2 a2
949+ , K1Table "trd" context (IsStructure structure3) structure3 a3
950+ , K1Table "frt" context (IsStructure structure3) structure4 a4
993951 , HTable (K1Columns "fst" structure1)
994952 , HTable (K1Columns "snd" structure2)
995953 , HTable (K1Columns "trd" structure3)
996954 , HTable (K1Columns "frt" structure4)
997955 , Labelable context
998956 , 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
1000958 where
1001959 fromK1Columns (hunlabel unlabeler -> (HQuartet a b c d)) =
1002− ( fromK1Columns @"fst" @_ @_ @_ @structure1 a
1003− , fromK1Columns @"snd" @_ @_ @_ @structure2 b
1004− , fromK1Columns @"trd" @_ @_ @_ @structure3 c
1005− , fromK1Columns @"frt" @_ @_ @_ @structure4 d
960+ ( fromK1Columns @"fst" @_ @_ @structure1 a
961+ , fromK1Columns @"snd" @_ @_ @structure2 b
962+ , fromK1Columns @"trd" @_ @_ @structure3 c
963+ , fromK1Columns @"frt" @_ @_ @structure4 d
1006964 )
1007965 toK1Columns (a, b, c, d) = hlabel labeler $ HQuartet
1008− { hfst = toK1Columns @"fst" @_ @_ @_ @structure1 a
1009− , hsnd = toK1Columns @"snd" @_ @_ @_ @structure2 b
1010− , htrd = toK1Columns @"trd" @_ @_ @_ @structure3 c
1011− , hfrt = toK1Columns @"frt" @_ @_ @_ @structure4 d
966+ { hfst = toK1Columns @"fst" @_ @_ @structure1 a
967+ , hsnd = toK1Columns @"snd" @_ @_ @structure2 b
968+ , htrd = toK1Columns @"trd" @_ @_ @structure3 c
969+ , hfrt = toK1Columns @"frt" @_ @_ @structure4 d
1012970 }
1013971 {-# INLINABLE fromK1Columns #-}
1014972 {-# INLINABLE toK1Columns #-}
1015973
1016974
1017975instance
1018− ( K1Table "fst" isSpecialContext context (IsStructure structure1) structure1 a1
1019− , K1Table "snd" isSpecialContext context (IsStructure structure2) structure2 a2
1020− , K1Table "trd" isSpecialContext context (IsStructure structure3) structure3 a3
1021− , K1Table "frt" isSpecialContext context (IsStructure structure3) structure4 a4
1022− , K1Table "fft" isSpecialContext context (IsStructure structure3) structure5 a5
976+ ( K1Table "fst" context (IsStructure structure1) structure1 a1
977+ , K1Table "snd" context (IsStructure structure2) structure2 a2
978+ , K1Table "trd" context (IsStructure structure3) structure3 a3
979+ , K1Table "frt" context (IsStructure structure3) structure4 a4
980+ , K1Table "fft" context (IsStructure structure3) structure5 a5
1023981 , HTable (K1Columns "fst" structure1)
1024982 , HTable (K1Columns "snd" structure2)
1025983 , HTable (K1Columns "trd" structure3)
@@ -1027,34 +985,33 @@ instance
1027985 , HTable (K1Columns "fft" structure5)
1028986 , Labelable context
1029987 , 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
1031989 where
1032990 fromK1Columns (hunlabel unlabeler -> (HQuintet a b c d e)) =
1033− ( fromK1Columns @"fst" @_ @_ @_ @structure1 a
1034− , fromK1Columns @"snd" @_ @_ @_ @structure2 b
1035− , fromK1Columns @"trd" @_ @_ @_ @structure3 c
1036− , fromK1Columns @"frt" @_ @_ @_ @structure4 d
1037− , fromK1Columns @"fft" @_ @_ @_ @structure5 e
991+ ( fromK1Columns @"fst" @_ @_ @structure1 a
992+ , fromK1Columns @"snd" @_ @_ @structure2 b
993+ , fromK1Columns @"trd" @_ @_ @structure3 c
994+ , fromK1Columns @"frt" @_ @_ @structure4 d
995+ , fromK1Columns @"fft" @_ @_ @structure5 e
1038996 )
1039997 toK1Columns (a, b, c, d, e) = hlabel labeler $ HQuintet
1040− { hfst = toK1Columns @"fst" @_ @_ @_ @structure1 a
1041− , hsnd = toK1Columns @"snd" @_ @_ @_ @structure2 b
1042− , htrd = toK1Columns @"trd" @_ @_ @_ @structure3 c
1043− , hfrt = toK1Columns @"frt" @_ @_ @_ @structure4 d
1044− , hfft = toK1Columns @"fft" @_ @_ @_ @structure5 e
998+ { hfst = toK1Columns @"fst" @_ @_ @structure1 a
999+ , hsnd = toK1Columns @"snd" @_ @_ @structure2 b
1000+ , htrd = toK1Columns @"trd" @_ @_ @structure3 c
1001+ , hfrt = toK1Columns @"frt" @_ @_ @structure4 d
1002+ , hfft = toK1Columns @"fft" @_ @_ @structure5 e
10451003 }
10461004 {-# INLINABLE fromK1Columns #-}
10471005 {-# INLINABLE toK1Columns #-}
10481006
10491007
10501008instance
1051− ( IsSpecialContext context ~ isSpecialContext
1052− , IsStructure structure ~ 'False
1009+ ( IsStructure structure ~ 'False
10531010 , K1Columns label structure ~ HLabel label (Columns structure)
10541011 , Columns structure ~ Columns a
10551012 , Labelable context
10561013 , Table context a
1057− ) => K1Table label isSpecialContext context 'False structure a
1014+ ) => K1Table label context 'False structure a
10581015 where
10591016 fromK1Columns = fromColumns . hunlabel unlabeler
10601017 toK1Columns = hlabel labeler . toColumns
src/Rel8/Table.hs+9−15
@@ -23,9 +23,7 @@ import Prelude
2323import Rel8.Aggregate ( Aggregate )
2424import Rel8.Expr ( Expr )
2525import Rel8.Opaque ( Opaque, Opaque1 )
26−import Rel8.Schema.Context
27− ( Col, Col'(..), Insertion(..), Name, IsSpecialContext
28− )
26+import Rel8.Schema.Context ( Col(..), Insertion(..), Name(..) )
2927import Rel8.Schema.Context.Label ( Labelable, labeler, unlabeler )
3028import Rel8.Schema.HTable ( HTable, hfield, hspecs, htabulate, htabulateA )
3129import Rel8.Schema.HTable.Identity ( HIdentity(..) )
@@ -63,22 +61,18 @@ class (HTable (Columns a), context ~ Context a) => Table context a | a -> contex
6361
6462
6563-- | Any 'HTable' is also a 'Table'.
66−instance (HTable t, x ~ IsSpecialContext context) =>
67− Table context (t (Col' x context))
68− where
69− type Columns (t (Col' x context)) = t
70− type Context (t (Col' x context)) = context
64+instance HTable t => Table context (t (Col context)) where
65+ type Columns (t (Col context)) = t
66+ type Context (t (Col context)) = context
7167
7268 toColumns = id
7369 fromColumns = id
7470
7571
7672-- | Any context is trivially a table.
77−instance (KnownSpec spec, x ~ IsSpecialContext context) =>
78− Table context (Col' x context spec)
79− where
80− type Columns (Col' x context spec) = HIdentity spec
81− type Context (Col' x context spec) = context
73+instance KnownSpec spec => Table context (Col context spec) where
74+ type Columns (Col context spec) = HIdentity spec
75+ type Context (Col context spec) = context
8276
8377 toColumns = HIdentity
8478 fromColumns = unHIdentity
@@ -123,8 +117,8 @@ instance Sql DBType a => Table Name (Name a) where
123117 type Columns (Name a) = HType a
124118 type Context (Name a) = Name
125119
126− toColumns a = HType (Col a)
127− fromColumns (HType (Col a)) = a
120+ toColumns (Name a) = HType (NameCol a)
121+ fromColumns (HType (NameCol a)) = Name a
128122
129123
130124instance
src/Rel8/Table/Aggregate.hs+1−1
@@ -21,7 +21,7 @@ import Prelude
2121import Rel8.Aggregate ( Aggregate )
2222import Rel8.Expr ( Expr )
2323import Rel8.Expr.Aggregate ( listAggExpr, nonEmptyAggExpr, sgroupByExpr )
24−import Rel8.Schema.Context ( Col'(..) )
24+import Rel8.Schema.Context ( Col(..) )
2525import Rel8.Schema.Dict ( Dict( Dict ) )
2626import Rel8.Schema.HTable ( htabulate, hfield, hdicts, hspecs )
2727import Rel8.Schema.HTable.Vectorize ( hvectorize )
src/Rel8/Table/Bool.hs+1−1
@@ -14,7 +14,7 @@ import Prelude
1414-- rel8
1515import Rel8.Expr ( Expr )
1616import Rel8.Expr.Bool ( boolExpr, caseExpr )
17−import Rel8.Schema.Context ( Col'(..) )
17+import Rel8.Schema.Context ( Col(..) )
1818import Rel8.Schema.HTable ( htabulate, hfield )
1919import Rel8.Table ( Table, fromColumns, toColumns )
2020
src/Rel8/Table/Eq.hs+1−1
@@ -27,7 +27,7 @@ import Rel8.Expr ( Expr )
2727import Rel8.Expr.Bool ( (||.), (&&.) )
2828import Rel8.Expr.Eq ( seq, sne )
2929import Rel8.Opaque ( Opaque )
30−import Rel8.Schema.Context ( Col'(..) )
30+import Rel8.Schema.Context ( Col(..) )
3131import Rel8.Schema.Dict ( Dict( Dict ) )
3232import Rel8.Schema.HTable
3333 ( HConstrainTable
src/Rel8/Table/Insert.hs+1−1
@@ -14,7 +14,7 @@ import Prelude
1414
1515-- rel8
1616import Rel8.Kind.Necessity ( SNecessity( SOptional, SRequired ) )
17−import Rel8.Schema.Context ( Col'(..) )
17+import Rel8.Schema.Context ( Col(..) )
1818import Rel8.Schema.HTable ( hfield, htabulate, hspecs )
1919import Rel8.Schema.Spec ( SSpec(..) )
2020import Rel8.Table ( fromColumns, toColumns )
src/Rel8/Table/List.hs+1−1
@@ -17,7 +17,7 @@ import Prelude
1717-- rel8
1818import Rel8.Expr ( Expr )
1919import Rel8.Expr.Array ( sappend, sempty )
20−import Rel8.Schema.Context ( Col, Col'(..) )
20+import Rel8.Schema.Context ( Col(..) )
2121import Rel8.Schema.HTable.List ( HListTable )
2222import Rel8.Schema.HTable.Vectorize ( happend, hempty )
2323import Rel8.Table ( Table, Context, Columns, fromColumns, toColumns )
src/Rel8/Table/Name.hs+4−4
@@ -26,7 +26,7 @@ import Text.Casing ( quietSnake )
2626-- rel8
2727import Rel8.Expr ( Expr )
2828import Rel8.Kind.Labels ( renderLabels )
29−import Rel8.Schema.Context ( Col'(..), Name( Name ) )
29+import Rel8.Schema.Context ( Col(..), Name )
3030import Rel8.Schema.HTable ( htabulate, htabulateA, hfield, hspecs )
3131import Rel8.Schema.Spec ( SSpec(..) )
3232import Rel8.Table ( Table, Columns, Context, fromColumns, toColumns )
@@ -42,14 +42,14 @@ namesFromLabelsWith :: Table Name a
4242 => (NonEmpty String -> String) -> a
4343namesFromLabelsWith f = fromColumns $ htabulate $ \field ->
4444 case hfield hspecs field of
45− SSpec {labels} -> Col (Name (f (renderLabels labels)))
45+ SSpec {labels} -> NameCol (f (renderLabels labels))
4646
4747
4848showExprs :: Table Expr a => a -> [(String, String)]
4949showExprs as = case (namesFromLabels, toColumns as) of
5050 (names, exprs) -> getConst $ htabulateA $ \field ->
5151 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)]
5353
5454
5555showLabels :: forall a. Table (Context a) a => a -> [NonEmpty String]
@@ -61,4 +61,4 @@ showLabels _ = getConst $
6161showNames :: forall a. Table Name a => a -> [String]
6262showNames (toColumns -> names) = getConst $
6363 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
1717-- rel8
1818import Rel8.Expr ( Expr )
1919import Rel8.Expr.Array ( sappend1 )
20−import Rel8.Schema.Context ( Col, Col'(..) )
20+import Rel8.Schema.Context ( Col(..) )
2121import Rel8.Schema.HTable.NonEmpty ( HNonEmptyTable )
2222import Rel8.Schema.HTable.Vectorize ( happend )
2323import Rel8.Table ( Table, Context, Columns, fromColumns, toColumns )
src/Rel8/Table/Opaleye.hs+2−2
@@ -41,7 +41,7 @@ import Rel8.Expr.Opaleye
4141 , fromColumn, toColumn
4242 )
4343import Rel8.Kind.Necessity ( SNecessity( SRequired, SOptional ) )
44−import Rel8.Schema.Context ( Col, Col'(..), Insertion, Name(..) )
44+import Rel8.Schema.Context ( Col(..), Insertion, Name(..) )
4545import Rel8.Schema.HTable ( htabulateA, hfield, htraverse, hspecs )
4646import Rel8.Schema.Spec ( SSpec(..) )
4747import Rel8.Schema.Table ( TableSchema(..) )
@@ -96,7 +96,7 @@ tableFields (toColumns -> names) = dimap toColumns fromColumns $
9696 name -> lmap (`hfield` field) (go specs name)
9797 where
9898 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) =
100100 case necessity of
101101 SRequired ->
102102 lmap (\(RequiredInsert a) -> toColumn $ toPrimExpr a) $
src/Rel8/Table/Ord.hs+1−1
@@ -25,7 +25,7 @@ import Rel8.Expr.Bool ( (||.), (&&.), false, true )
2525import Rel8.Expr.Eq ( seq )
2626import Rel8.Expr.Ord ( slt, sgt)
2727import Rel8.Opaque ( Opaque )
28−import Rel8.Schema.Context ( Col'(..) )
28+import Rel8.Schema.Context ( Col(..) )
2929import Rel8.Schema.Dict ( Dict( Dict ) )
3030import Rel8.Schema.HTable
3131 ( HConstrainTable
src/Rel8/Table/Recontextualize.hs+4−5
@@ -25,7 +25,7 @@ import Prelude ()
2525import Rel8.Aggregate ( Aggregate )
2626import Rel8.Expr ( Expr )
2727import Rel8.Opaque ( Opaque, Opaque1 )
28−import Rel8.Schema.Context ( Col', Insertion, Name, IsSpecialContext )
28+import Rel8.Schema.Context ( Col(..), Insertion, Name )
2929import Rel8.Schema.Context.Label ( Labelable )
3030import Rel8.Schema.HTable ( HTable )
3131import qualified Rel8.Schema.Kind as K
@@ -50,8 +50,8 @@ class
5050 , b from -> a
5151
5252
53−instance (KnownSpec spec, x ~ IsSpecialContext from, y ~ IsSpecialContext to) =>
54− Recontextualize from to (Col' x from spec) (Col' y to spec)
53+instance KnownSpec spec =>
54+ Recontextualize from to (Col from spec) (Col to spec)
5555
5656
5757instance Sql DBType a =>
@@ -143,8 +143,7 @@ instance Sql DBType a => Recontextualize Name Name (Name a) (Name a)
143143instance Recontextualize from to (Opaque1 from a) (Opaque1 to a)
144144
145145
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))
148147
149148
150149instance
src/Rel8/Table/Serialize.hs+7−7
@@ -31,7 +31,7 @@ import qualified Hasql.Decoders as Hasql
3131import Rel8.Expr ( Expr )
3232import Rel8.Expr.Serialize ( slitExpr, sparseValue )
3333import Rel8.Opaque ( Opaque )
34−import Rel8.Schema.Context ( Col, Col'(..) )
34+import Rel8.Schema.Context ( Col(..) )
3535import Rel8.Schema.Context.Identity
3636 ( fromHEitherTable, toHEitherTable
3737 , fromHListTable, toHListTable
@@ -77,7 +77,7 @@ type family IsPlainColumn a where
7777 IsPlainColumn (_, _, _, _) = 'False
7878 IsPlainColumn (_, _, _, _, _) = 'False
7979 IsPlainColumn (_ Identity) = 'False
80− IsPlainColumn (_ (Col' _ Identity _)) = 'False
80+ IsPlainColumn (_ (Col Identity _)) = 'False
8181 IsPlainColumn (Identity _) = 'False
8282 IsPlainColumn _ = 'True
8383
@@ -94,8 +94,8 @@ type family IsTabular a where
9494 IsTabular (_, _, _, _) = 'True
9595 IsTabular (_, _, _, _, _) = 'True
9696 IsTabular (_ Identity) = 'True
97− IsTabular (_ (Col' _ Identity)) = 'True
98− IsTabular (Col' _ Identity _) = 'True
97+ IsTabular (_ (Col Identity)) = 'True
98+ IsTabular (Col Identity _) = 'True
9999 IsTabular _ = 'False
100100
101101
@@ -398,7 +398,7 @@ instance
398398 , isTabular ~ 'True
399399 , isSpecial ~ 'True
400400 , x ~ Col Expr spec
401− ) => ExprsFor 'False isTabular (Col' isSpecial Identity spec) x
401+ ) => ExprsFor 'False isTabular (Col Identity spec) x
402402 where
403403 fromIdentity = fromColumns
404404 toIdentity = toColumns
@@ -407,7 +407,7 @@ instance
407407type FromExprs :: Type -> Type
408408type family FromExprs a where
409409 FromExprs (Expr a) = a
410− FromExprs (Col' _ Expr spec) = Col Identity spec
410+ FromExprs (Col Expr spec) = Col Identity spec
411411 FromExprs (EitherTable a b) = Either (FromExprs a) (FromExprs b)
412412 FromExprs (ListTable a) = [FromExprs a]
413413 FromExprs (MaybeTable a) = Maybe (FromExprs a)
@@ -420,7 +420,7 @@ type family FromExprs a where
420420 FromExprs (a, b, c, d, e) =
421421 (FromExprs a, FromExprs b, FromExprs c, FromExprs d, FromExprs e)
422422 FromExprs (t Expr) = t Identity
423− FromExprs (t (Col' _ Expr)) = t (Col Identity)
423+ FromExprs (t (Col Expr)) = t (Col Identity)
424424
425425
426426-- | @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 )
1313-- rel8
1414import Rel8.Expr ( Expr )
1515import Rel8.Expr.Null ( snull, unsafeUnnullify )
16−import Rel8.Schema.Context ( Col'(..) )
16+import Rel8.Schema.Context ( Col(..) )
1717import Rel8.Schema.HTable ( htabulate, hfield, hspecs )
1818import Rel8.Schema.Nullability ( Nullability( Nullable, NonNullable ) )
1919import Rel8.Schema.Spec ( SSpec(..) )