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 TypeSynonymInstances #-} | |
data Dual d = D Float d deriving Show | |
type Float' = Float | |
diff :: (Dual Float' -> Dual Float') -> Float -> Float' | |
diff f x = y' | |
where D y y' = f (D x 1) | |
class VectorSpace v where | |
zero :: v |
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 Fib where | |
import Control.Arrow((>>>),(&&&)) | |
import Control.Comonad.Cofree | |
newtype Fix f = In { out :: (f (Fix f) ) } | |
data NatF a = Z | S a deriving Show | |
-- Peano natural numbers as the least fixed point of functor NatF | |
type Nat = Fix NatF |
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
#!/usr/bin/env cabal | |
{- cabal: | |
build-depends: base >= 4.12 | |
, mtl | |
, distributive | |
-} | |
{-# LANGUAGE DerivingVia #-} | |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} |
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, FlexibleInstances #-} | |
module Paychecks where | |
type E = String | |
data Z | |
data S n | |
data Arity k where |
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 DeriveFunctor #-} | |
{-# LANGUAGE LambdaCase #-} | |
import Control.Applicative.Free | |
import Control.Monad | |
import Control.Monad.Free | |
import Control.Monad.Primitive | |
import System.Random.MWC.Probability (Prob) | |
import qualified System.Random.MWC.Probability as MWC |
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 TemplateHaskell, QuasiQuotes, FlexibleInstances, FlexibleContexts, | |
TypeFamilies, GADTs, TypeOperators, DataKinds, PolyKinds, RankNTypes, | |
KindSignatures, UndecidableInstances, StandaloneDeriving, | |
RecordWildCards, DeriveFunctor, DeriveFoldable, DeriveTraversable #-} | |
module AB where | |
import Prelude hiding (lookup, lex) | |
import Control.Applicative ((<|>),empty) | |
import Data.Maybe (maybeToList) |
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
import Control.Monad | |
type Var = Integer | |
type Subst = [(Var, Term)] | |
type State = (Subst, Integer) | |
type Program = State -> KList State | |
data Term = Atom String | Pair Term Term | Var Var deriving Show | |
-- Apply a substitution to the top level of a term |
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 NoMonomorphismRestriction #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
-- * Typed tagless-final interpreters for | |
-- * Linear Lambda Calculus | |
-- * de Bruijn indices | |
-- Linear lambda-calculus: each bound variable | |
-- is referenced exactly once. |
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
tell application "Skim" | |
set theFile to the file of the front document | |
set outText to "" | |
set newLine to ASCII character 10 | |
# Get the relevant bibliographic information for the front PDF in Skim | |
tell application "BibDesk" | |
repeat with currentPub in publications of front document | |
if linked file of currentPub is {} then | |
set bibFile to 0 |
NewerOlder