aboutsummaryrefslogtreecommitdiff
path: root/examples/palindrome.fusp
blob: d2c6eba71f9725a4644ad759e7e30e0e9318be87 (plain) (blame)
1
2
3
4
5
6
7
8
9
import int;
import list;
import bool;

is_palindrome [] = 1;
is_palindrome [_:[]] = 1;
is_palindrome [x:xs] = if (eq x (last xs)) (is_palindrome (init xs)) 0;

main = is_palindrome [0:[42:[37:[42:[0:[]]]]]];