Skip to content

Instantly share code, notes, and snippets.

@sivawashere
sivawashere / NaturalDeduction.hs
Created December 6, 2015 05:49
Partially implements a natural deduction system in Haskell
{-# LANGUAGE TypeOperators #-}
module NaturalDeduction where
data (⊥) -- no inhabitants
type (¬)p = p -> (⊥)
type (∧) = (,)
type (∨) = Either
type (→) = (->)
modusTollens :: (p → q) ∧ (¬)q → (¬)p
@sivawashere
sivawashere / steadystate.hs
Created October 22, 2015 20:43
Steady state
{-# LANGUAGE RecordWildCards #-}
import Data.Ratio
import Linear.Matrix
import Linear.V3
import Linear.Epsilon
import Control.Monad.Fix
type State = V3 Double
data System = System {