Skip to content

Instantly share code, notes, and snippets.

View Philonous's full-sized avatar

Philipp Balzarek Philonous

View GitHub Profile
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
module DTExample where
import Data.Singletons
import Data.Singletons.TH
@Philonous
Philonous / api-question.md
Last active April 13, 2017 15:31
api question

My dbus-library has a type for DBus types like this

data DBusSimpleType
    = TypeByte
    | TypeBoolean
    | TypeInt16
    | TypeUInt16
    [...]
@Philonous
Philonous / build
Last active April 7, 2019 06:52
Xmonad rebuild script
#!/bin/bash
BIN=$1
[[ -n $BIN ]] || BIN=xmonad
stack install --local-bin-path $PWD
[[ -f $BIN ]] || ln -s xmonad $BIN
@Philonous
Philonous / xinitrc
Created August 29, 2016 14:18
xinitrc
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done

Keybase proof

I hereby claim:

  • I am philonous on github.
  • I am philonous (https://keybase.io/philonous) on keybase.
  • I have a public key whose fingerprint is B5F2 B5FF BA08 484B EAC8 4FA1 3591 28C6 F5B2 7A4A

To claim this, I am signing this object:

{-# LANGUAGE ImpredicativeTypes #-}
{-# LANGUAGE RankNTypes #-}
module Experiment where
import Control.Monad.Trans
import Data.IORef
import Reactive.Banana
import Reactive.Banana.Frameworks
data Network = Network { eventNetwork :: EventNetwork
module Experiment where
import Control.Monad.Trans
import Data.IORef
import Reactive.Banana
import Reactive.Banana.Frameworks
import System.IO.Unsafe (unsafePerformIO)
-- To simulate sodium as close as possible, we define a global network that we
#!/usr/bin/zsh
set -e
#check that we are in a sandbox
cabal sandbox list-sources &> /dev/null
SOURCES="$(cabal sandbox list-sources | tail -n+4 | head -n-2)"
echo "> Found source dependencies:\n$SOURCES"
cabal sandbox delete
{-# LANGUAGE EmptyDataDecls, FunctionalDependencies, MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, UndecidableInstances, OverlappingInstances, ScopedTypeVariables, TypeFamilies, GADTs, RankNTypes #-}
module Funcompose where
infixl 8 .:.
class FunCompose rType aType f b
| f -> rType
, f b -> aType
where
(.:.) :: (rType -> b) -> f -> aType
(defvar module-abbrevs
nil
"List of module abbreviatios" )
(setq module-abbrevs '(("Text" "Data.Text (Text)"
"qualified Data.Text as Text"
:language "OverloadedStrings")
("Encoding" "qualified Data.Text.Encoding as Text")
("Map" "qualified Data.Map as Map"
"Data.Map (Map)")