Sample tree:
a
|
+- b
| |
| +- d
| |
| `- e
| -- | Description: This module demonstrates the foundations of a shim between | |
| -- @monad-logger-aeson@ and the 'Utf8Builder'-based logging system in "RIO". | |
| -- | |
| -- Note that this demonstration does not provide the same level of fanciness | |
| -- "RIO"'s logging can provide when making 'LogFunc' values via 'LogOptions' | |
| -- (e.g. sticky logging). The demonstration also digs into | |
| -- @monad-logger-aeson@'s internals in a couple spots. | |
| -- | |
| -- Output (when formatted with @jq@) looks like: | |
| -- { |
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o pipefail | |
| [[ "${DEBUG}" == 'true' ]] && set -o xtrace | |
| declare -r package="$1" | |
| if [ -z "$package" ] | |
| then | |
| echo "Must pass in package!" |
Sample tree:
a
|
+- b
| |
| +- d
| |
| `- e
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o pipefail | |
| [[ "${DEBUG}" == 'true' ]] && set -o xtrace | |
| brew services stop postgresql@12 | |
| rm -rf /usr/local/var/postgresql\@12/ | |
| initdb -E utf8 -U postgres /usr/local/var/postgresql\@12/ |
| -- | Maps each element of a list to a three-element tuple where the | |
| -- first element is the previous element in the input list and the | |
| -- final element is the next element of the input list. | |
| -- | |
| -- > tangle [1..4] | |
| -- [(4,1,2),(1,2,3),(2,3,4),(3,4,1)] | |
| -- | |
| tangle :: forall a. [a] -> [(a, a, a)] | |
| tangle = \input -> | |
| case input of |
| import qualified System.Directory as Directory | |
| import qualified System.Environment as Environment | |
| import qualified System.FilePath as FilePath | |
| listDirectoryDeep :: FilePath -> IO [FilePath] | |
| listDirectoryDeep directory = do | |
| entries <- listDirectoryShallow directory | |
| foldMap listEntry entries | |
| where | |
| listEntry entry = do |
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o pipefail | |
| [[ "$DEBUG" == 'true' ]] && set -o xtrace | |
| # $1: expected http code | |
| # $2: cookie file to use | |
| function httpReq() { | |
| local _expectedHTTPCode |
| ffmpeg -c:v libvpx -i "input.webm" -c:v prores_ks -pix_fmt yuva444p10le -metadata:s:v:0 alpha_mode="1" "output.mov" |
| #!/usr/bin/env stack | |
| {- stack | |
| --resolver lts-17.10 | |
| --install-ghc | |
| script | |
| --optimize | |
| -} | |
| -- This script demonstrates the synchrony of "Control.Exception.throwTo", in | |
| -- that calling the function is only synchronous until the asynchronous |
| #!/usr/bin/env stack | |
| {- stack | |
| --resolver lts-17.10 | |
| --install-ghc | |
| exec ghci | |
| --package aeson | |
| -- -ignore-dot-ghci -XDataKinds -XTypeApplications | |
| -} | |
| {-# LANGUAGE DataKinds #-} |