Quantcast
Channel: What type of formal notation is being used here to represent functional algorithms? - Computer Science Stack Exchange
Viewing all articles
Browse latest Browse all 3

What type of formal notation is being used here to represent functional algorithms?

$
0
0

Interested in learning more about algorithm design in functional programming, I picked up Andrew Bird's Pearls of Functional Algorithm Design. I have experience with a number of programming languages, but my only experience with functional programming is in Scala. I understood that I would have to pick-up Standard ML and Haskell from the description of the book, but when I started reading the first section, I wasn't familiar with some of the operators being used.

Here are some examples of function definitions from the first chapter of the book (free to preview on Amazon):


weird syntax

I have seen "^" and "v" used to represent "and" and "or," but some of the other syntax (like False (0,n)) still throws me off.

more weird syntax

In this one, I'm not sure what the accumArray(+)... is referring to. I'm thinking it's like a fold method using addition, but I don't understand the rest of the line.

kinda weird

Here, the author has done a good job of describing that \\ is set difference and the two vertical lines crossed with a horizontal one is union. However, I've never seen anything like that union symbol before.


I don't want to know what each of these examples means as much as I want to know what library of formal representation is Bird using to represent these algorithms, and also, if a specific programming language (Haskell/SML?) syntax is being used as well in conjunction with these special symbols.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images