module Unison.Hashing.V2.Kind ( Kind (..), ) where import Unison.Hashing.V2.Tokenizable (Tokenizable) import Unison.Hashing.V2.Tokenizable qualified as Hashable import Unison.Prelude data Kind = KindStar | KindArrow Kind Kind deriving (Kind -> Kind -> Bool (Kind -> Kind -> Bool) -> (Kind -> Kind -> Bool) -> Eq Kind forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a $c== :: Kind -> Kind -> Bool == :: Kind -> Kind -> Bool $c/= :: Kind -> Kind -> Bool /= :: Kind -> Kind -> Bool Eq, Eq Kind Eq Kind => (Kind -> Kind -> Ordering) -> (Kind -> Kind -> Bool) -> (Kind -> Kind -> Bool) -> (Kind -> Kind -> Bool) -> (Kind -> Kind -> Bool) -> (Kind -> Kind -> Kind) -> (Kind -> Kind -> Kind) -> Ord Kind Kind -> Kind -> Bool Kind -> Kind -> Ordering Kind -> Kind -> Kind 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 :: Kind -> Kind -> Ordering compare :: Kind -> Kind -> Ordering $c< :: Kind -> Kind -> Bool < :: Kind -> Kind -> Bool $c<= :: Kind -> Kind -> Bool <= :: Kind -> Kind -> Bool $c> :: Kind -> Kind -> Bool > :: Kind -> Kind -> Bool $c>= :: Kind -> Kind -> Bool >= :: Kind -> Kind -> Bool $cmax :: Kind -> Kind -> Kind max :: Kind -> Kind -> Kind $cmin :: Kind -> Kind -> Kind min :: Kind -> Kind -> Kind Ord, ReadPrec [Kind] ReadPrec Kind Int -> ReadS Kind ReadS [Kind] (Int -> ReadS Kind) -> ReadS [Kind] -> ReadPrec Kind -> ReadPrec [Kind] -> Read Kind forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a $creadsPrec :: Int -> ReadS Kind readsPrec :: Int -> ReadS Kind $creadList :: ReadS [Kind] readList :: ReadS [Kind] $creadPrec :: ReadPrec Kind readPrec :: ReadPrec Kind $creadListPrec :: ReadPrec [Kind] readListPrec :: ReadPrec [Kind] Read, Int -> Kind -> ShowS [Kind] -> ShowS Kind -> String (Int -> Kind -> ShowS) -> (Kind -> String) -> ([Kind] -> ShowS) -> Show Kind forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a $cshowsPrec :: Int -> Kind -> ShowS showsPrec :: Int -> Kind -> ShowS $cshow :: Kind -> String show :: Kind -> String $cshowList :: [Kind] -> ShowS showList :: [Kind] -> ShowS Show, (forall x. Kind -> Rep Kind x) -> (forall x. Rep Kind x -> Kind) -> Generic Kind forall x. Rep Kind x -> Kind forall x. Kind -> Rep Kind x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cfrom :: forall x. Kind -> Rep Kind x from :: forall x. Kind -> Rep Kind x $cto :: forall x. Rep Kind x -> Kind to :: forall x. Rep Kind x -> Kind Generic) instance Tokenizable Kind where tokens :: Kind -> [Token] tokens Kind k = case Kind k of Kind KindStar -> [Word8 -> Token Hashable.Tag Word8 0] KindArrow Kind k1 Kind k2 -> (Word8 -> Token Hashable.Tag Word8 1 Token -> [Token] -> [Token] forall a. a -> [a] -> [a] : Kind -> [Token] forall t. Tokenizable t => t -> [Token] Hashable.tokens Kind k1) [Token] -> [Token] -> [Token] forall a. [a] -> [a] -> [a] ++ Kind -> [Token] forall t. Tokenizable t => t -> [Token] Hashable.tokens Kind k2