This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance Lift Version where | |
lift (Version {..}) = [| Version {..} |] | |
instance Lift VUnit where | |
lift (Digits w) = [| Digits w |] | |
lift (Str t) = AppE <$> [| Str . T.pack |] <*> TH.lift (T.unpack t) | |
qq :: (Text -> Q Exp) -> QuasiQuoter | |
qq quoteExp' = | |
QuasiQuoter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <dirent.h> | |
#include <stddef.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
DIR *dir = opendir("/home"); | |
if (readdir(dir) == NULL) { | |
printf("d is NULL"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -eu | |
SCRIPT_DIR="$(CDPATH="" cd -- "$(dirname -- "$0")" && pwd -P)" | |
cd "${SCRIPT_DIR}" | |
# install ghcup | |
if ! [ -e "${SCRIPT_DIR}"/.ghcup/bin/ghcup ] ; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE EmptyDataDecls #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE TypeInType #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE EmptyDataDecls #-} | |
{-# LANGUAGE QuasiQuotes #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE TypeInType #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
%include polycode.fmt | |
\begin{document} | |
> {-# LANGUAGE DeriveDataTypeable #-} | |
> {-# LANGUAGE EmptyDataDecls #-} | |
> {-# LANGUAGE QuasiQuotes #-} | |
> {-# LANGUAGE TemplateHaskell #-} | |
> {-# LANGUAGE TypeFamilies #-} | |
> {-# LANGUAGE DataKinds #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data CapturedProcess = CapturedProcess { | |
_exitCode :: ExitCode | |
, _stdOut :: L.ByteString | |
, _stdErr :: L.ByteString | |
} deriving (Eq, Show) | |
makeLenses ''CapturedProcess | |
readFd :: Fd -> IO L.ByteString |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module Types.JSON where | |
import Data.Aeson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
-- TODO: handle SIGTERM, SIGUSR | |
module GHCup where | |
import Control.Exception.Safe | |
import Data.Foldable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
status_message() { | |
printf "\\033[0;32m%s\\033[0m\\n" "$1" | |
} | |
error_message() { | |
printf "\\033[0;31m%s\\033[0m\\n" "$1" |