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
{- Discrete Mathematics Using a Computer | |
Chapter 09: Inductively Defined Sets | |
-} | |
module IndSet where | |
-- ============================================================================= | |
-- 9.1: The Idea Behind Induction | |
{- Suppose we have know that: |
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
{- Discrete Mathematics Using a Computer | |
Chapter 10: Relations | |
-} | |
module Relations where | |
import List (nub) | |
import Stdm (setEq, union, isWeakest, isGreatest, isQuasiOrder, isLinearOrder) | |
import Data.Tuple (swap) | |
-- ============================================================================= |
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
{- Discrete Mathematics Using a Computer | |
Chapter 11: Functions | |
-} | |
module Functions where | |
import Data.Tuple (swap) | |
-- ============================================================================= | |
-- 11.1 The Graph of a Function |
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
{- Discrete Mathematics Using a Computer | |
Chapter 12: AVL Trees | |
AVL Trees: Self-balancing binary trees. | |
-} | |
module AVL where | |
data SearchTree k d = Leaf | |
| Node k d (SearchTree k d) (SearchTree k d) | |
deriving (Show) |
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
{- Discrete Mathematics Using a Computer | |
Chapter 13: Circuit Simulation | |
Story: verify circuit properties using math because actually building and | |
testing is expensive. | |
-} | |
module Main where | |
import Data.List (intersperse) | |
-- Signal is anything that can be manipulated by circuits |
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
Richard Bird - Introduction to Functional Programming using Haskell [2ed] | |
Chapter 01: Fundamental Concepts | |
> module Bird01 where | |
> import Prelude hiding (pi, signum, abs) | |
================================================================================ | |
1.1 Sessions and Scripts | |
Some definitions from the book. I've used more general type signatures. |
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
Richard Bird - Introduction to Functional Programming using Haskell [2ed] | |
Chapter 02: Simple Datatypes | |
> module Bird02 where | |
> import Data.Char (chr, ord) | |
================================================================================ | |
2.1 Booleans | |
> data Bool' = False' | True' |
OlderNewer