CS 330 Lecture 27 – List Comprehensions and On To C++
Agenda what ?s list comprehensions in Haskell functional vs. non-functional OOP vs. non-OOP imperative the pillars of OOP (encapsulation, inheritance, polymorphism) initialization lists a polynomial hierarchy TODO Read http://hacksoflife.blogspot.com/2010/12/what-oop-isnt.html. Read the comments too. Agree or disagree? Quarter sheet. Code vowels.hs listcomps.hs waaaaaaaaaaaa.hs Functions.h Functions.cpp graph.cpp makefile Note to copy and pasters: makefile rules need to be […]
CS 330 Lecture 26 – More Folding, Composing, Custom Data Types
Agenda more folding: join, length, map, find, filter folding on 1+ lists: min, max composing: countOvers, any, all custom data types: an expression hierarchy making something an Ord TODO Read chapter 9 through section 9.2.2. Quarter sheet. Code today.hs Haiku
CS 330 Lecture 25 – Currying and The One-Liner
Agenda what ?s what does this do? the Maybe/Option type currying and how to read Haskell function specifications find’ in an association list/hash point-free style foldl and foldr or’ and’ sum’ product’ min’ foldr1′ max’ join’ length’ average’ map’ countOvers composing functions any’ all’ TODO Play. And homework. What Does This Do? Code today.hs Haiku
CS 330 Lecture 24 – Promises, Tail Recursion, and Currying
Agenda what ?s delaying evaluation tail recursion partially applying functions TODO Read http://learnyouahaskell.com/higher-order-functions again. No quarter sheet. Code macro.c promise.html sum.hs Haiku
CS 330 Lecture 23 – Guards, Tail Recursion, and Higher-order Functions
Agenda what ?s replicate program this guards tail recursion higher-order functions map filter lambda TODO Read http://learnyouahaskell.com/higher-order-functions. Quarter sheet. Program This Code today.hs Haiku
iMessage “DoS” Attack
I would be surprised if I’m the only student in this program who thinks small hacking pranks and minor harmless attacks on unsuspected folks are both fun and educational. This weekend I learned AppleScript, which for the Mac OS X-impaired folks, that’s a really nice scripting editor that comes standard on all OS X machines. […]
CS 330 Lecture 22 – Tuples, List Comprehensions, and Thinking Looplessly
Agenda what ?s logo tuples list comprehensions initials head’ pattern matching case vs. function definition patterns sum’ product’ factorial’ reverse’ Code test.hs Haiku
CS 330 Lecture 21 – Hello, Haskell
Agenda office hours: come find me anytime between 9 and 4 midterm discussion the problem with imperative languages: mutability functional languages Haskell implicit typing operators lists and ranges conditionals functions TODO Read http://www.haskell.org/haskellwiki/Introduction. Quarter sheet. Code test.hs
CS 330 Homework 5 – Fun Fun
See the PDF.
CS 330 Lecture 20 – A Logo Compiler with Conditionals and Loops
Agenda what ?s interpreting vs. compiling modeling a program: follow the grammar what to do on undeclared variables? adding loops adding conditionals TODO Write a Logo program and drop it in your submissions directory in W330. Name your file todo.logo. Be exactly exact. We will have a gallery showing on Monday. You are encouraged to […]