Technology

Tag Archives

Archive of posts published in the category: Functional
Apr
28

Functional Programming and the J Programming Language

Functional Programming and the J Programming Language

Abstract:

A brief introduction to functional programming is given
using the J programming language for examples. Several examples
show the expressive power of functional languages and their application
to topics in mathematics. Use of the J language as a substitute
for mathematical notation is discussed.

Subject Areas: Functional Programming, J Programming Language.

Keywords: Functional Programming, J Programming Lanugage.

A computer is a mechanism for interpreting a language.
Computers interpret (perform the actions specified in) sentences
in a language which is known as the computer’s machine language.
It follows, therefore, that a study of the organization of computers
is related to the study of the organization of computer languages.

Computer languages are classified in a variety of ways. Machine languages
are rather directly interpreted by computers. Higher level computer languages
are often somewhat independent from a particular computer and require
translation (compilation) to machine

Read More
Apr
25

Functional programming in C# – CodeProject

Table of contents

  1. Introduction
  2. Functions as first-class values
  1. Function types
  2. Function values
  3. Function/delegate arithmetic 
  • C# Functional programming 
    1. Using LINQ
    2. Higher-order functions 
    3. Asynchronous functions
    4. Tuples
    5. Closures 
    6. Recursion 
    7. Partial functions
    8. Curry functions
  • Conclusion
  • History 
  • Introduction 

    Functional programming is a programming paradigm in C# that is frequently combined with object oriented programming. C# enables you to use imperative
    programming using object-oriented concepts, but you can also use declarative programming. In declarative programming, you are using
    a more descriptive way to define
    what you want to do and not how you want to do some action. As an example, imagine that you want to find
    the top 10 books with price less than 20 ordered by title.
    In functional programming, you will define something like:

    books.Where(price<20).OrderBy(title).Take(10);

    Here you just specify that you want to select books where the price is less than 20, order them by title, and take
    the first ten.

    Read More