Skip to Content
Learning Functional Programming in Go
book

Learning Functional Programming in Go

by Lex Sheehan
November 2017
Intermediate to advanced
670 pages
17h 35m
English
Packt Publishing
Content preview from Learning Functional Programming in Go

Isomorphic equations

We have learned the following isomorphic equations:

  • (C,A) x (C,B) = (C, AxB)
  • (A,C) x (C,B) = (A+B, C)
  • (C x A,B) = (C, [A⇒B])

In first equation, what does it mean to have an arrow from C to AxB?

A: We have a pair of arrows, an arrow from C to A and an arrow from C to B.

Similarly for 2 and 3.

If C is a finite set with exactly C objects in it, and A is a finite set with exactly A things in it, then how many ways are there to get from C to A?

Answer: There are A X C different ways of getting from C to A

How many functions are there from n variables onto 2?

Answer: 2n

Do you see the direct correspondence between the categorical isomorphic equations and the laws of exponents we learned in high school?

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781787281394Supplemental Content