Lisp like s-expressions in haskell

Kind of interesting to write lisp like code in haskell. Note, all of this is valid haskell:

Prelude> ((+) ((*) 1 2) 10)
12

Prelude> (1 * 2) + 10
12

Prelude Text.Printf> (printf "%d\n" 5)
5
Prelude Text.Printf> printf "%d %d\n" 1 2
1 2
Prelude Text.Printf> ((printf "%d %d\n" 1) 2)
1 2

Of course, you have to match up the arguments in haskell accordingly; not all functions take a just a list like you might find in common lisp.

Comments

Popular posts from this blog

JVM Notebook: Basic Clojure, Java and JVM Language performance

On Unit Testing, Java TDD for developers to write

Is Java the new COBOL? Yes. What does that mean, exactly? (Part 1)