View th.hs
derivePostgresEnum :: String -> String -> Q [Dec]
derivePostgresEnum s postgresType = do
ss <- [|SqlOther (pack postgresType)|]
tpv <- [|PersistText . pack . show|]
fpv <- [|\dt v ->
case fromPersistValue v of
Left e -> Left e
Right s' ->
case reads $ unpack s' of
(x, _):_ -> Right x
View gist:daf16c7c086074990f6d1595b848474f
maximiliantagher@Maximilians-MBP ~/D/M/mercury-web> git diff yarn.lock
diff --git a/yarn.lock b/yarn.lock
index 441ccf1..b1df352 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -188,13 +188,14 @@
version "6.0.90"
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.90.tgz#0ed74833fa1b73dcdb9409dcb1c97ec0a8b13b02"
-"@types/qrcode-generator@^0.0.16":
View gist:2a7116641ef32653618136473a699636
cabal: Entering directory '/var/folders/v7/5k06hq7d3wbb4cvk8smv6kl00000gn/T/cabal-tmp-26452/HsOpenSSL-0.11.4.11'
[1 of 1] Compiling Main ( /var/folders/v7/5k06hq7d3wbb4cvk8smv6kl00000gn/T/cabal-tmp-26452/HsOpenSSL-0.11.4.11/dist/setup/setup.hs, /var/folders/v7/5k06hq7d3wbb4cvk8smv6kl00000gn/T/cabal-tmp-26452/HsOpenSSL-0.11.4.11/dist/setup/Main.o )
Linking /var/folders/v7/5k06hq7d3wbb4cvk8smv6kl00000gn/T/cabal-tmp-26452/HsOpenSSL-0.11.4.11/dist/setup/setup ...
Configuring HsOpenSSL-0.11.4.11...
Flags chosen: macports-openssl=False, homebrew-openssl=False, fast-bignum=True
Dependency base ==4.10.0.0: using base-4.10.0.0
Dependency bytestring ==0.10.8.2: using bytestring-0.10.8.2
Dependency integer-gmp ==1.0.1.0: using integer-gmp-1.0.1.0
Dependency network ==2.6.3.2: using network-2.6.3.2
Dependency time ==1.8.0.2: using time-1.8.0.2
View gist:7889879980cd6525038ceeea80c76f87
maximiliantagher@Maximilians-MacBook-Pro ~> cabal install HsOpenSSL --verbose
/usr/local/bin/alex --version
/usr/bin/gcc -dumpversion
looking for tool haddock near compiler in /usr/local/bin
found haddock in /usr/local/bin/haddock
/usr/local/bin/haddock --version
/usr/local/bin/happy --version
looking for tool hpc near compiler in /usr/local/bin
found hpc in /usr/local/bin/hpc
/usr/local/bin/hpc version
View gist:2e8e20ab31edfa18a3f09e2fcd295b3c
maximiliantagher@Maximilians-MacBook-Pro ~/D/M/h/mercury-web-backend> stack build --cabal-verbose
HsOpenSSL-0.11.4.11: configure
Progress: 1/2
-- While building custom Setup.hs for package HsOpenSSL-0.11.4.11 using:
/private/var/folders/v7/5k06hq7d3wbb4cvk8smv6kl00000gn/T/stack23703/HsOpenSSL-0.11.4.11/.stack-work/dist/x86_64-osx/Cabal-1.24.2.0/setup/setup --verbose --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0 configure --with-ghc=/Users/maximiliantagher/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc --with-ghc-pkg=/Users/maximiliantagher/.stack/programs/x86_64-osx/ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/Users/maximiliantagher/.stack/snapshots/x86_64-osx/lts-9.14/8.0.2/pkgdb --libdir=/Users/maximiliantagher/.stack/snapshots/x86_64-osx/lts-9.14/8.0.2/lib --bindir=/Users/maximiliantagher/.stack/snapshots/x86_64-osx/lts-9.14/8.0.2/bin --datadir=/Users/maximiliantagher/.stack/snapshots/x86_64-osx/lts-9.14/8.0.2/share --libexecdir=/Users/maximiliantagher/.sta
View gist:121b74e727e713869f9d739dd27da26b
maximiliantagher@Maximilians-MacBook-Pro ~/D/M/h/mercury-web-backend> stack build --verbose --cabal-verbose
Version 1.6.0.20171202, Git revision 50090e67c16980bba31349f386d5b018cbcaec31 (5421 commits) x86_64 hpack-0.20.0
2018-01-24 08:02:16.092437: [debug] Checking for project config at: /Users/maximiliantagher/Documents/Mercury/hs/mercury-web-backend/stack.yaml
@(Stack/Config.hs:842:9)
2018-01-24 08:02:16.096729: [debug] Loading project config file stack.yaml
@(Stack/Config.hs:868:13)
2018-01-24 08:02:16.098805: [debug] Decoding build plan from: /Users/maximiliantagher/.stack/build-plan/lts-9.14.yaml
@(Stack/Snapshot.hs:150:5)
2018-01-24 08:02:16.098903: [debug] Trying to decode /Users/maximiliantagher/.stack/build-plan-cache/lts-9.14.cache
@(Data/Store/VersionTagged.hs:66:5)
View gist:10e8a999eabcc9cb566c087978f5c3ac
bash-3.2$ command -v sw_vers && sw_vers # OS X only
/usr/bin/sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.2
BuildVersion: 17C205
bash-3.2$ command -v uname && uname -a # Kernel version
/usr/bin/uname
Darwin Maximilians-MBP 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64
bash-3.2$ command -v stack && stack --version
/usr/local/bin/stack
View gist:a861cdacbeedf6c11b5488b0ff4f50e0
maximiliantagher@Maximilians-MBP ~/D/t/citext> bash
bash-3.2$ command -v sw_vers && sw_vers # OS X only
/usr/bin/sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.2
BuildVersion: 17C88
bash-3.2$ command -v uname && uname -a # Kernel version
/usr/bin/uname
Darwin Maximilians-MBP 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22 PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64
bash-3.2$ command -v stack && stack --version
View gist:cb80301f9061243a095b8e2edafa31ec
bash-3.2$ command -v sw_vers && sw_vers # OS X only
/usr/bin/sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.1
BuildVersion: 17B1003
bash-3.2$ command -v uname && uname -a # Kernel version
/usr/bin/uname
Darwin Maximilians-MBP 17.2.0 Darwin Kernel Version 17.2.0: Fri Sep 29 18:27:05 PDT 2017; root:xnu-4570.20.62~3/RELEASE_X86_64 x86_64
bash-3.2$ command -v stack && stack --version
/usr/local/bin/stack
View gist:9e757f2da60ac53b45bb06b2b097d86b
-- First enable citext in psql: CREATE EXTENSION IF NOT EXISTS citext;
-- Create Model/CustomTypes.hs
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Model.CustomTypes where