Giter VIP home page Giter VIP logo

Comments (8)

jethrolarson avatar jethrolarson commented on May 17, 2024 2

PRS are always welcome. Understandability is more important than accuracy in this document so if you can think of a good, simple wording I'm sure it'll get pulled

from functional-programming-jargon.

daira avatar daira commented on May 17, 2024 2

Feel free to assign this to me.

from functional-programming-jargon.

beckyconning avatar beckyconning commented on May 17, 2024

👍

from functional-programming-jargon.

hemanth avatar hemanth commented on May 17, 2024

@daira Thank you, please feel free to do a PR.

from functional-programming-jargon.

vicentedealencar avatar vicentedealencar commented on May 17, 2024

Untill now I understood that referencial transparency and purity were the same thing, but it turns out a function can be referentially transparent and have side effects, so it is not pure.

Any reason why Referencial Transparency is so far below purity and side-effects? I think the right order of jargons helps alot, and as I understand that purity = referential transparency + no side effects purity should be last shown of these three.

I am new to these concepts and haven't used any strictly functional language yet, so feel free to ignore me.

from functional-programming-jargon.

clarus avatar clarus commented on May 17, 2024

A side effect is an operation which is not pure. The purity implies the referential transparency (see the confluence of the lambda calculus). A function can also be observationaly pure, but with side effects inside. For example :

function sum(a, b) {
  let s = a;
  s = s + b;
  return s;
}

We do a mutation s = s + b, so a side effect. However, the function sum is observationaly pure as it always returns the same result given the same arguments, and does not modify its environment.

from functional-programming-jargon.

stereobooster avatar stereobooster commented on May 17, 2024

Interesting classification of effects done in this paper

but the basic effects defined in Koka are total, exn, div, ndet,
alloc<h>, read<h>, write<h>, and io. Of course total is not really an effect but signifies the absence of any effect and is assigned to pure mathematical functions. When a function can throw an exception, it gets the exn effect. Potential divergence or non-termination is signified by the div effect. Currently, Koka uses a simple termination analysis based on inductive data types to assign this effect to recursive functions. Non-deterministic functions get the ndet effect. The effects alloc<h>, read<h> and write<h> are used for stateful functions over a heap h. Finally io is used for functions that do any input/output operations.
alias total = <>
alias pure = <exn, div>
alias st<h> = <alloc<h>, read<h>, write<h>>
alias io = <st<ioheap>, pure, ndet>

from functional-programming-jargon.

stereobooster avatar stereobooster commented on May 17, 2024

Add totality definition http://alvinalexander.com/photos/totality-rule-functional-programming

from functional-programming-jargon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.