Skip to content

Instantly share code, notes, and snippets.

Avatar
👀
Staring

Julian Ospald hasufell

👀
Staring
View GitHub Profile
View alltypes.h
#define _Addr int
#define _Int64 long long
#define _Reg int
#if __GNUC__ >= 3
#if defined(__NEED_va_list) && !defined(__DEFINED_va_list)
typedef __builtin_va_list va_list;
#define __DEFINED_va_list
#endif
View 0001-Don-t-prematurely-fail-during-configure-due-to-pkg-c.patch
From 382e3e0ed04f43351133fff3f1e6ad6655c6b4e3 Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@posteo.de>
Date: Sat, 9 May 2020 22:48:18 +0200
Subject: [PATCH] Don't prematurely fail during configure due to pkg-config
---
Cabal/Distribution/Simple/Configure.hs | 32 +++-----------------------
1 file changed, 3 insertions(+), 29 deletions(-)
diff --git a/Cabal/Distribution/Simple/Configure.hs b/Cabal/Distribution/Simple/Configure.hs
@hasufell
hasufell / Setup.hs
Last active May 9, 2020
Optional pkg-config detection with cabal
View Setup.hs
import Control.Exception ( SomeException
, handle
, try
)
import Control.Applicative
import Control.Monad
import Data.Char
import Data.List
import Data.Maybe
import Data.Monoid
View 0001-Fix-build-with-base-4.13.patch
From 3b6ff38dd26b8319a4d68d6998e6298857daeb6c Mon Sep 17 00:00:00 2001
From: Julian Ospald <hasufell@posteo.de>
Date: Wed, 25 Mar 2020 23:11:55 +0100
Subject: [PATCH] Fix build with base >= 4.13
---
Codec/Compression/BZip/Stream.hsc | 8 ++++++++
bzlib.cabal | 4 ++--
2 files changed, 10 insertions(+), 2 deletions(-)
View ghcup-0.0.1.json
{
"GHC": {
"8.6.2": {
"viArch": {
"A_64": {
"Linux_Alpine": {
"unknown_version": {
"dlHash": "5be9f98c25c49dbfb65223e2642335d4a45220f0c4044c8af70bbcaebe688467",
"dlSubdir": "ghc-8.6.2",
"dlUri": "https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.6.2-musl/ghc-8.6.2-x86_64-unknown-linux-musl.tar.xz"
View QuasiQuoter.hs
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
View main.c
#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");
@hasufell
hasufell / install.sh
Created Jan 24, 2020
Automatic installer for haskell applications
View install.sh
#!/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
View MyPath.hs
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeInType #-}
View MyPath.hs
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE TypeInType #-}
You can’t perform that action at this time.