Page MenuHomePhabricator

Make it possible to use Composition to create a function "All"
Closed, ResolvedPublic

Description

The function "All" takes a list of Booleans and returns True if they are all true, and false otherwise.

This has been tested on a local fresh install as well, for convenience I provide the function and implementation on Notwikilambda.

The function of All is here ( list: List ) : Boolean
https://notwikilambda.toolforge.org/wiki/ZObject:Z10037

The implementation of All is:
If(Empty(list), true, If(Head(list), All(Tail(list)), false))
https://notwikilambda.toolforge.org/wiki/ZObject:Z10038

Here are a few calls to All:
All([]) (should be true) - https://notwikilambda.toolforge.org/wiki/ZObject:Z10039
All([true]) (should be true) - https://notwikilambda.toolforge.org/wiki/ZObject:Z10040
All([false]) (should be false) - https://notwikilambda.toolforge.org/wiki/ZObject:Z10041
All([true, true]) (should be true) - https://notwikilambda.toolforge.org/wiki/ZObject:Z10042
All([true, false]) (should be false) - https://notwikilambda.toolforge.org/wiki/ZObject:Z10043

They all fail.

My guess is that the recursion in the implementation throws the orchestrator off.

Event Timeline

DVrandecic renamed this task from Composition of function "All" does not work to Composition of function "All".Jul 20 2021, 2:32 AM
Jdforrester-WMF renamed this task from Composition of function "All" to Make it possible to use Composition to create a function "All".Aug 10 2021, 6:00 PM