{-# LANGUAGE DerivingVia #-}
module U.Codebase.Sqlite.Decl.Format where
import Data.Vector (Vector)
import U.Codebase.Decl (DeclR)
import U.Codebase.Reference (Reference')
import U.Codebase.Sqlite.DbId (ObjectId, TextId)
import U.Codebase.Sqlite.LocalIds (LocalDefnId, LocalIds', LocalTextId)
import U.Codebase.Sqlite.Symbol (Symbol)
import U.Codebase.Type qualified as Type
import U.Core.ABT qualified as ABT
import Unison.Hash32 (Hash32)
import Unison.Prelude
data DeclFormat' text defn = Decl (LocallyIndexedComponent' text defn)
deriving (Int -> DeclFormat' text defn -> ShowS
[DeclFormat' text defn] -> ShowS
DeclFormat' text defn -> String
(Int -> DeclFormat' text defn -> ShowS)
-> (DeclFormat' text defn -> String)
-> ([DeclFormat' text defn] -> ShowS)
-> Show (DeclFormat' text defn)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall text defn.
(Show text, Show defn) =>
Int -> DeclFormat' text defn -> ShowS
forall text defn.
(Show text, Show defn) =>
[DeclFormat' text defn] -> ShowS
forall text defn.
(Show text, Show defn) =>
DeclFormat' text defn -> String
$cshowsPrec :: forall text defn.
(Show text, Show defn) =>
Int -> DeclFormat' text defn -> ShowS
showsPrec :: Int -> DeclFormat' text defn -> ShowS
$cshow :: forall text defn.
(Show text, Show defn) =>
DeclFormat' text defn -> String
show :: DeclFormat' text defn -> String
$cshowList :: forall text defn.
(Show text, Show defn) =>
[DeclFormat' text defn] -> ShowS
showList :: [DeclFormat' text defn] -> ShowS
Show)
type DeclFormat = DeclFormat' TextId ObjectId
type HashDeclFormat = DeclFormat' Text Hash32
type LocallyIndexedComponent =
LocallyIndexedComponent' TextId ObjectId
newtype LocallyIndexedComponent' t d = LocallyIndexedComponent
{forall t d.
LocallyIndexedComponent' t d -> Vector (LocalIds' t d, Decl Symbol)
unLocallyIndexedComponent :: Vector (LocalIds' t d, Decl Symbol)}
deriving (Int -> LocallyIndexedComponent' t d -> ShowS
[LocallyIndexedComponent' t d] -> ShowS
LocallyIndexedComponent' t d -> String
(Int -> LocallyIndexedComponent' t d -> ShowS)
-> (LocallyIndexedComponent' t d -> String)
-> ([LocallyIndexedComponent' t d] -> ShowS)
-> Show (LocallyIndexedComponent' t d)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall t d.
(Show t, Show d) =>
Int -> LocallyIndexedComponent' t d -> ShowS
forall t d.
(Show t, Show d) =>
[LocallyIndexedComponent' t d] -> ShowS
forall t d.
(Show t, Show d) =>
LocallyIndexedComponent' t d -> String
$cshowsPrec :: forall t d.
(Show t, Show d) =>
Int -> LocallyIndexedComponent' t d -> ShowS
showsPrec :: Int -> LocallyIndexedComponent' t d -> ShowS
$cshow :: forall t d.
(Show t, Show d) =>
LocallyIndexedComponent' t d -> String
show :: LocallyIndexedComponent' t d -> String
$cshowList :: forall t d.
(Show t, Show d) =>
[LocallyIndexedComponent' t d] -> ShowS
showList :: [LocallyIndexedComponent' t d] -> ShowS
Show)
type SyncDeclFormat =
SyncDeclFormat' TextId ObjectId
data SyncDeclFormat' t d
= SyncDecl (SyncLocallyIndexedComponent' t d)
newtype SyncLocallyIndexedComponent' t d
= SyncLocallyIndexedComponent (Vector (LocalIds' t d, ByteString))
type Decl v = DeclR TypeRef v
type Type v = ABT.Term F v ()
type F = Type.F' TypeRef
type TypeRef = Reference' LocalTextId (Maybe LocalDefnId)