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 OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
module Main (main) where | |
import Colonnade (Headed) | |
import Data.ByteString (ByteString) | |
import Data.Map (Map) | |
import Data.Text (Text) | |
import Siphon (Siphon, SiphonError) |
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
# a simple service, 'mysql' | |
$ cat example.nix | |
{ pkgs, ... }: | |
{ | |
services.mysql.enable = true; | |
services.mysql.package = pkgs.mysql; | |
} | |
# build the service |
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
http://www.eas.uccs.edu/~mwickert/ece5655/lecture_notes/ece5655_chap10.pdf |
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 ScopedTypeVariables #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# OPTIONS_GHC -Wall -Werror -fno-warn-orphans #-} | |
module Data.Dependent.Map.JSON () where | |
import Data.Aeson (ToJSON(..),FromJSON(..)) | |
import Data.Exists (Exists(..),ToJSONKeyForall(..), | |
ToJSONKeyFunctionForall(..),ToJSONForall(..),ToSing(..), |
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 CPP #-} | |
#define InnieOuttie IO | |
#define class module | |
#define begin where | |
#define mayo main | |
#define memo putStrLn |
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
gm (middle of line) | |
% (match of next brace, bracket, comment, #define) |
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
{ stdenv, fetchFromGitHub, pkgconfig, vpnc, openssl ? null, gnutls ? null, gmp, libxml2, stoken, zlib } : | |
assert (openssl != null) == (gnutls == null); | |
let | |
version = "7.08"; | |
name = "openconnect_pa-${version}"; | |
in stdenv.mkDerivation { | |
inherit name; |
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
newtype Branch (o :: OS) e m a = Branch (ExceptT e m a) | |
deriving | |
( Applicative, Eq, Foldable, Functor, Monad, Traversable | |
) | |
branchToExceptT :: Branch o e m a -> ExceptT e m a | |
branchToExceptT = coerce | |
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
mkArg :: Int -> String | |
mkArg n = "arg" ++ show n | |
mkDegenerate :: Int -> Int -> String | |
mkDegenerate start end = "f " ++ (mconcat $ intersperse "@" $ map mkArg [start..end]) ++ " = " ++ mkArg end |
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
import Data.Functor.Compose | |
doubleFmap :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) | |
doubleFmap = fmap . fmap | |
fooMonad :: (Monad f, Functor g) => f (a -> b) -> f (g a) -> f (g b) | |
fooMonad fab fga = fab >>= \f -> doubleFmap f fga | |
fooApplicative :: (Applicative f, Applicative g) => f (a -> b) -> f (g a) -> f (g b) | |
fooApplicative fab fga = getCompose (Compose (fmap pure fab) <*> Compose fga) |