42 karma · joined Jan 12, 2014 (12y ago) · 21 submissions
comment 8y ago · link · parent
The logical equivalent of this is an axiom (P -> P) -> P which lets you prove anything. So non-termination in a programming language corresponds to being able to prove anything - including False - in the logic.
comment 8y ago · link · parent
y <- x + 1
z <- x + 2
is a legal SSA expression, but it is not a legal linear expression because x appears twice.
(Corrections welcome)
comment 8y ago · link · parent
This is nice for functional programming because it gives you the performance of mutable state and destructive update, but in a way that is 'pure', or side-effect free, from the outside.
comment 8y ago · link · parent
I'm one of the dumb ones and just let the computer do the checking for me.
comment 8y ago · link · parent
[1] https://medium.com/fhinkel/runtime-type-information-for-java...
comment 9y ago · link · parent
You can also add F# computation expressions to the list!
comment 9y ago · link · parent
Also, trying to explain Monad, Comonad, or Applicative as 'jargon' is probably a step too far IMO. They are not important for getting started with FP, and describing them without their equational properties is kind of meaningless.
That being said I liked alot of the inclusions; partial application, closure, composition. I think the collection is probably slightly guilty of trying to be too clever by including advanced concepts.
comment 9y ago · link · parent
The motivation for dynamic checking was often because many JavaScript programs couldn't be given any useful static types. With the great work on Flow and TypeScript I'm starting to become convinced that we'll just be able to statically check most JavaScript programs in the future and get decent types out.
comment 9y ago · link · parent
INPUT >>> function add(f, b) { return f(b); };
let a = add(function(x) {return x + 1}, 3);
OUTPUT >>> function add(f: function, b: number): number { return f(b); };
let a: number = add(function(x: number): number {return x + 1}, 3);
and I noticed that the flow type annotations are added to the call site, rather than on the argument f in the definition of add. Are all the types that you generate first order?
comment 9y ago · link · parent
Sounds like you are describing Session Types!
(http://groups.inf.ed.ac.uk/abcd/) (http://summerschool2016.behavioural-types.eu/programme/Dardh...)
comment 9y ago · link · parent
[1] http://crest.cs.ucl.ac.uk/autotransplantation/downloads/auto...
comment 9y ago · link · parent
Time again I'm always surprised by how people over look type systems when talking about functional languages. Really, much of that list is not fundamental to FP, but always giving me an Int when you promise one matters.
comment 10y ago · link · parent
However, I would also distinguish the "in-game" gambling in Hearthstone from CSGO because there is no legitimate or practical way to monetize your card collection. Once (or if) you have all the cards, there is little incentive to keep buying packs as you can only play with cards. In CSGO however, there is always the potential to open a new valuable skin that can be sold.
comment 10y ago · link · parent
f :: A -> B
g :: B -> C
will let me write g(f(x)), but not f(g(x)). It does not matter if f and g are 'pure', the point is that f must come before g. I think the mistake is to think that functional programming is about immutability, and that immutability solves the problems. Immutability is there to keep the types honest, it is fine to have effects aslong as we are upfront about them, and don't conceal them under false names such as "int" and "bool".
comment 12y ago · link · parent