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) -> Set Reference -> Transaction (DefnsF (Map Name) TermReferenceId TypeReferenceId) Source #

Given a 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 :: Monad m => (Hash -> m [term]) -> (Hash -> m [typ]) -> DefnsF Set TermReferenceId TypeReferenceId -> m (Defns (Map TermReferenceId term) (Map TypeReferenceId typ)) 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.

Unique type guids

Parsing and typechecking