diff options
author | Nat Lasseter <nat.lasseter@york.ac.uk> | 2024-01-22 10:23:58 +0000 |
---|---|---|
committer | Nat Lasseter <nat.lasseter@york.ac.uk> | 2024-01-22 10:23:58 +0000 |
commit | a79414bcf14d17c58e040a7b8524f7bd8f7e5e03 (patch) | |
tree | 4f2f232aca568711ecb35caa3444b54f4dfa4361 /alleq.hs |
Migrate from gists
Diffstat (limited to 'alleq.hs')
-rw-r--r-- | alleq.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/alleq.hs b/alleq.hs new file mode 100644 index 0000000..7080614 --- /dev/null +++ b/alleq.hs @@ -0,0 +1,6 @@ +alleq :: Eq a => [a] -> Maybe a -> Bool +alleq [] _ = True +alleq (h:t) Nothing = alleq t (Just h) +alleq (h:t) (Just e) + | h == e = alleq t (Just e) + | True = False |