From e70cbe42352eca64aa4c0cf1658a5a561b5a5f35 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 14 Oct 2015 10:57:25 -0400 Subject: [PATCH] Algebraic hashing over cofrees of Hashable types. --- prototype/Doubt/Cofree.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prototype/Doubt/Cofree.swift b/prototype/Doubt/Cofree.swift index 0704a779e..52b34c0a0 100644 --- a/prototype/Doubt/Cofree.swift +++ b/prototype/Doubt/Cofree.swift @@ -87,5 +87,11 @@ extension Cofree { } } +extension Cofree where A: Hashable, B: Hashable { + public var hash: Hash { + return hash(annotation: Hash.init, leaf: Hash.init) + } +} + import Prelude