From 68097681c1ce912f5b3a51769ee1dcc6332b2579 Mon Sep 17 00:00:00 2001 From: Mark Barbone Date: Sat, 24 Apr 2021 14:48:58 -0700 Subject: [PATCH] Use =>/2 in foldl/4 so it errors when the input is not a list --- library/apply.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/apply.pl b/library/apply.pl index a56a7ed0f9..d4ae787596 100644 --- a/library/apply.pl +++ b/library/apply.pl @@ -311,8 +311,8 @@ foldl(Goal, List, V0, V) :- foldl_(List, Goal, V0, V). -foldl_([], _, V, V). -foldl_([H|T], Goal, V0, V) :- +foldl_([], _, V0, V) => V0 = V. +foldl_([H|T], Goal, V0, V) => call(Goal, H, V0, V1), foldl_(T, Goal, V1, V).