This file contains 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
{ lib }: | |
# this exposes a function, which is exported from lib/default.nix as toTOML, | |
# from attrset to string. It transforms a nix attribute set into the TOML | |
# format. | |
with lib; | |
let | |
tomlEscape = escape [ "\b" "\t" "\n" "\f" "\r" "\"" "\\" ]; |
This file contains 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
module Sat where | |
-- A variable, e.g. p, q, r... | |
type Var = Int | |
-- A parity, either False (¬) or True (not ¬) | |
type Parity = Bool | |
-- A literal, e.g. ¬p, q, ¬r | |
type Literal = (Int, Bool) | |
-- A sequence of literals, which are combined by || | |
type Clause = [Literal] |
This file contains 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 GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# OPTIONS_GHC -fno-warn-name-shadowing #-} | |
module FingerTree.Aligned where | |
import Control.Category | |
import Prelude hiding ((.), id) | |
import qualified Aligned.Internal as A |
This file contains 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
module Main where | |
import qualified Data.ByteString.Char8 as B -- bad | |
import qualified Graphics.UI.Gtk as Gtk | |
import System.Environment | |
import qualified System.GIO as GIO | |
updateImage :: Gtk.ImageClass o => o -> Maybe GIO.File -> Maybe GIO.File -> GIO.FileMonitorEvent -> IO () | |
updateImage image (Just file) _ GIO.FileMonitorEventChanged = do | |
pixbuf <- Gtk.pixbufNewFromFile . B.unpack $ GIO.filePath file |
This file contains 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
# invoke as jq -f bf.jq -rS --arg program [PROGRAM] - | |
# interactivity is not supported | |
# try: | |
# $ echo "" | jq -f bf.jq -RrS --arg program '++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.' | |
def increment: .tape.head+=1; | |
def decrement: .tape.head-=1; | |
def shiftleft: | |
.tape.left=[.tape.head]+.tape.left | |
This file contains 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
module Data.UnionFind.Group where | |
import Control.Monad | |
import Control.Monad.Primitive | |
import Data.Group | |
import Data.Primitive | |
data UFG' m g = UFG' | |
{ operator :: g | |
, root :: UFG m g |
This file contains 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 RecordWildCards #-} | |
{-# LANGUAGE ViewPatterns #-} | |
module Main where | |
import Data.Maybe | |
import Data.Time.Clock | |
import Data.Time.Clock.POSIX | |
import Network.URI | |
import Text.RSS |
This file contains 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
module Bogosort where | |
import Control.Monad.Primitive | |
import Control.Monad.ST | |
import Control.Monad.ST.Unsafe | |
import Control.Monad.Trans.State.Strict | |
import Data.Monoid | |
import qualified Data.Vector as V | |
import qualified Data.Vector.Generic.Mutable as VGM | |
import Data.Vector.Generic.Mutable (MVector) |
This file contains 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
module Foo where | |
import Paths_haddock_fail (getDataDir) | |
{-# ANN module (const () getDataDir) #-} |
This file contains 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
module Cat where | |
open import Relation.Binary | |
open import Relation.Binary.PropositionalEquality | |
open import Level | |
record Category (o a ℓ : Level) : Set (suc (o ⊔ a ⊔ ℓ)) where | |
infix 4 _≈_ | |
infixr 9 _∘_ | |
field |