Wednesday, January 15, 2014

HASKELL DIFFERENTIAL CALCULUS DERIVATIVE EQUATIONS

HASKELL DIFFERENTIAL CALCULUS DERIVATIVE EQUATIONS

REVISED: Thursday, February 8, 2024




Haskell And Derivatives.  (Note this blog is a work in progress.)

Differential Calculus cuts something into small pieces to find how it changes.

I. DERIVATIVES

A derivative is the slope of a curve, and the rate of change.

The derivative of f (x) is the function

d/dx f(x) = lim h→0 ( f(x + h) − f (x) ) / h = f'(x).

If this limit does not exist (DNE) for a given value of x, then f(x) is not differentiable at x.

Differentiability implies continuity; if f(x) is a differentiable function at x = a, then f(x) is continuous at x = a.

A. First Derivative Test

Suppose that f(x) is continuous on an interval, and that f′(a) = 0 for some value of a in that interval.

(a) If f′(x) > 0 to the left of a and f′(x) < 0 to the right of a, then f (a) is a
local maximum.

(b) If f′(x) < 0 to the left of a and f′(x) > 0 to the right of a, then f (a) is a
local minimum.

(c) If f′(x) has the same sign to the left and right of f′(a), then f′(a) is not a
local extremum.

B. Second Derivative Test

Suppose that f'' (x) is continuous on an open interval and that f' a = 0 for some value of a in that interval.

(a) If f′′(a) < 0, then f (x) has a local maximum at a.

(b) If f′′(a) > 0, then f (x) has a local minimum at a.

(c) If f′′(a) = 0, then the test is inconclusive. In this case, f (x) may or may not have a local extremum at x = a.

C. Trigonometric Function Derivatives

(a) d/dxsin(x) = cos(x).

(b) d/dxcos(x) = − sin(x).

(c) d/dxtan(x) = sec2(x).

(d) d/dxsec(x) = sec(x) tan(x).

(e) d/dxcsc(x) = − csc(x) cot(x).

(f) d/dxcot(x) = − csc2(x).

D. Inverse Trigonometric Function Derivatives

(a) d/darcsin(y) = 1/√(1-y2).

(b) d/darccos(y) = −1/√(1-y2).

(c) d/darctan(y) = 1/(1-y2).

(d) d/darcsec(y) = 1/(|y| √(y2-1)) for |y| > 1.

(e) d/darccsc(y) = −1/(|y| √(y2-1)) for |y| > 1.

(f) d/darccot(y) = −1/(1 + y2).

II. DERIVATIVE RULES

A. CONSTANT RULE

Given a constant c.

d/dx c = 0.

A constant is not changing.

B. SUM RULE

If f(x) and g(x) are differentiable and c is a constant, then:

(a) d/dx (f(x) + g(x)) = f'(x) + g'(x)

(b) d/dx (f(x) - g(x)) = f'(x) - g'(x)

(c) d/dx (c * f(x)) = c * f'(x)

The derivative of a sum is the sum of the derivatives, and the derivative of a difference is the difference of the derivatives.

C. PRODUCT RULE

Let h(x) = f(x) * g(x).

If f and g are differentiable at a, then

h'(a) = f'(a) * g(a) + f(a) * g'(a).

In other words:

d/dx(f(x) * g(x)) = (d/dx f(x)) * g(x) + f(x) * (d/dx g(x))

The derivative of a product is the derivative of the first times the second, plus the first times the derivative of the second.

D. QUOTIENT RULE

Let h(x) = f(x)/g(x).

If g(a) /= 0, and

f and g are differentiable at a, then

