/ifp212-Functional-Programming-course

Introduction to Functional Programming course assignments

Primary LanguageRacket

Functional-Programming-212

Introduction to Functional Programming course assignments with my partner Matan Nagar .. In this course we learn and practice more with Functional Programming Paradigm

Assignment 1 — F-Numerals

Grade 95

The main porpuse of tis assignment is to be more familiar with Lambda-Calculus (λ-Calculus)

F-numerals is a perverse variation of Church Numerals (Alonzo Church), in this version the Numerals defined as:

f0:= λaλbλc.c

f1:= λaλbλc.(a(a(b c)))

fn:= λaλbλc.(a(a(b ..n-times.. c)))

etc...

We were required in this assignment to implement the basic functions on this numerals, defined and implemented as a pure combinator in the λ-calculusand should make no use of anything other than lambda-expressions and their applications, like:

  • f->integer
  • integer->f
  • Successor
  • Double
  • Triple
  • Plus
  • Multiply
  • Power
  • Show: that returns the concrete syntax for the source-code of the numeral