Add ContentHash.areEqualForList

This commit is contained in:
Jeroen Engels 2023-05-30 23:45:28 +02:00
parent 3821ee32f4
commit a74a271f85

View File

@ -1,4 +1,4 @@
module Review.Cache.ContentHash exposing (ContentHash, areEqual, areEqualForMaybe, hash)
module Review.Cache.ContentHash exposing (ContentHash, areEqual, areEqualForList, areEqualForMaybe, hash)
import Vendor.Murmur3 as Murmur3
@ -28,3 +28,18 @@ areEqualForMaybe a b =
_ ->
False
areEqualForList : List ContentHash -> List ContentHash -> Bool
areEqualForList aList bList =
case aList of
[] ->
List.isEmpty bList
a :: aTail ->
case bList of
[] ->
False
b :: bTail ->
areEqual a b && areEqualForList aTail bTail