h'(a) = ((g(a) * f'(a)) - (f(a) * g'(a)))/g(a)2

The derivative of a quotient is the derivative of the top times the bottom, minus the top times the derivative of the bottom, all over the bottom squared.

E. POWER RULE

For any real number n,

d/dx xn = nxn-1.

Multiply by the power and reduce the power by one.

f x n = n * x ** (n - 1)

F. CHAIN RULE

If f(x) and g(x) are differentiable, then

d/dx f(g(x)) = f′(g(x))g′(x).

We identify the “inside function” and the “outside function”.  We then differentiate the outside function leaving the inside function alone and multiply all of this by the derivative of the inside function.

(a) Look for parentheses.

Dx (un)

(b) Bring exponent to front.

Dx (un) = n(un)

(c) Subtract exponent by one.

Dx (un) = n(un-1)

(d) Multiply by inside derivative.

Dx (un) = n(un-1)Dx (u)

(e) Do not have any negative exponents in answer.

(f) Answer must be as simplified as possible.

(g) √x = x1/2

(h) x-1 = 1/x  

A negative exponent in the numerator means inverse, which becomes a positive exponent in the denominator.

(i) a2 * a3 = a5 

Whenever you multiply two terms with the same base, you can add the exponents.

(j) (a 2) 3 = a6 

Whenever you have an exponent expression that is raised to a power, you can multiply the exponent and power.

(k) (xy2)3 = x3y6 

If you have a product inside parentheses, and a power on the parentheses, then the power goes on each element inside.

(l) Anything to the power zero is just "1".

III. HASKELL DERIVATIVE EXAMPLES

A. CONSTANT RULE



B. SUM RULE



C. PRODUCT RULE



D. QUOTIENT RULE



E. POWER RULE

f x n = n * x ** (n - 1)

Prelude>  let f x n = n * x ** (n - 1)
Prelude>

Prelude>  f 2 3
12.0
Prelude>

F. CHAIN RULE



IV. HASKELL DERIVATIVE THEOREMS

A. DERIVATIVE OF EX THEOREM

d/dx ex = ex

B. FERMAT'S THEOREM

If f(x) has a local extremum at x = a and f(x) is differentiable at a, then f′(a) = 0.

C. DERIVATIVE OF THE NATURAL LOGRITHM THEOREM

d/dx ln(x) = 1/x.

V. PROCEDURE FOR SKETCHING THE PLOTS OF FUNCTIONS

(a) Find the y-intercept, this is the point (0, f (0)). Place this point on your graph.

(b) Find candidates for vertical asymptotes, these are points where f (x) is undefined.

If lim x→a f(x) = ±∞, lim x→a+ f(x) = ±∞, or lim x→a− f(x) = ±∞,

then the line x = a is a vertical asymptote of f (x).

(c) Compute f′(x) and f′′(x).

(d) Find the critical points, the points where f′(x) = 0 or f′(x) is undefined.

(e) Use the second derivative test to identify local extrema and/or find the intervals where your function is increasing/decreasing.

(f) Find the candidates for inflection points, the points where f′′(x) = 0 or f′′(x) is undefined.

(g) Identify inflection points and concavity.

(h) If possible find the x-intercepts, the points where f(x) = 0. Place these points on your graph.

(i) Find horizontal asymptotes.

If lim x→∞ f(x) = L or lim x→−∞ f(x) = L,

then the line y = L is a horizontal asymptote of f(x).

(j) Determine an interval that shows all relevant behavior. At this point you should be able to sketch the plot of your function.

VI. STRAIGHT LINE EQUATIONS

A. SLOPE-INTERCEPT FORM

y = mx + b

This is called the slope-intercept form because "m" is the slope and "b" gives the y-intercept.

B. POINT-SLOPE FORM

Given a point (x1, y1) and a slope m.

y – y1 = m(x – x1)

VII. CONCLUSION

In this tutorial, you have been introduced to using Haskell to solve differential calculus derivative equations.

VIII. REFERENCES

Bird, R. (2015). Thinking Functionally with Haskell. Cambridge, England: Cambridge University Press.

Davie, A. (1992). Introduction to Functional Programming Systems Using Haskell. Cambridge, England: Cambridge University Press.

Goerzen, J. & O'Sullivan, B. &  Stewart, D. (2008). Real World Haskell. Sebastopol, CA: O'Reilly Media, Inc.

Hutton, G. (2007). Programming in Haskell. New York: Cambridge University Press.

Lipovača, M. (2011). Learn You a Haskell for Great Good!: A Beginner's Guide. San Francisco, CA: No Starch Press, Inc.

Thompson, S. (2011). The Craft of Functional Programming. Edinburgh Gate, Harlow, England: Pearson Education Limited.




Monday, January 13, 2014

HASKELL INTEGRAL CALCULUS LIMIT EQUATIONS

HASKELL CALCULUS LIMIT EQUATIONS

REVISED: Thursday, February 8, 2024




Haskell and Limits.  (Note: This blog is a work in progress.)

The word Calculus comes from Latin meaning "small stone". Integral Calculus joins in other words integrates all of the small pieces together to determine the total.

Differential Calculus and Integral Calculus are like inverses of each other, just like multiplication and division are inverses.

I. LIMIT LAWS

Given:

The lim x→a is a special way of saying, ignoring what happens when the value x gets to the value a as the value x moves closer and closer to the value of a the value x becomes a closer and closer approximation of the value of a

A limit is a value that a function approaches as the input x approaches some value.

As shown below, as x approaches a x→a then f(x) approaches L; and as x approaches a x→a then g(x) approaches M.

lim x→a f(x) = L,

lim x→a g(x) = M,

k is some constant,

and n is a positive integer.

A. CONSTANT LAW

lim x→a k f(x) = k (lim x→a f(x)) = k L.

The limit of a constant is that constant provided that limit exists.

B. SUM LAW

lim x→a (f(x) + g(x)) = lim x→a f(x) + lim x→a g(x) = L + M.

The limit of the sums is the sum of the limits provided those limits exist.

C. PRODUCT LAW

lim x→a (f(x) g(x)) = lim x→a f(x) · lim x→a g(x) = L M.

The limit of the products is the product of the limits provided those limits exist.

D. QUOTIENT LAW

lim x→a (f(x) / g(x)) = (lim x→a f(x))/(lim x→a g(x)) = L / M, if M  /=  0.

The limit of the quotients is the quotient of the limits provided those limits exist and the denominator is nonzero.

E. POWER LAW

lim x→a f(x)n = (lim x→a f(x))n = Ln.

F. ROOT LAW

lim x→a n√f(x) = n√lim x→a f(x) = n√L provided if n is even, then f(x) ≥ 0 near a.

G. COMPOSITION LAW

If lim x→a g(x) = M and lim x→M f(x) = f(M), then lim x→a f(g(x)) = f(M).

II. LIMIT DEFINITIONS

A. OFFICIAL LIMIT DEFINITION 

ε is epsilon the lower case of the fifth letter of the Greek alphabet.

δ is delta the lower case of the fourth letter of the Greek alphabet.

lim xa f(x) = L means

for all ε > 0,

there is δ > 0,

so that if x /= a and x is within δ of a ( δ is measuring how close x is to a )

then f(x) is within ε of L ( ε is measuring how close f(x) is to L )

If no such value of L can be found, then we say that the lim xa f(x) does not exist (DNE). 

B. ONE-SIDED LIMIT DEFINITION

We say that the limit of f(x) as x goes to a from the left is L,

lim x→a− f(x) = L

if for every ε > 0 there is a δ > 0 so that whenever x < a and

a − δ < x we have |f(x) − L| < ε.

We say that the limit of f(x) as x goes to a from the right is L,

lim x→a+ f(x) = L

if for every ε > 0 there is a δ > 0 so that whenever x > a and

x < a + δ we have |f(x) − L| < ε.

III. USEFUL HASKELL TRIGONOMETRIC FUNCTIONS

Remember Calculus is computed using radians not degrees.

To convert degrees into radians multiply the degrees by pi/180o.

For example, using Haskell 200converted into radians equals 3.490658503988659 radians as shown using the function below.

f x = x * pi / 180

Some useful built in Haskell Trigonometric functions are as follows:

sin

cos

tan

asin

atan

acos

sinh

tanh

cosh

asinh

atanh

acosh

IV. HASKELL LIMIT EXAMPLES

A. CONSTANT LAW



B. SUM LAW



C. PRODUCT LAW



D. QUOTIENT LAW



E. POWER LAW



F. ROOT LAW



G. COMPOSITION LAW



V. HASKELL LIMIT THEOREMS

A. INTERMEDIATE VALUE THEOREM

If f(x) is a continuous function for all x in the closed interval [a,b] and d is in between f(a) and f(b), then there is a number c in [a,b] such that f(c) = d.

B. SQUEEZE THEOREM

Suppose that g(x) ≤ f(x) ≤ h(x) for all x close to a but not necessarily equal to a. If

lim x→a g(x) = L = lim x→a h(x),

then lim x→a f(x) = L.

VI. CONCLUSION

In this tutorial, you have been introduced to using Haskell to solve integral calculus limit equations.

VII. REFERENCES

Bird, R. (2015). Thinking Functionally with Haskell. Cambridge, England: Cambridge University Press.

Davie, A. (1992). Introduction to Functional Programming Systems Using Haskell. Cambridge, England: Cambridge University Press.

Goerzen, J. & O'Sullivan, B. &  Stewart, D. (2008). Real World Haskell. Sebastopol, CA: O'Reilly Media, Inc.

Hutton, G. (2007). Programming in Haskell. New York: Cambridge University Press.

Lipovača, M. (2011). Learn You a Haskell for Great Good!: A Beginner's Guide. San Francisco, CA: No Starch Press, Inc.

Thompson, S. (2011). The Craft of Functional Programming. Edinburgh Gate, Harlow, England: Pearson Education Limited.




Thursday, January 9, 2014

HASKELL INVERSE FUNCTIONS

HASKELL INVERSE FUNCTIONS

REVISED: Thursday, February 8, 2024




Haskell Inverse Functions.

I. FUNCTION

A function is a relation between sets where for each input there is exactly one output. We call the set a function is mapping from the domain or source the input; and we call the set a function is mapping to the range or codomain the output.

Let f be a continuous real injective and surjective function defined on a closed interval [(x1,y1),(x2,y2)].

Using Haskell:

f x = y

An injective function is one such that no two elements in the domain map to the same value in the codomain or range.

A one-to-one function is one such that for every value in the codomain or range there is exactly one value in the domain.

A surjective function is one such that for each element in the codomain or range there is at least one element in the domain that maps to it.

A bijective function is both injective and surjective.

In order for a function to have an inverse function it must be bijective and one-to-one.

A. FUNCTION INVERSE

A plot gives y as a function of x if every vertical line crosses the plot at most once, this is commonly known as the vertical line test. A function is one-to-one if every horizontal line crosses the plot at most once, which is commonly known as the horizontal line test. We can only find an inverse to a function when it is one-to-one otherwise we must restrict the domain.

If a function f maps every input to exactly one output an inverse of that function maps every output to exactly one input. The inverse of f is well-defined if and only if f is bijective and one-to-one.

A multiplicative inverse or reciprocal for a number x denoted by 1/x or x-1 is a number which when multiplied by x yields the multiplicative identity, 1.

The derivative of a function f(x) at x is the slope of the tangent line at x.

Using Haskell to find the slope of a line.

"Copy Paste" the following module into your text editor and "File, Save As" Slopes.hs to your working directory:

module Slopes where

slopew :: Fractional a => (a, a) -> (a, a) -> a
slopew (x1,y1) (x2,y2) = dy/dx
                                          where dy = y2 - y1
                                                      dx = x2 - x1

slopel :: Fractional a => (a, a) -> (a, a) -> a
slopel (x1,y1) (x2,y2) = let dy = y2 - y1
                                              dx = x2 - x1
                                          in dy/dx

GHCi, version 9.8.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude>

Load the module Slopes into GHCi as follows:

Prelude>  :load Slopes.hs
[1 of 1] Compiling Main             ( Slopes.hs, interpreted )
Ok, modules loaded: Main.
Prelude>

Call the function slopew as follows:

Prelude>  slopew (1,1) (2,2)
1.0
it :: Fractional a => a
Prelude>

Call the function slopel as follows:

Prelude>   slopel (1,1) (2,2)
1.0
it :: Fractional a => a
Prelude>  

The range of the function f is the interval [(x1,y1),(x2,y2)], or [(x2,y2),(x1,y1)] if (x2,y2) < (x1,y1).

The function which maps the range or codomain y to the domain or source x is called the inverse of the function f.

For example, suppose you are filling the gas tank of your car and there are 4 gallons of gas in your tank when you start. The volume of gas in gallons after t seconds of filling your gas tank at the rate of 2 gallons per second is given by volume as a function of time v(t):

v(t) = 2t + 4
v(t) = 2(t + 2)
v = 2(t + 2)

Using Haskell, volume as a function f time v(t), in this case is:

v :: Num a => a -> a
v t = 2 * ( t + 2 )

GHCi, version 9.8.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude>

Prelude>  let v t = 2 * ( t + 2 )
v :: Num a => a -> a
Prelude>

Prelude>  v 0     -- Time is zero when you start pumping the gas.
4                          --  At time zero you start with 4 gallons of gas in your tank.
it :: Num a => a
Prelude>  

What is the inverse of the function v(t); and what does the inverse of the function v(t) tell us? While v(t) tells us how many total gallons of gas are in the tank after a period of time in seconds the inverse of v(t) tells us how much time in seconds must be spent to fill our tank with a given total volume of gas in gallons.

To compute the inverse of volume as a function of time v(t) first set v = v(t) and then compute time as a function of volume t(v) as follows:

v(t) = 2(t + 2)
v = 2(t + 2)

Solving for t:

v /2 = t + 2
v /2 - 2 = t
t = v /2 - 2
t = v/2 - 4/2
t = 1/2(v - 4)

This is a function that maps volume in gallons to time in seconds:

t(v) = 1/2(v – 4)
t = 1/2(v – 4)

Using Haskell time as a function of volume t(v) is:

t :: Fractional a => a -> a
t v = 1/2 * (v – 4)

GHCi, version 9.8.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude>

Prelude>  let t v = 1/2 * (v - 4)
t :: Fractional a => a -> a
Prelude>

Prelude>  t 4   -- You start with 4 gallons of gas in your tank.
0.0                    -- You start at time zero.
it :: Fractional a => a
Prelude>

Therefore, as shown in Haskell the inverse of volume as a function of time v(t):

v :: Num a => a -> a
v t = 2 * ( t + 2 )

is time as a function of volume t(v):

t :: Fractional a => a -> a
t v = 1/2 * (v – 4)

III. INVERSE FUNCTION THEOREM

If f(x) is a differentiable function, and f'(x) is continuous, and f'(a) /= 0, then

(a) f-1(y) is defined for y near f(a),

(b) f-1(y) is differentiable near f(a),

(c) d/dy f-1(y) is continuous near f(a), and

(d) d/dy f-1f(y) = 1/(f'(f-1(y))).

IV. CONCLUSION

In this tutorial you have been introduced to Haskell inverse functions.

V. REFERENCES

Bird, R. (2015). Thinking Functionally with Haskell. Cambridge, England: Cambridge University Press.

Davie, A. (1992). Introduction to Functional Programming Systems Using Haskell. Cambridge, England: Cambridge University Press.

Goerzen, J. & O'Sullivan, B. &  Stewart, D. (2008). Real World Haskell. Sebastopol, CA: O'Reilly Media, Inc.

Hutton, G. (2007). Programming in Haskell. New York: Cambridge University Press.

Lipovača, M. (2011). Learn You a Haskell for Great Good!: A Beginner's Guide. San Francisco, CA: No Starch Press, Inc.

Thompson, S. (2011). The Craft of Functional Programming. Edinburgh Gate, Harlow, England: Pearson Education Limited.



Thursday, January 2, 2014

HASKELL QUICKCHECK GENERATOR COMBINATORS

HASKELL QUICKCHECK GENERATOR COMBINATORS

REVISED: Thursday, Februray 8, 2024




Haskell QuickCheck Generator Combinators.

I. GENERATOR COMBINATORS

QuickCheck is a tool for testing Haskell programs automatically. The programmer provides a specification of the program, in the form of properties which functions should satisfy, and QuickCheck then tests that the properties hold in a large number of randomly generated cases. Specifications are expressed in Haskell, using combinators defined in the QuickCheck library. QuickCheck provides combinators to define properties, observe the distribution of test data, and define test data generators.

Haskell QuickCheck includes a set of combinators that allow us to create custom instances for our own types.

A. choose

The first of these combinators is `choose`.

choose takes an interval and returns a random element from that interval. For example, the following is a randomly chosen set of numbers between `0` and `9`.

GHCi, version 9.8.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude>

Prelude> import Test.QuickCheck
Prelude>

Prelude> import Control.Monad
Prelude>

Prelude> import Data.List
Prelude>

Prelude> :type choose
choose :: System.Random.Random a => (a, a) -> Gen a
Prelude>

Prelude> sample $ choose (0, 9)
Loading package bytestring-0.9.2.1 ... linking ... done.
Loading package Win32-2.2.2.0 ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package old-locale-1.0.0.4 ... linking ... done.
Loading package time-1.4 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package QuickCheck-2.5.1.1 ... linking ... done.
2
5
2
9
5
3
6
4
5
3
5
it :: ()
Prelude>

B. elements

A second combinator is `elements` which returns a generator that produces values drawn from an input list.

elements takes a list and returns a random element from that list. For example, the following is a list of numbers between `10` and `90`.

Prelude> :type elements
elements :: [a] -> Gen a
Prelude>

Prelude> sample $ elements [10, 20..90]
90
90
30
60
80
70
70
60
20
30
40
it :: ()
Prelude>

C. oneof

A third combinator is `oneof` which allows us to randomly choose between multiple generators.

Prelude> :type oneof
oneof :: [Gen a] -> Gen a
Prelude>

Prelude> sample $ oneof [elements [10,20..90], choose (0, 9)]
3
6
8
8
2
3
4
2
8
20
8
it :: ()
Prelude>

D. frequency

A fourth combinator is 'frequency' which allows us to build weighted combinations of individual generators.

Prelude> :type frequency
frequency :: [(Int, Gen a)] -> Gen a
Prelude>

E. forAll

A fifth combinator is 'forAll' which can be used to check the output of a custom generator.

Prelude> :type forAll
forAll
    :: (Testable prop, Show a) => Gen a -> (a -> prop) -> Property
Prelude>

II. CHANGING NUMBER OF QUICKCHECK TESTS

Prelude> let quickCheckN n = quickCheckWith $ stdArgs { maxSuccess = n }
Loading package bytestring-0.9.2.1 ... linking ... done.
Loading package Win32-2.2.2.0 ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package old-locale-1.0.0.4 ... linking ... done.
Loading package time-1.4 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package QuickCheck-2.5.1.1 ... linking ... done.
quickCheckN :: Testable prop => Int -> prop -> IO ()
Prelude>

Prelude> let isOrdered (x1:x2:xs) = x1 <= x2 && isOrdered (x2:xs)
isOrdered :: Ord a => [a] -> Bool
Prelude>

Prelude> let isOrdered _ = True
isOrdered :: t -> Bool
Prelude>

Prelude> let prop_sort_isOrdered = isOrdered . sort
prop_sort_isOrdered :: Ord a => [a] -> Bool
Prelude>

Prelude> quickCheckN 10000 prop_sort_isOrdered
+++ OK, passed 10000 tests.
it :: ()
Prelude>

III. CONCLUSION

In this tutorial, you have been introduced to Haskell QuickCheck generator combinators.

IV. REFERENCES

Bird, R. (2015). Thinking Functionally with Haskell. Cambridge, England: Cambridge University Press.

Davie, A. (1992). Introduction to Functional Programming Systems Using Haskell. Cambridge, England: Cambridge University Press.

Goerzen, J. & O'Sullivan, B. &  Stewart, D. (2008). Real World Haskell. Sebastopol, CA: O'Reilly Media, Inc.

Hutton, G. (2007). Programming in Haskell. New York: Cambridge University Press.

Lipovača, M. (2011). Learn You a Haskell for Great Good!: A Beginner's Guide. San Francisco, CA: No Starch Press, Inc.

Thompson, S. (2011). The Craft of Functional Programming. Edinburgh Gate, Harlow, England: Pearson Education Limited.