COP 4020 Programming Languages I
January 7, 2013
Homework 1: Overview and Picking Languages
See Webcourses2 and the syllabus for due dates.
In this homework you will get an overview of programming languages [Concepts] [EvaluateModels]. You will also
becom
1
Fall, 2011
Name:
COP 4020 Programming Languages I
Test on the Declarative Model
Special Directions for this Test
This test has 12 questions and pages numbered 1 through 7.
This test is open book and notes, but no electronics.
If you need more space, use
1
Spring, 2013
Name:
(Please do not write your id number!)
COP 4020 Programming Languages I
Test on Haskell and Functional Programming
Special Directions for this Test
This test has 7 questions and pages numbered 1 through 8.
This test is open book and no
COP 4020 Programming Languages I
March 18, 2013
Homework 4: HigherOrder Functional
Programming
See Webcourses2 and the syllabus for due dates.
Purpose
In this homework you will learn more advanced techniques of functional programming such as using
higher
 $Id$
module BetterTree where
 This datatype was designed in class
data BetterTree a = Empty
 Leaf a
 Node cfw_left:(BetterTree a),
value:a,
right:(BetterTree a)
deriving (Eq, Show)
 treeMap and deleteNode are functions that we used to abstrac
Lecture * Outline *

* Builtin types of Haskell
According to Abelson and Sussman: each language has:
 means of computation (data and operations)
 means of combination (structured data and composition techniques)
 means of abstraction
In this topi
Lecture * Outline *
> module BuiltInTypes where
> import Prelude hiding (fst, snd, head, tail, filter, zip)
* Builtin types of Haskell
According to Abelson and Sussman: each language has:
means of computation (data and operations)
means of combina
module All where
import Prelude hiding (all)  so we don't conflict with the builtin "all"
 explict recursions
all p [] = True
all p (a:as) = p a & (all p as)
all' p [] = True
all' p (a:as) = if p a
then (all p as)
else False
 extra ones
 using a li
COP 4020 Programming Languages I
April 9, 2013
Homework 5: Advanced Haskell Topics
See Webcourses2 and the syllabus for due dates.
Purpose
In this homework you will consolodate your knowledge of functional programming, and get a taste of two
advanced tech
COP 4020 Programming Languages I
April 18, 2013
Homework 6: Erlang and Message Passing
Programming
See Webcourses2 and the syllabus for due dates.
Purpose
In this homework you will explore programming in Erlang, doing a bit of functional programming, but
COP 4020 Programming Languages I
January 30, 2013
Homework 3: Functional Programming in Haskell
See Webcourses2 and the syllabus for due dates.
Purpose
In this homework you will learn basic techniques of recursive programming over various types of
(recurs
import Prelude hiding (sqrt)
sumFromTo i j = sumFromToIter (j,0)
where sumFromToIter (j,r) =
if i > j then r else sumFromToIter (j1,r+j)
sqrt x = sqrtIter 1.0
where sqrtIter guess =
if goodEnough guess then guess
else sqrtIter (improve guess)
wher
> main = do
> putStrLn "How old are you? "
> line < getLine
> real_age < readIO line : IO Double
> let age = if real_age > 21 then 21 else real_age
> putStrLn ("You look like " + (show age)
COP 4020 Programming Languages I
January 10, 2013
Homework 2: Reections on Learning Programming
Languages
See Webcourses2 and the syllabus for due dates.
In this homework you will note techniques that you found were helpful for learning new programming la
data Color = Red  Yellow  Green deriving (Eq, Show)
convertColorToInt : Color > Int
convertColorToInt Red = 1
convertColorToInt Yellow = 2
convertColorToInt Green = 3
compose : (b > c) > (a > b) > a > c
compose f g = (f . g)
compose' : (b > c) > (a > b) > a > c
compose' f g x = f (g x)
inc x = x + 1
inc2 = compose inc inc
quiz on functions as first class values
* quiz (just for fun, not graded)
Do one of the first two, and then some of the others
if you finish early
* Given the following definitions
> a1 x y = x
> a2 x y = y
> m x y f = f x y
> a z = z a1
> r z = z a2
Wh
I. Introduction to Haskell
A. What's interesting about Haskell?

FUNCTIONAL PROGRAMMING
 Models computations as expressions
 All changing arguments passed explicitly
(no implicit global state)
 Functions as data allows better abstraction
FEATURES
Introduction
Day 1 Page 1
Day 1 Page 2
Tuesday and Thursday
7am  8:45am
Email
Day 1 Page 3
Textbooks
Other notes
Dr. Leaven's notes and these notes will be
posted on WebCourses
https:/wiki.haskell.org/Tutorials
http:/www.eecs.ucf.edu/~leavens/COP4020/
Cool resources
A free book:
http:/learnyouahaskell.com/
The author also has an Erlang counterpart:
http:/learnyousomeerlang.com/
Day 2 Page 1
If you want some practice, I've found these exercises lots of fun:
https:/wiki.haskell.org/H99:_NinetyNine_Hask
I. Overall Tips for Learning Programming Languages
A. implementation

WHAT TO SEARCH FOR?
 implementation (compiler, interpreter)
 possibly a programming environment
 documentation
Minimal environment:
 A text editor (Emacs)

B. documentation