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
*.agdai | |
agda-stdlib-* |
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
module Set where | |
import Data.List (nub) | |
--import qualified Data.List.NonEmpty as NE | |
--import Bag | |
-- a set is a functor with a splitter | |
class Applicative f => Set f where | |
split :: f a -> (f a, f a) -- non-deterministic (instance-defined) monotonic splitter |
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 Prelude | |
-- * Power series | |
-- | |
-- treat power series representations of functions | |
-- like numbers and derivatives | |
-- ** Background | |
-- | |
-- http://www.cs.dartmouth.edu/~doug/powser.html |
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
-- * Stuff | |
{-# LANGUAGE DataKinds, RankNTypes, NoMonomorphismRestriction, GADTs, StandaloneDeriving, ScopedTypeVariables #-} | |
module Nameless where | |
import Prelude hiding (abs) | |
-- * Pictures |
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 FlexibleInstances, RankNTypes #-} | |
module Hutton where | |
import Test.QuickCheck | |
-- Hutton's razor | |
-- | |
data Expr = Val Integer | |
| Expr `Add` Expr |
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.Char | |
ch = chr . (+65) | |
-- east quadrant | |
ulam x y | x > y && x > -y = (x*2 - 1)^2 + (x + y) - 1 | |
-- north quadrant | |
ulam x y | x <= y && x > -y = (y*2)^2 - (x + y) |