module Unison.Hashing.V2.Referent ( Referent (..), ) where import Unison.Hashing.V2.ConstructorId (ConstructorId) import Unison.Hashing.V2.Reference (Reference) import Unison.Hashing.V2.Tokenizable (Tokenizable) import Unison.Hashing.V2.Tokenizable qualified as H data Referent = ReferentRef Reference | ReferentCon Reference ConstructorId deriving stock (Int -> Referent -> ShowS [Referent] -> ShowS Referent -> String (Int -> Referent -> ShowS) -> (Referent -> String) -> ([Referent] -> ShowS) -> Show Referent forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a $cshowsPrec :: Int -> Referent -> ShowS showsPrec :: Int -> Referent -> ShowS $cshow :: Referent -> String show :: Referent -> String $cshowList :: [Referent] -> ShowS showList :: [Referent] -> ShowS Show, Eq Referent Eq Referent => (Referent -> Referent -> Ordering) -> (Referent -> Referent -> Bool) -> (Referent -> Referent -> Bool) -> (Referent -> Referent -> Bool) -> (Referent -> Referent -> Bool) -> (Referent -> Referent -> Referent) -> (Referent -> Referent -> Referent) -> Ord Referent Referent -> Referent -> Bool Referent -> Referent -> Ordering Referent -> Referent -> Referent forall a. Eq a => (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> a) -> (a -> a -> a) -> Ord a $ccompare :: Referent -> Referent -> Ordering compare :: Referent -> Referent -> Ordering $c< :: Referent -> Referent -> Bool < :: Referent -> Referent -> Bool $c<= :: Referent -> Referent -> Bool <= :: Referent -> Referent -> Bool $c> :: Referent -> Referent -> Bool > :: Referent -> Referent -> Bool $c>= :: Referent -> Referent -> Bool >= :: Referent -> Referent -> Bool $cmax :: Referent -> Referent -> Referent max :: Referent -> Referent -> Referent $cmin :: Referent -> Referent -> Referent min :: Referent -> Referent -> Referent Ord, Referent -> Referent -> Bool (Referent -> Referent -> Bool) -> (Referent -> Referent -> Bool) -> Eq Referent forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a $c== :: Referent -> Referent -> Bool == :: Referent -> Referent -> Bool $c/= :: Referent -> Referent -> Bool /= :: Referent -> Referent -> Bool Eq) instance Tokenizable Referent where tokens :: Referent -> [Token] tokens (ReferentRef Reference r) = [Word8 -> Token H.Tag Word8 0] [Token] -> [Token] -> [Token] forall a. [a] -> [a] -> [a] ++ Reference -> [Token] forall t. Tokenizable t => t -> [Token] H.tokens Reference r tokens (ReferentCon Reference r ConstructorId i) = [Word8 -> Token H.Tag Word8 2] [Token] -> [Token] -> [Token] forall a. [a] -> [a] -> [a] ++ Reference -> [Token] forall t. Tokenizable t => t -> [Token] H.tokens Reference r [Token] -> [Token] -> [Token] forall a. [a] -> [a] -> [a] ++ ConstructorId -> [Token] forall t. Tokenizable t => t -> [Token] H.tokens ConstructorId i