From e69f4750ceb30ba6e1953ce746d00ad4bc89145f Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Tue, 2 Jul 2019 03:50:22 -0400 Subject: Make KeyKey a proper type. --- lib/KeyRing/Types.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/KeyRing') diff --git a/lib/KeyRing/Types.hs b/lib/KeyRing/Types.hs index e1e19f5..f5fd879 100644 --- a/lib/KeyRing/Types.hs +++ b/lib/KeyRing/Types.hs @@ -299,10 +299,11 @@ data InputFileContext = InputFileContext -- which is used for finger-printing and as a lookup key into -- maps. This type may be changed to an actual fingerprint in -- in the future. -type KeyKey = [(Char,MPI)] +newtype KeyKey = KeyKey [(Char,MPI)] + deriving (Eq,Ord,Show) keykey :: Packet -> KeyKey -keykey k = concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k) +keykey k = KeyKey $ concatMap (\c -> (maybeToList $ find (\(f,x) -> f==c) (key k))) (public_key_fields $ key_algorithm k) isKey :: Packet -> Bool isKey (PublicKeyPacket {}) = True -- cgit v1.2.3