Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have to make a presentation about Haskell, and I'm looking for interesting Haskell examples, tips, and topics in general I should not miss in my presentation.

The purpose of the presentation is to give a general idea about the language.

I'm still writing what I'll say, but the following topics are already included:

  • Lazy evaluation
  • Ways of defining functions (pattern matching, lambda expressions, etc)
  • Higher order functions and currying

What do you think that must be explained when doing a talk about Haskell?

share|improve this question
2  
Hope you upload and share the presentation after done. –  Gulshan Apr 29 '11 at 4:56
2  
What is the audience? –  LennyProgrammers Apr 29 '11 at 6:29
1  
@Lenny222 I'm studying Computer Science in 3rd year of the career, and the audience will be the students of my classrom. –  Oscar Mederos Apr 29 '11 at 6:40
    
I would stress pure-functionality. Back then i was amazed, that you can guess by the declaration of e.g. "fst :: (a, b) -> a" what the function can only do. I also find code a lot easier to read, when i don't have to pay attention to variable reassignments. –  LennyProgrammers Apr 29 '11 at 8:02
    
@Lenny222 You should write this as an answer. –  Oscar Mederos Apr 29 '11 at 8:13
show 2 more comments

5 Answers

Haskell as a language for difficult problems (for the reasons in "haskell's niche: hard problems": the type system supporting fundamental changes; domain specific languages; and naming concepts), but most of all, imho, because the abstractions are close to the mathematical ones. With OO I always have the need "to play computer" at some level to fully understand; with Haskell I can rely much more on pure reasoning.

share|improve this answer
add comment

I would stress pure-functionality. Back then i was pretty amazed to learn, that you can guess by the declaration of e.g. "fst :: (a, b) -> a" what the function can only do.

I also find code a lot easier to read, when i don't have to pay attention to variable reassignments.

share|improve this answer
add comment

I always show off some elegant Haskell snippets when I'm preaching Haskell to friends and colleagues. Two-line quicksort and the ~22-character code generating the endless list of primes are two of my favorites.

I would also say something about concurrency, as this is increasingly important, and is also a key factor in making functional languages more and more popular. You could briefly mention that since Haskell is purely functional it is (mostly) stateless - which means that it doesn't require locking. You could also go a little deeper and say something about software transactional memory (STM) in Haskell.

share|improve this answer
    
Interesting. Didn't know about the primes generator. I'm seeing it now... definitely I'll include that! I already had Quicksort ;) –  Oscar Mederos Apr 29 '11 at 8:02
    
by the way, do you have a link to the prime generator that is approx. 22 characters? –  Oscar Mederos Apr 29 '11 at 8:13
    
@OscarMederos Code: nubBy(((>1) .) . gcd) [2..] Link: gimbo.org.uk/blog/2007/04/28/primes-one-liner-in-haskell Note that you have to import List. –  Lstor Apr 29 '11 at 9:39
add comment

I would talk about the type system

share|improve this answer
    
Heh. Duh. *facepalm* Assumptions make an "ass" out of "u" and "mptions". –  Rein Henrichs Apr 29 '11 at 6:11
add comment
  • Monads
  • Point free style
  • List comprehension (bonus points for relating back to monads)

Edit: making this CW FOR JUSTICE.

share|improve this answer
    
@Rein Yes, that's something I have in mind too, but still need to learn about Monads. –  Oscar Mederos Apr 29 '11 at 4:51
1  
Teaching something is the best way to learn it. –  Rein Henrichs Apr 29 '11 at 4:53
    
+1 for Point free style (I'd also give a +1 for the other two, but alas, I cannot) –  alternative Apr 29 '11 at 10:49
    
I don't think there will be time to get to monads, unless this is a fairly sophisticated audience. –  Eric Wilson Apr 29 '11 at 13:47
    
I doubt there'll be much time to get to the pointless style either unless you have a pretty sophisticated audience. –  JUST MY correct OPINION Apr 30 '11 at 13:56
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.