unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Cli.UpdateUtils

Description

This module contains functionality that is common to the general idea of "updating" a term in Unison, which is when we reassign a name from one hash to another and then see if all dependents still typecheck.

This occurs in the pull, merge, update, and upgrade commands.

Synopsis

Getting dependents in a namespace

getNamespaceDependentsOf :: Defns (BiMultimap Referent Name) (BiMultimap TypeReference Name) -> DefnsF Set TermReference TypeReference -> Transaction (DefnsF (Map Name) TermReferenceId TypeReferenceId) Source #

Given an unconflicted namespace and a set of dependencies, return the subset of the namespace that consists of only the (transitive) dependents of the dependencies.

Hydrating definitions

hydrateRefs :: Codebase m v a -> DefnsF Set TermReferenceId TypeReferenceId -> Transaction (Defns (Map TermReferenceId (Term v a, Type v a)) (Map TypeReferenceId (Decl v a))) Source #

Hydrate termtype references to actual termstypes.

nameHydratedRefIds :: DefnsF (Map name) TermReferenceId TypeReferenceId -> Defns (Map TermReferenceId term) (Map TypeReferenceId typ) -> DefnsF (Map name) (TermReferenceId, term) (TypeReferenceId, typ) Source #

Associate names with hydrated terms/types.

nameHydratedRefIds2 :: forall name term typ. Ord name => Defns (BiMultimap Referent name) (BiMultimap TypeReference name) -> Defns (Map TermReferenceId term) (Map TypeReferenceId typ) -> DefnsF (Map name) (TermReferenceId, term) (TypeReferenceId, typ) Source #

Like nameHydratedRefIds, but takes the entire namespace as a first argument, which includes constructors.

Unique type guids

Parsing and typechecking