Blogofbrew

home

Specifiying Story Problems with Algebra and Haskell

27 Jan 2016

After having some success with my middle school age kids, I am interested in getting Functional Programming taught along side Algebra in the basic curriculum.

If you are intersted in funding it, I have put up a crowdfunding campaign.

I’m going to keep this page updated with my basic notes. No story problems yet, just your vanilla Algebra operations and identities along with what they roughly translate into as data types and functions in Haskell.

Sum \(A + B\)

data X = A | B
f :: X -> Either A B

Product \(A \times B\)

data X = X A B
f :: X -> (A, B)

Exponential \(B^{A}\)

f :: A -> B

Derivative \({d \over dx}(ax^{n}) = a \times n \times x^{n-1}\)

data N = M | 1
f ::  (a, N -> x)
f' :: (a, N, M -> X)

Curry \((a^{m})^{n} = a^{mn}\)

curry :: n -> m -> a
curry' :: (n,m) -> a

Co-curry \(a^{m}b^{m} = (ab)^{m}\)

f :: (m -> a, m -> b)
f' :: m -> (a,b)

Domain Splitting \(a^{m}a^{n} = a^{m+n}\)

data B = M | N
f :: (M -> a, N -> a)
f' :: B -> a

Function Domain Shrinking \(a^{m} \div a^{n} = a^{m-n}\)

data M = B | N
f :: (M -> a) remove (N -> a)
f' :: B -> a 

Function Co-domain Shrinking \(a^{m} \div b^{m} = ({a \over b})^{m}\)

data A = N | B
f :: (m -> A) remove (m -> B)
f' :: m -> N