mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-17 13:27:30 +03:00
Merge remote-tracking branch 'origin/trunk' into topic/jit-cont
This commit is contained in:
commit
8a04bf4f87
@ -13,13 +13,12 @@ module Unison.Debug
|
|||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
import Control.Applicative (empty)
|
|
||||||
import Control.Monad (when)
|
|
||||||
import Data.Set (Set)
|
|
||||||
import Data.Set qualified as Set
|
import Data.Set qualified as Set
|
||||||
import Data.Text qualified as Text
|
import Data.Text qualified as Text
|
||||||
import Debug.Pretty.Simple (pTrace, pTraceM, pTraceShowId, pTraceShowM)
|
import Debug.Pretty.Simple (pTrace, pTraceM)
|
||||||
import System.IO.Unsafe (unsafePerformIO)
|
import System.IO.Unsafe (unsafePerformIO)
|
||||||
|
import Text.Pretty.Simple (pShow)
|
||||||
|
import Unison.Prelude
|
||||||
import UnliftIO.Environment (lookupEnv)
|
import UnliftIO.Environment (lookupEnv)
|
||||||
|
|
||||||
data DebugFlag
|
data DebugFlag
|
||||||
@ -148,7 +147,7 @@ debugPatternCoverageConstraintSolver = PatternCoverageConstraintSolver `Set.memb
|
|||||||
debug :: (Show a) => DebugFlag -> String -> a -> a
|
debug :: (Show a) => DebugFlag -> String -> a -> a
|
||||||
debug flag msg a =
|
debug flag msg a =
|
||||||
if shouldDebug flag
|
if shouldDebug flag
|
||||||
then pTraceShowId (pTrace (msg <> ":\n") a)
|
then (pTrace (msg <> ":\n" <> into @String (pShow a)) a)
|
||||||
else a
|
else a
|
||||||
|
|
||||||
-- | Use for selective debug logging in monadic contexts.
|
-- | Use for selective debug logging in monadic contexts.
|
||||||
@ -159,8 +158,7 @@ debug flag msg a =
|
|||||||
debugM :: (Show a, Monad m) => DebugFlag -> String -> a -> m ()
|
debugM :: (Show a, Monad m) => DebugFlag -> String -> a -> m ()
|
||||||
debugM flag msg a =
|
debugM flag msg a =
|
||||||
whenDebug flag do
|
whenDebug flag do
|
||||||
pTraceM (msg <> ":\n")
|
traceM (msg <> ":\n" <> into @String (pShow a))
|
||||||
pTraceShowM a
|
|
||||||
|
|
||||||
debugLog :: DebugFlag -> String -> a -> a
|
debugLog :: DebugFlag -> String -> a -> a
|
||||||
debugLog flag msg =
|
debugLog flag msg =
|
||||||
|
@ -492,7 +492,7 @@ loop e = do
|
|||||||
description <- inputDescription input
|
description <- inputDescription input
|
||||||
Cli.stepAt description (BranchUtil.makeAddTermName (first Path.unabsolute dest) srcTerm)
|
Cli.stepAt description (BranchUtil.makeAddTermName (first Path.unabsolute dest) srcTerm)
|
||||||
Cli.respond Success
|
Cli.respond Success
|
||||||
AliasTypeI src' dest' -> do
|
AliasTypeI force src' dest' -> do
|
||||||
src <- traverseOf _Right Cli.resolveSplit' src'
|
src <- traverseOf _Right Cli.resolveSplit' src'
|
||||||
srcTypes <-
|
srcTypes <-
|
||||||
either
|
either
|
||||||
@ -510,7 +510,7 @@ loop e = do
|
|||||||
pure (DeleteNameAmbiguous hqLength name Set.empty srcTypes)
|
pure (DeleteNameAmbiguous hqLength name Set.empty srcTypes)
|
||||||
dest <- Cli.resolveSplit' dest'
|
dest <- Cli.resolveSplit' dest'
|
||||||
destTypes <- Cli.getTypesAt (HQ'.NameOnly <$> dest)
|
destTypes <- Cli.getTypesAt (HQ'.NameOnly <$> dest)
|
||||||
when (not (Set.null destTypes)) do
|
when (not force && not (Set.null destTypes)) do
|
||||||
Cli.returnEarly (TypeAlreadyExists dest' destTypes)
|
Cli.returnEarly (TypeAlreadyExists dest' destTypes)
|
||||||
description <- inputDescription input
|
description <- inputDescription input
|
||||||
Cli.stepAt description (BranchUtil.makeAddTypeName (first Path.unabsolute dest) srcType)
|
Cli.stepAt description (BranchUtil.makeAddTypeName (first Path.unabsolute dest) srcType)
|
||||||
@ -978,11 +978,11 @@ inputDescription input =
|
|||||||
AliasTermI force src0 dest0 -> do
|
AliasTermI force src0 dest0 -> do
|
||||||
src <- hhqs' src0
|
src <- hhqs' src0
|
||||||
dest <- ps' dest0
|
dest <- ps' dest0
|
||||||
pure ((if force then "alias.term.force " else "alias.term ") <> src <> " " <> dest)
|
pure ((if force then "debug.alias.term.force " else "alias.term ") <> src <> " " <> dest)
|
||||||
AliasTypeI src0 dest0 -> do
|
AliasTypeI force src0 dest0 -> do
|
||||||
src <- hhqs' src0
|
src <- hhqs' src0
|
||||||
dest <- ps' dest0
|
dest <- ps' dest0
|
||||||
pure ("alias.type " <> src <> " " <> dest)
|
pure ((if force then "debug.alias.type.force " else "alias.term ") <> src <> " " <> dest)
|
||||||
AliasManyI srcs0 dest0 -> do
|
AliasManyI srcs0 dest0 -> do
|
||||||
srcs <- traverse hqs srcs0
|
srcs <- traverse hqs srcs0
|
||||||
dest <- p' dest0
|
dest <- p' dest0
|
||||||
|
@ -14,7 +14,6 @@ import Data.Map qualified as Map
|
|||||||
import Data.Set qualified as Set
|
import Data.Set qualified as Set
|
||||||
import Data.Set.NonEmpty (NESet)
|
import Data.Set.NonEmpty (NESet)
|
||||||
import Data.Set.NonEmpty qualified as NESet
|
import Data.Set.NonEmpty qualified as NESet
|
||||||
import Data.Tuple qualified as Tuple
|
|
||||||
import Unison.ABT qualified as ABT
|
import Unison.ABT qualified as ABT
|
||||||
import Unison.Builtin.Decls qualified as DD
|
import Unison.Builtin.Decls qualified as DD
|
||||||
import Unison.Cli.Monad (Cli)
|
import Unison.Cli.Monad (Cli)
|
||||||
@ -69,21 +68,24 @@ handleTest TestInput {includeLibNamespace, path, showFailures, showSuccesses} =
|
|||||||
Map.fromList <$> Cli.runTransaction do
|
Map.fromList <$> Cli.runTransaction do
|
||||||
Set.toList testRefs & wither \case
|
Set.toList testRefs & wither \case
|
||||||
rid -> fmap (rid,) <$> Codebase.getWatch codebase WK.TestWatch rid
|
rid -> fmap (rid,) <$> Codebase.getWatch codebase WK.TestWatch rid
|
||||||
let (oks, fails) = passFails cachedTests
|
let (fails, oks) = passFails cachedTests
|
||||||
passFails :: (Ord r) => Map r (Term v a) -> ([(r, Text)], [(r, Text)])
|
passFails :: (Ord r) => Map r (Term v a) -> (Map r [Text], Map r [Text])
|
||||||
passFails = Tuple.swap . partitionEithers . concat . map p . Map.toList
|
passFails =
|
||||||
|
Map.foldrWithKey
|
||||||
|
(\r v (f, o) -> bimap (\ts -> if null ts then f else Map.insert r ts f) (\ts -> if null ts then o else Map.insert r ts o) . partitionEithers $ p v)
|
||||||
|
(Map.empty, Map.empty)
|
||||||
where
|
where
|
||||||
p :: (r, Term v a) -> [Either (r, Text) (r, Text)]
|
p :: Term v a -> [Either Text Text]
|
||||||
p (r, tm) = case tm of
|
p = \case
|
||||||
Term.List' ts -> mapMaybe (q r) (toList ts)
|
Term.List' ts -> mapMaybe q $ toList ts
|
||||||
_ -> []
|
_ -> []
|
||||||
q r = \case
|
q = \case
|
||||||
Term.App' (Term.Constructor' (ConstructorReference ref cid)) (Term.Text' msg) ->
|
Term.App' (Term.Constructor' (ConstructorReference ref cid)) (Term.Text' msg) ->
|
||||||
if
|
if
|
||||||
| ref == DD.testResultRef ->
|
| ref == DD.testResultRef ->
|
||||||
if
|
if
|
||||||
| cid == DD.okConstructorId -> Just (Right (r, msg))
|
| cid == DD.okConstructorId -> Just (Right msg)
|
||||||
| cid == DD.failConstructorId -> Just (Left (r, msg))
|
| cid == DD.failConstructorId -> Just (Left msg)
|
||||||
| otherwise -> Nothing
|
| otherwise -> Nothing
|
||||||
| otherwise -> Nothing
|
| otherwise -> Nothing
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
@ -123,7 +125,7 @@ handleTest TestInput {includeLibNamespace, path, showFailures, showSuccesses} =
|
|||||||
pure [(r, tm')]
|
pure [(r, tm')]
|
||||||
|
|
||||||
let m = Map.fromList computedTests
|
let m = Map.fromList computedTests
|
||||||
(mOks, mFails) = passFails m
|
(mFails, mOks) = passFails m
|
||||||
Cli.respondNumbered $ TestResults Output.NewlyComputed fqnPPE showSuccesses showFailures mOks mFails
|
Cli.respondNumbered $ TestResults Output.NewlyComputed fqnPPE showSuccesses showFailures mOks mFails
|
||||||
|
|
||||||
handleIOTest :: HQ.HashQualified Name -> Cli ()
|
handleIOTest :: HQ.HashQualified Name -> Cli ()
|
||||||
@ -135,10 +137,14 @@ handleIOTest main = do
|
|||||||
let isIOTest typ = Foldable.any (Typechecker.isSubtype typ) $ Runtime.ioTestTypes runtime
|
let isIOTest typ = Foldable.any (Typechecker.isSubtype typ) $ Runtime.ioTestTypes runtime
|
||||||
refs <- resolveHQNames names (Set.singleton main)
|
refs <- resolveHQNames names (Set.singleton main)
|
||||||
(fails, oks) <-
|
(fails, oks) <-
|
||||||
refs & foldMapM \(ref, typ) -> do
|
Foldable.foldrM
|
||||||
when (not $ isIOTest typ) do
|
( \(ref, typ) (f, o) -> do
|
||||||
Cli.returnEarly (BadMainFunction "io.test" main typ suffixifiedPPE (Foldable.toList $ Runtime.ioTestTypes runtime))
|
when (not $ isIOTest typ) $
|
||||||
runIOTest suffixifiedPPE ref
|
Cli.returnEarly (BadMainFunction "io.test" main typ suffixifiedPPE (Foldable.toList $ Runtime.ioTestTypes runtime))
|
||||||
|
bimap (\ts -> if null ts then f else Map.insert ref ts f) (\ts -> if null ts then o else Map.insert ref ts o) <$> runIOTest suffixifiedPPE ref
|
||||||
|
)
|
||||||
|
(Map.empty, Map.empty)
|
||||||
|
refs
|
||||||
Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True oks fails
|
Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True oks fails
|
||||||
|
|
||||||
findTermsOfTypes :: Codebase.Codebase m Symbol Ann -> Bool -> Path -> NESet (Type.Type Symbol Ann) -> Cli (Set TermReferenceId)
|
findTermsOfTypes :: Codebase.Codebase m Symbol Ann -> Bool -> Path -> NESet (Type.Type Symbol Ann) -> Cli (Set TermReferenceId)
|
||||||
@ -163,15 +169,20 @@ handleAllIOTests = do
|
|||||||
let suffixifiedPPE = PPED.suffixifiedPPE pped
|
let suffixifiedPPE = PPED.suffixifiedPPE pped
|
||||||
ioTestRefs <- findTermsOfTypes codebase False Path.empty (Runtime.ioTestTypes runtime)
|
ioTestRefs <- findTermsOfTypes codebase False Path.empty (Runtime.ioTestTypes runtime)
|
||||||
case NESet.nonEmptySet ioTestRefs of
|
case NESet.nonEmptySet ioTestRefs of
|
||||||
Nothing -> Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True [] []
|
Nothing -> Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True Map.empty Map.empty
|
||||||
Just neTestRefs -> do
|
Just neTestRefs -> do
|
||||||
let total = NESet.size neTestRefs
|
let total = NESet.size neTestRefs
|
||||||
(fails, oks) <-
|
(fails, oks) <-
|
||||||
toList neTestRefs & zip [1 :: Int ..] & foldMapM \(n, r) -> do
|
toList neTestRefs
|
||||||
Cli.respond $ TestIncrementalOutputStart suffixifiedPPE (n, total) r
|
& zip [1 :: Int ..]
|
||||||
(fails, oks) <- runIOTest suffixifiedPPE r
|
& Foldable.foldrM
|
||||||
Cli.respond $ TestIncrementalOutputEnd suffixifiedPPE (n, total) r (null fails)
|
( \(n, r) (f, o) -> do
|
||||||
pure (fails, oks)
|
Cli.respond $ TestIncrementalOutputStart suffixifiedPPE (n, total) r
|
||||||
|
(fails, oks) <- runIOTest suffixifiedPPE r
|
||||||
|
Cli.respond $ TestIncrementalOutputEnd suffixifiedPPE (n, total) r (null fails)
|
||||||
|
pure (if null fails then f else Map.insert r fails f, if null oks then o else Map.insert r oks o)
|
||||||
|
)
|
||||||
|
(Map.empty, Map.empty)
|
||||||
Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True oks fails
|
Cli.respondNumbered $ TestResults Output.NewlyComputed suffixifiedPPE True True oks fails
|
||||||
|
|
||||||
resolveHQNames :: Names -> Set (HQ.HashQualified Name) -> Cli (Set (Reference.Id, Type.Type Symbol Ann))
|
resolveHQNames :: Names -> Set (HQ.HashQualified Name) -> Cli (Set (Reference.Id, Type.Type Symbol Ann))
|
||||||
@ -197,19 +208,16 @@ resolveHQNames parseNames hqNames =
|
|||||||
typ <- MaybeT (Codebase.getTypeOfReferent codebase (Referent.fromTermReferenceId ref))
|
typ <- MaybeT (Codebase.getTypeOfReferent codebase (Referent.fromTermReferenceId ref))
|
||||||
pure (ref, typ)
|
pure (ref, typ)
|
||||||
|
|
||||||
runIOTest :: PPE.PrettyPrintEnv -> Reference.Id -> Cli ([(Reference.Id, Text)], [(Reference.Id, Text)])
|
runIOTest :: PPE.PrettyPrintEnv -> Reference.Id -> Cli ([Text], [Text])
|
||||||
runIOTest ppe ref = do
|
runIOTest ppe ref = do
|
||||||
let a = ABT.annotation tm
|
let a = ABT.annotation tm
|
||||||
tm = DD.forceTerm a a (Term.refId a ref)
|
tm = DD.forceTerm a a (Term.refId a ref)
|
||||||
-- Don't cache IO tests
|
-- Don't cache IO tests
|
||||||
tm' <- RuntimeUtils.evalUnisonTerm False ppe False tm
|
tm' <- RuntimeUtils.evalUnisonTerm False ppe False tm
|
||||||
pure $ partitionTestResults [(ref, tm')]
|
pure $ partitionTestResults tm'
|
||||||
|
|
||||||
partitionTestResults ::
|
partitionTestResults :: Term Symbol Ann -> ([Text {- fails -}], [Text {- oks -}])
|
||||||
[(Reference.Id, Term Symbol Ann)] ->
|
partitionTestResults tm = fold $ do
|
||||||
([(Reference.Id, Text {- fails -})], [(Reference.Id, Text {- oks -})])
|
|
||||||
partitionTestResults results = fold $ do
|
|
||||||
(ref, tm) <- results
|
|
||||||
element <- case tm of
|
element <- case tm of
|
||||||
Term.List' ts -> toList ts
|
Term.List' ts -> toList ts
|
||||||
_ -> empty
|
_ -> empty
|
||||||
@ -217,8 +225,8 @@ partitionTestResults results = fold $ do
|
|||||||
Term.App' (Term.Constructor' (ConstructorReference conRef cid)) (Term.Text' msg) -> do
|
Term.App' (Term.Constructor' (ConstructorReference conRef cid)) (Term.Text' msg) -> do
|
||||||
guard (conRef == DD.testResultRef)
|
guard (conRef == DD.testResultRef)
|
||||||
if
|
if
|
||||||
| cid == DD.okConstructorId -> pure (mempty, [(ref, msg)])
|
| cid == DD.okConstructorId -> pure (mempty, [msg])
|
||||||
| cid == DD.failConstructorId -> pure ([(ref, msg)], mempty)
|
| cid == DD.failConstructorId -> pure ([msg], mempty)
|
||||||
| otherwise -> empty
|
| otherwise -> empty
|
||||||
_ -> empty
|
_ -> empty
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ data Input
|
|||||||
-- > names #sdflkjsdfhsdf
|
-- > names #sdflkjsdfhsdf
|
||||||
NamesI IsGlobal (HQ.HashQualified Name)
|
NamesI IsGlobal (HQ.HashQualified Name)
|
||||||
| AliasTermI !Bool HashOrHQSplit' Path.Split' -- bool = force?
|
| AliasTermI !Bool HashOrHQSplit' Path.Split' -- bool = force?
|
||||||
| AliasTypeI HashOrHQSplit' Path.Split'
|
| AliasTypeI !Bool HashOrHQSplit' Path.Split' -- bool = force?
|
||||||
| AliasManyI [Path.HQSplit] Path'
|
| AliasManyI [Path.HQSplit] Path'
|
||||||
| MoveAllI Path.Path' Path.Path'
|
| MoveAllI Path.Path' Path.Path'
|
||||||
| -- Move = Rename; It's an HQSplit' not an HQSplit', meaning the arg has to have a name.
|
| -- Move = Rename; It's an HQSplit' not an HQSplit', meaning the arg has to have a name.
|
||||||
|
@ -124,8 +124,8 @@ data NumberedOutput
|
|||||||
PPE.PrettyPrintEnv
|
PPE.PrettyPrintEnv
|
||||||
ShowSuccesses
|
ShowSuccesses
|
||||||
ShowFailures
|
ShowFailures
|
||||||
[(TermReferenceId, Text)] -- oks
|
(Map TermReferenceId [Text]) -- oks
|
||||||
[(TermReferenceId, Text)] -- fails
|
(Map TermReferenceId [Text]) -- fails
|
||||||
| Output'Todo !TodoOutput
|
| Output'Todo !TodoOutput
|
||||||
| -- | CantDeleteDefinitions ppe couldntDelete becauseTheseStillReferenceThem
|
| -- | CantDeleteDefinitions ppe couldntDelete becauseTheseStillReferenceThem
|
||||||
CantDeleteDefinitions PPE.PrettyPrintEnvDecl (Map LabeledDependency (NESet LabeledDependency))
|
CantDeleteDefinitions PPE.PrettyPrintEnvDecl (Map LabeledDependency (NESet LabeledDependency))
|
||||||
|
@ -1392,8 +1392,8 @@ aliasTerm =
|
|||||||
_ -> Left . warn $ P.wrap "`alias.term` takes two arguments, like `alias.term oldname newname`."
|
_ -> Left . warn $ P.wrap "`alias.term` takes two arguments, like `alias.term oldname newname`."
|
||||||
}
|
}
|
||||||
|
|
||||||
aliasTermForce :: InputPattern
|
debugAliasTermForce :: InputPattern
|
||||||
aliasTermForce =
|
debugAliasTermForce =
|
||||||
InputPattern
|
InputPattern
|
||||||
{ patternName = "debug.alias.term.force",
|
{ patternName = "debug.alias.term.force",
|
||||||
aliases = [],
|
aliases = [],
|
||||||
@ -1416,9 +1416,24 @@ aliasType =
|
|||||||
[("type to alias", Required, exactDefinitionTypeQueryArg), ("alias name", Required, newNameArg)]
|
[("type to alias", Required, exactDefinitionTypeQueryArg), ("alias name", Required, newNameArg)]
|
||||||
"`alias.type Foo Bar` introduces `Bar` with the same definition as `Foo`."
|
"`alias.type Foo Bar` introduces `Bar` with the same definition as `Foo`."
|
||||||
\case
|
\case
|
||||||
[oldName, newName] -> Input.AliasTypeI <$> handleShortHashOrHQSplit'Arg oldName <*> handleSplit'Arg newName
|
[oldName, newName] -> Input.AliasTypeI False <$> handleShortHashOrHQSplit'Arg oldName <*> handleSplit'Arg newName
|
||||||
_ -> Left . warn $ P.wrap "`alias.type` takes two arguments, like `alias.type oldname newname`."
|
_ -> Left . warn $ P.wrap "`alias.type` takes two arguments, like `alias.type oldname newname`."
|
||||||
|
|
||||||
|
debugAliasTypeForce :: InputPattern
|
||||||
|
debugAliasTypeForce =
|
||||||
|
InputPattern
|
||||||
|
{ patternName = "debug.alias.type.force",
|
||||||
|
aliases = [],
|
||||||
|
visibility = I.Hidden,
|
||||||
|
args = [("type to alias", Required, exactDefinitionTypeQueryArg), ("alias name", Required, newNameArg)],
|
||||||
|
help = "`debug.alias.type.force Foo Bar` introduces `Bar` with the same definition as `Foo`.",
|
||||||
|
parse = \case
|
||||||
|
[oldName, newName] -> Input.AliasTypeI True <$> handleShortHashOrHQSplit'Arg oldName <*> handleSplit'Arg newName
|
||||||
|
_ ->
|
||||||
|
Left . warn $
|
||||||
|
P.wrap "`debug.alias.type.force` takes two arguments, like `debug.alias.type.force oldname newname`."
|
||||||
|
}
|
||||||
|
|
||||||
aliasMany :: InputPattern
|
aliasMany :: InputPattern
|
||||||
aliasMany =
|
aliasMany =
|
||||||
InputPattern
|
InputPattern
|
||||||
@ -3299,7 +3314,6 @@ validInputs =
|
|||||||
[ add,
|
[ add,
|
||||||
aliasMany,
|
aliasMany,
|
||||||
aliasTerm,
|
aliasTerm,
|
||||||
aliasTermForce,
|
|
||||||
aliasType,
|
aliasType,
|
||||||
api,
|
api,
|
||||||
authLogin,
|
authLogin,
|
||||||
@ -3313,6 +3327,8 @@ validInputs =
|
|||||||
clone,
|
clone,
|
||||||
compileScheme,
|
compileScheme,
|
||||||
createAuthor,
|
createAuthor,
|
||||||
|
debugAliasTermForce,
|
||||||
|
debugAliasTypeForce,
|
||||||
debugClearWatchCache,
|
debugClearWatchCache,
|
||||||
debugDoctor,
|
debugDoctor,
|
||||||
debugDumpNamespace,
|
debugDumpNamespace,
|
||||||
|
@ -308,8 +308,8 @@ notifyNumbered = \case
|
|||||||
)
|
)
|
||||||
(showDiffNamespace ShowNumbers ppe (absPathToBranchId bAbs) (absPathToBranchId bAbs) diff)
|
(showDiffNamespace ShowNumbers ppe (absPathToBranchId bAbs) (absPathToBranchId bAbs) diff)
|
||||||
TestResults stats ppe _showSuccess _showFailures oksUnsorted failsUnsorted ->
|
TestResults stats ppe _showSuccess _showFailures oksUnsorted failsUnsorted ->
|
||||||
let oks = Name.sortByText (HQ.toText . fst) [(name r, msg) | (r, msg) <- oksUnsorted]
|
let oks = Name.sortByText (HQ.toText . fst) [(name r, msgs) | (r, msgs) <- Map.toList oksUnsorted]
|
||||||
fails = Name.sortByText (HQ.toText . fst) [(name r, msg) | (r, msg) <- failsUnsorted]
|
fails = Name.sortByText (HQ.toText . fst) [(name r, msgs) | (r, msgs) <- Map.toList failsUnsorted]
|
||||||
name r = PPE.termName ppe (Referent.fromTermReferenceId r)
|
name r = PPE.termName ppe (Referent.fromTermReferenceId r)
|
||||||
in ( case stats of
|
in ( case stats of
|
||||||
CachedTests 0 _ -> P.callout "😶" $ "No tests to run."
|
CachedTests 0 _ -> P.callout "😶" $ "No tests to run."
|
||||||
@ -2535,8 +2535,8 @@ displayRendered outputLoc pp =
|
|||||||
|
|
||||||
displayTestResults ::
|
displayTestResults ::
|
||||||
Bool -> -- whether to show the tip
|
Bool -> -- whether to show the tip
|
||||||
[(HQ.HashQualified Name, Text)] ->
|
[(HQ.HashQualified Name, [Text])] ->
|
||||||
[(HQ.HashQualified Name, Text)] ->
|
[(HQ.HashQualified Name, [Text])] ->
|
||||||
Pretty
|
Pretty
|
||||||
displayTestResults showTip oks fails =
|
displayTestResults showTip oks fails =
|
||||||
let name = P.text . HQ.toText
|
let name = P.text . HQ.toText
|
||||||
@ -2545,11 +2545,11 @@ displayTestResults showTip oks fails =
|
|||||||
then mempty
|
then mempty
|
||||||
else
|
else
|
||||||
P.indentN 2 $
|
P.indentN 2 $
|
||||||
P.numberedColumn2ListFrom 0 [(P.green "◉ " <> name r, " " <> P.green (P.text msg)) | (r, msg) <- oks]
|
P.numberedColumn2ListFrom 0 [(name r, P.lines $ P.green . (" ◉ " <>) . P.text <$> msgs) | (r, msgs) <- oks]
|
||||||
okSummary =
|
okSummary =
|
||||||
if null oks
|
if null oks
|
||||||
then mempty
|
then mempty
|
||||||
else "✅ " <> P.bold (P.num (length oks)) <> P.green " test(s) passing"
|
else "✅ " <> P.bold (P.num (sum $ fmap (length . snd) oks)) <> P.green " test(s) passing"
|
||||||
failMsg =
|
failMsg =
|
||||||
if null fails
|
if null fails
|
||||||
then mempty
|
then mempty
|
||||||
@ -2557,11 +2557,11 @@ displayTestResults showTip oks fails =
|
|||||||
P.indentN 2 $
|
P.indentN 2 $
|
||||||
P.numberedColumn2ListFrom
|
P.numberedColumn2ListFrom
|
||||||
(length oks)
|
(length oks)
|
||||||
[(P.red "✗ " <> name r, " " <> P.red (P.text msg)) | (r, msg) <- fails]
|
[(name r, P.lines $ P.red . (" ✗ " <>) . P.text <$> msgs) | (r, msgs) <- fails]
|
||||||
failSummary =
|
failSummary =
|
||||||
if null fails
|
if null fails
|
||||||
then mempty
|
then mempty
|
||||||
else "🚫 " <> P.bold (P.num (length fails)) <> P.red " test(s) failing"
|
else "🚫 " <> P.bold (P.num (sum $ fmap (length . snd) fails)) <> P.red " test(s) failing"
|
||||||
tipMsg =
|
tipMsg =
|
||||||
if not showTip || (null oks && null fails)
|
if not showTip || (null oks && null fails)
|
||||||
then mempty
|
then mempty
|
||||||
|
@ -41,11 +41,11 @@ relocateToNameRoot perspective query rootBranch = do
|
|||||||
-- Since the project root is lower down we need to strip the part of the prefix
|
-- Since the project root is lower down we need to strip the part of the prefix
|
||||||
-- which is now redundant.
|
-- which is now redundant.
|
||||||
pure . Right $ (projectRoot, query <&> \n -> fromMaybe n $ Path.unprefixName (Path.Absolute remainder) n)
|
pure . Right $ (projectRoot, query <&> \n -> fromMaybe n $ Path.unprefixName (Path.Absolute remainder) n)
|
||||||
-- The namesRoot is _inside_ of the project containing the query
|
-- The namesRoot is _inside (or equal to)_ the project containing the query
|
||||||
(_sharedPrefix, remainder, Path.Empty) -> do
|
(_sharedPrefix, remainder, Path.Empty) -> do
|
||||||
-- Since the project is higher up, we need to prefix the query
|
-- Since the project is higher up, we need to prefix the query
|
||||||
-- with the remainder of the path
|
-- with the remainder of the path
|
||||||
pure $ Right (projectRoot, query <&> Path.prefixNameIfRel (Path.AbsolutePath' $ Path.Absolute remainder))
|
pure $ Right (projectRoot, query <&> Path.prefixNameIfRel (Path.RelativePath' $ Path.Relative remainder))
|
||||||
-- The namesRoot and project root are disjoint, this shouldn't ever happen.
|
-- The namesRoot and project root are disjoint, this shouldn't ever happen.
|
||||||
(_, _, _) -> pure $ Left (DisjointProjectAndPerspective perspective projectRoot)
|
(_, _, _) -> pure $ Left (DisjointProjectAndPerspective perspective projectRoot)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ Thus, make sure the contents of this file define the contents of the cache
|
|||||||
(e.g. don't pull `latest`.)
|
(e.g. don't pull `latest`.)
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> pull @unison/base/releases/2.5.0 .base
|
scratch/main> pull @unison/base/releases/2.5.0 .base
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
.> undo
|
scratch/main> undo
|
||||||
```
|
```
|
||||||
|
@ -5,12 +5,12 @@ If you want to add or update tests, you can create a branch of that project, and
|
|||||||
Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release.
|
Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release.
|
||||||
|
|
||||||
```ucm:hide:error
|
```ucm:hide:error
|
||||||
.> this is a hack to trigger an error, in order to swallow any error on the next line.
|
scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line.
|
||||||
.> we delete the project to avoid any merge conflicts or complaints from ucm.
|
scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm.
|
||||||
.> delete.project runtime-tests
|
scratch/main> delete.project runtime-tests
|
||||||
```
|
```
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> clone ${runtime_tests_version} runtime-tests/selected
|
scratch/main> clone ${runtime_tests_version} runtime-tests/selected
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
|
@ -5,12 +5,12 @@ If you want to add or update tests, you can create a branch of that project, and
|
|||||||
Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release.
|
Before merging the PR on Github, we'll merge your branch on Share and restore `runtime_tests_version` to /main or maybe a release.
|
||||||
|
|
||||||
```ucm:hide:error
|
```ucm:hide:error
|
||||||
.> this is a hack to trigger an error, in order to swallow any error on the next line.
|
scratch/main> this is a hack to trigger an error, in order to swallow any error on the next line.
|
||||||
.> we delete the project to avoid any merge conflicts or complaints from ucm.
|
scratch/main> we delete the project to avoid any merge conflicts or complaints from ucm.
|
||||||
.> delete.project runtime-tests
|
scratch/main> delete.project runtime-tests
|
||||||
```
|
```
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> clone ${runtime_tests_version} runtime-tests/selected
|
scratch/main> clone ${runtime_tests_version} runtime-tests/selected
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
@ -31,8 +31,8 @@ foo = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> run.native foo
|
scratch/main> run.native foo
|
||||||
.> run.native foo
|
scratch/main> run.native foo
|
||||||
```
|
```
|
||||||
|
|
||||||
This can also only be tested by separately running this test, because
|
This can also only be tested by separately running this test, because
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> pull unison.public.base.releases.M4d base
|
scratch/main> pull unison.public.base.releases.M4d base
|
||||||
.> pull runarorama.public.sort.data sort
|
scratch/main> pull runarorama.public.sort.data sort
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison:hide
|
```unison:hide
|
||||||
@ -34,63 +34,63 @@ prepare = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
.> run prepare
|
scratch/main> run prepare
|
||||||
```
|
```
|
||||||
|
|
||||||
## Benchmarks
|
## Benchmarks
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/each.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/each.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/listmap.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/listmap.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/listfilter.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/listfilter.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/random.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/random.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/simpleloop.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/simpleloop.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/fibonacci.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/fibonacci.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/map.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/map.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/natmap.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/natmap.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/stm.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/stm.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/tmap.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/tmap.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load unison-src/transcripts-manual/benchmarks/array-sort.u
|
scratch/main> load unison-src/transcripts-manual/benchmarks/array-sort.u
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
@ -1,6 +1,5 @@
|
|||||||
```ucm
|
```ucm
|
||||||
.> project.create test-html-docs
|
test-html-docs/main> builtins.mergeio lib.builtins
|
||||||
test-html-docs/main> builtins.merge
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
|
@ -1,26 +1,5 @@
|
|||||||
```ucm
|
```ucm
|
||||||
.> project.create test-html-docs
|
test-html-docs/main> builtins.mergeio lib.builtins
|
||||||
|
|
||||||
🎉 I've created the project test-html-docs.
|
|
||||||
|
|
||||||
I'll now fetch the latest version of the base Unison
|
|
||||||
library...
|
|
||||||
|
|
||||||
Downloaded 14053 entities.
|
|
||||||
|
|
||||||
🎨 Type `ui` to explore this project's code in your browser.
|
|
||||||
🔭 Discover libraries at https://share.unison-lang.org
|
|
||||||
📖 Use `help-topic projects` to learn more about projects.
|
|
||||||
|
|
||||||
Write your first Unison code with UCM:
|
|
||||||
|
|
||||||
1. Open scratch.u.
|
|
||||||
2. Write some Unison code and save the file.
|
|
||||||
3. In UCM, type `add` to save it to your new project.
|
|
||||||
|
|
||||||
🎉 🥳 Happy coding!
|
|
||||||
|
|
||||||
test-html-docs/main> builtins.merge
|
|
||||||
|
|
||||||
Done.
|
Done.
|
||||||
|
|
||||||
@ -47,13 +26,11 @@ some.outside = 3
|
|||||||
⍟ These new definitions are ok to `add`:
|
⍟ These new definitions are ok to `add`:
|
||||||
|
|
||||||
some.ns.direct : Nat
|
some.ns.direct : Nat
|
||||||
some.ns.direct.doc : Doc
|
some.ns.direct.doc : Doc2
|
||||||
some.ns.pretty.deeply.nested : Nat
|
some.ns.pretty.deeply.nested : Nat
|
||||||
(also named lib.base.data.Map.internal.ratio)
|
some.ns.pretty.deeply.nested.doc : Doc2
|
||||||
some.ns.pretty.deeply.nested.doc : Doc
|
|
||||||
some.outside : Nat
|
some.outside : Nat
|
||||||
(also named lib.base.data.Map.internal.delta)
|
some.outside.doc : Doc2
|
||||||
some.outside.doc : Doc
|
|
||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
@ -62,13 +39,11 @@ test-html-docs/main> add
|
|||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
some.ns.direct : Nat
|
some.ns.direct : Nat
|
||||||
some.ns.direct.doc : Doc
|
some.ns.direct.doc : Doc2
|
||||||
some.ns.pretty.deeply.nested : Nat
|
some.ns.pretty.deeply.nested : Nat
|
||||||
(also named lib.base.data.Map.internal.ratio)
|
some.ns.pretty.deeply.nested.doc : Doc2
|
||||||
some.ns.pretty.deeply.nested.doc : Doc
|
|
||||||
some.outside : Nat
|
some.outside : Nat
|
||||||
(also named lib.base.data.Map.internal.delta)
|
some.outside.doc : Doc2
|
||||||
some.outside.doc : Doc
|
|
||||||
|
|
||||||
test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html
|
test-html-docs/main> docs.to-html some.ns unison-src/transcripts-manual/docs.to-html
|
||||||
|
|
||||||
|
@ -3,5 +3,5 @@
|
|||||||
Note: this makes a network call to share to get completions
|
Note: this makes a network call to share to get completions
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> debug.tab-complete pull unison.pub
|
scratch/main> debug.tab-complete pull unison.pub
|
||||||
```
|
```
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
.> load unison-src/transcripts-using-base/base.u
|
scratch/main> load unison-src/transcripts-using-base/base.u
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
## Structural find and replace
|
## Structural find and replace
|
||||||
@ -37,19 +37,19 @@ rule2 x = @rewrite signature Optional ==> Optional2
|
|||||||
Let's rewrite these:
|
Let's rewrite these:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> rewrite rule1
|
scratch/main> rewrite rule1
|
||||||
.> rewrite eitherToOptional
|
scratch/main> rewrite eitherToOptional
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> load
|
scratch/main> load
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
After adding to the codebase, here's the rewritten source:
|
After adding to the codebase, here's the rewritten source:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view ex1 Either.mapRight rule1
|
scratch/main> view ex1 Either.mapRight rule1
|
||||||
```
|
```
|
||||||
|
|
||||||
Another example, showing that we can rewrite to definitions that only exist in the file:
|
Another example, showing that we can rewrite to definitions that only exist in the file:
|
||||||
@ -75,18 +75,18 @@ blah2 = 456
|
|||||||
Let's apply the rewrite `woot1to2`:
|
Let's apply the rewrite `woot1to2`:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> rewrite woot1to2
|
scratch/main> rewrite woot1to2
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> load
|
scratch/main> load
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`:
|
After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view wootEx
|
scratch/main> view wootEx
|
||||||
```
|
```
|
||||||
|
|
||||||
This example shows that rewrite rules can to refer to term definitions that only exist in the file:
|
This example shows that rewrite rules can to refer to term definitions that only exist in the file:
|
||||||
@ -111,15 +111,15 @@ sameFileEx =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> rewrite rule
|
scratch/main> rewrite rule
|
||||||
.> load
|
scratch/main> load
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
After adding the rewritten form to the codebase, here's the rewritten definitions:
|
After adding the rewritten form to the codebase, here's the rewritten definitions:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view foo1 foo2 sameFileEx
|
scratch/main> view foo1 foo2 sameFileEx
|
||||||
```
|
```
|
||||||
|
|
||||||
## Capture avoidance
|
## Capture avoidance
|
||||||
@ -145,13 +145,13 @@ sameFileEx =
|
|||||||
In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding.
|
In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> rewrite rule
|
scratch/main> rewrite rule
|
||||||
```
|
```
|
||||||
|
|
||||||
Instead, it should be an unbound free variable, which doesn't typecheck:
|
Instead, it should be an unbound free variable, which doesn't typecheck:
|
||||||
|
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> load
|
scratch/main> load
|
||||||
```
|
```
|
||||||
|
|
||||||
In this example, the `a` is locally bound by the rule, so it shouldn't capture the `a = 39494` binding which is in scope at the point of the replacement:
|
In this example, the `a` is locally bound by the rule, so it shouldn't capture the `a = 39494` binding which is in scope at the point of the replacement:
|
||||||
@ -167,13 +167,13 @@ rule a = @rewrite
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> rewrite rule
|
scratch/main> rewrite rule
|
||||||
```
|
```
|
||||||
|
|
||||||
The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error:
|
The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error:
|
||||||
|
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> load
|
scratch/main> load
|
||||||
```
|
```
|
||||||
|
|
||||||
## Structural find
|
## Structural find
|
||||||
@ -183,7 +183,7 @@ eitherEx = Left ("hello", "there")
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison:hide
|
```unison:hide
|
||||||
@ -192,7 +192,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> ()
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> sfind findEitherEx
|
scratch/main> sfind findEitherEx
|
||||||
.> sfind findEitherFailure
|
scratch/main> sfind findEitherFailure
|
||||||
.> find 1-5
|
scratch/main> find 1-5
|
||||||
```
|
```
|
||||||
|
@ -31,7 +31,7 @@ rule2 x = @rewrite signature Optional ==> Optional2
|
|||||||
Let's rewrite these:
|
Let's rewrite these:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> rewrite rule1
|
scratch/main> rewrite rule1
|
||||||
|
|
||||||
☝️
|
☝️
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ Let's rewrite these:
|
|||||||
|
|
||||||
The rewritten file has been added to the top of scratch.u
|
The rewritten file has been added to the top of scratch.u
|
||||||
|
|
||||||
.> rewrite eitherToOptional
|
scratch/main> rewrite eitherToOptional
|
||||||
|
|
||||||
☝️
|
☝️
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ rule2 x = @rewrite signature Optional ==> Optional2
|
|||||||
After adding to the codebase, here's the rewritten source:
|
After adding to the codebase, here's the rewritten source:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view ex1 Either.mapRight rule1
|
scratch/main> view ex1 Either.mapRight rule1
|
||||||
|
|
||||||
Either.mapRight : (a ->{g} b) -> Optional a ->{g} Optional b
|
Either.mapRight : (a ->{g} b) -> Optional a ->{g} Optional b
|
||||||
Either.mapRight f = cases
|
Either.mapRight f = cases
|
||||||
@ -158,7 +158,7 @@ blah2 = 456
|
|||||||
Let's apply the rewrite `woot1to2`:
|
Let's apply the rewrite `woot1to2`:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> rewrite woot1to2
|
scratch/main> rewrite woot1to2
|
||||||
|
|
||||||
☝️
|
☝️
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ blah2 = 456
|
|||||||
After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`:
|
After adding the rewritten form to the codebase, here's the rewritten `Woot1` to `Woot2`:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view wootEx
|
scratch/main> view wootEx
|
||||||
|
|
||||||
wootEx : Nat ->{Woot2} Nat
|
wootEx : Nat ->{Woot2} Nat
|
||||||
wootEx a =
|
wootEx a =
|
||||||
@ -226,7 +226,7 @@ sameFileEx =
|
|||||||
After adding the rewritten form to the codebase, here's the rewritten definitions:
|
After adding the rewritten form to the codebase, here's the rewritten definitions:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view foo1 foo2 sameFileEx
|
scratch/main> view foo1 foo2 sameFileEx
|
||||||
|
|
||||||
foo1 : Nat
|
foo1 : Nat
|
||||||
foo1 =
|
foo1 =
|
||||||
@ -267,7 +267,7 @@ sameFileEx =
|
|||||||
In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding.
|
In the above example, `bar2` is locally bound by the rule, so when applied, it should not refer to the `bar2` top level binding.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> rewrite rule
|
scratch/main> rewrite rule
|
||||||
|
|
||||||
☝️
|
☝️
|
||||||
|
|
||||||
@ -301,7 +301,7 @@ sameFileEx =
|
|||||||
Instead, it should be an unbound free variable, which doesn't typecheck:
|
Instead, it should be an unbound free variable, which doesn't typecheck:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load
|
scratch/main> load
|
||||||
|
|
||||||
Loading changes detected in scratch.u.
|
Loading changes detected in scratch.u.
|
||||||
|
|
||||||
@ -332,7 +332,7 @@ rule a = @rewrite
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> rewrite rule
|
scratch/main> rewrite rule
|
||||||
|
|
||||||
☝️
|
☝️
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ rule a =
|
|||||||
The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error:
|
The `a` introduced will be freshened to not capture the `a` in scope, so it remains as an unbound variable and is a type error:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load
|
scratch/main> load
|
||||||
|
|
||||||
Loading changes detected in scratch.u.
|
Loading changes detected in scratch.u.
|
||||||
|
|
||||||
@ -388,7 +388,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> ()
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> sfind findEitherEx
|
scratch/main> sfind findEitherEx
|
||||||
|
|
||||||
🔎
|
🔎
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> ()
|
|||||||
|
|
||||||
Tip: Try `edit 1` to bring this into your scratch file.
|
Tip: Try `edit 1` to bring this into your scratch file.
|
||||||
|
|
||||||
.> sfind findEitherFailure
|
scratch/main> sfind findEitherFailure
|
||||||
|
|
||||||
🔎
|
🔎
|
||||||
|
|
||||||
@ -413,7 +413,7 @@ findEitherFailure = @rewrite signature a . Either Failure a ==> ()
|
|||||||
Tip: Try `edit 1` or `edit 1-5` to bring these into your
|
Tip: Try `edit 1` or `edit 1-5` to bring these into your
|
||||||
scratch file.
|
scratch file.
|
||||||
|
|
||||||
.> find 1-5
|
scratch/main> find 1-5
|
||||||
|
|
||||||
1. Exception.catch : '{g, Exception} a ->{g} Either Failure a
|
1. Exception.catch : '{g, Exception} a ->{g} Either Failure a
|
||||||
2. Exception.reraise : Either Failure a ->{Exception} a
|
2. Exception.reraise : Either Failure a ->{Exception} a
|
||||||
|
@ -2,8 +2,8 @@ This transcript executes very slowly, because the compiler has an
|
|||||||
entire copy of base (and other stuff) within it.
|
entire copy of base (and other stuff) within it.
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.merge
|
scratch/main> builtins.merge
|
||||||
.> pull.without-history unison.public.base.trunk base
|
scratch/main> pull.without-history unison.public.base.trunk base
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -55,7 +55,7 @@ multiAddUp = repeat 35 '(printAddUp 3000000)
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> run singleAddUp
|
scratch/main> run singleAddUp
|
||||||
.> run.native multiAddUp
|
scratch/main> run.native multiAddUp
|
||||||
```
|
```
|
||||||
|
@ -10,9 +10,9 @@ transcripts which contain less boilerplate.
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
.> load unison-src/transcripts-using-base/base.u
|
scratch/main> load unison-src/transcripts-using-base/base.u
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
The test shows that `hex (fromHex str) == str` as expected.
|
The test shows that `hex (fromHex str) == str` as expected.
|
||||||
@ -24,7 +24,7 @@ test> hex.tests.ex1 = checks let
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> test
|
scratch/main> test
|
||||||
```
|
```
|
||||||
|
|
||||||
Lets do some basic testing of our test harness to make sure its
|
Lets do some basic testing of our test harness to make sure its
|
||||||
@ -50,6 +50,6 @@ testAutoClean _ =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testAutoClean
|
scratch/main> io.test testAutoClean
|
||||||
```
|
```
|
||||||
|
@ -53,18 +53,18 @@ testAutoClean _ =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
testAutoClean : '{IO} [Result]
|
testAutoClean : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test testAutoClean
|
scratch/main> io.test testAutoClean
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testAutoClean our temporary directory should exist
|
1. testAutoClean ◉ our temporary directory should exist
|
||||||
2. ◉ testAutoClean our temporary directory should no longer exist
|
◉ our temporary directory should no longer exist
|
||||||
|
|
||||||
✅ 2 test(s) passing
|
✅ 2 test(s) passing
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
This transcript is intended to make visible accidental changes to the hashing algorithm.
|
This transcript is intended to make visible accidental changes to the hashing algorithm.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> find.verbose
|
scratch/main> find.verbose
|
||||||
```
|
```
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
This transcript is intended to make visible accidental changes to the hashing algorithm.
|
This transcript is intended to make visible accidental changes to the hashing algorithm.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> find.verbose
|
scratch/main> find.verbose
|
||||||
|
|
||||||
1. -- #sgesq8035ut22q779pl1g4gqsg8c81894jjonmrq1bjltphkath225up841hk8dku59tnnc4laj9nggbofamgei4klof0ldc20uj2oo
|
1. -- #sgesq8035ut22q779pl1g4gqsg8c81894jjonmrq1bjltphkath225up841hk8dku59tnnc4laj9nggbofamgei4klof0ldc20uj2oo
|
||||||
<| : (i ->{g} o) -> i ->{g} o
|
<| : (i ->{g} o) -> i ->{g} o
|
||||||
|
@ -54,6 +54,6 @@ testABunchOfNats _ =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testABunchOfNats
|
scratch/main> io.test testABunchOfNats
|
||||||
```
|
```
|
||||||
|
@ -76,7 +76,7 @@ testABunchOfNats _ =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -91,78 +91,78 @@ testABunchOfNats _ =
|
|||||||
testNat : Nat -> '{IO, Stream Result} ()
|
testNat : Nat -> '{IO, Stream Result} ()
|
||||||
testRoundTrip : Nat -> EncDec ->{IO, Stream Result} ()
|
testRoundTrip : Nat -> EncDec ->{IO, Stream Result} ()
|
||||||
|
|
||||||
.> io.test testABunchOfNats
|
scratch/main> io.test testABunchOfNats
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testABunchOfNats successfully decoded 4294967295 using 64 bit Big Endian
|
1. testABunchOfNats ◉ successfully decoded 4294967295 using 64 bit Big Endian
|
||||||
2. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
3. ◉ testABunchOfNats successfully decoded 4294967295 using 64 bit Little Endian
|
◉ successfully decoded 4294967295 using 64 bit Little Endian
|
||||||
4. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
5. ◉ testABunchOfNats successfully decoded 4294967295 using 32 bit Big Endian
|
◉ successfully decoded 4294967295 using 32 bit Big Endian
|
||||||
6. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
7. ◉ testABunchOfNats successfully decoded 4294967295 using 32 bit Little Endian
|
◉ successfully decoded 4294967295 using 32 bit Little Endian
|
||||||
8. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
9. ◉ testABunchOfNats successfully decoded 1090519040 using 64 bit Big Endian
|
◉ successfully decoded 1090519040 using 64 bit Big Endian
|
||||||
10. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
11. ◉ testABunchOfNats successfully decoded 1090519040 using 64 bit Little Endian
|
◉ successfully decoded 1090519040 using 64 bit Little Endian
|
||||||
12. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
13. ◉ testABunchOfNats successfully decoded 1090519040 using 32 bit Big Endian
|
◉ successfully decoded 1090519040 using 32 bit Big Endian
|
||||||
14. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
15. ◉ testABunchOfNats successfully decoded 1090519040 using 32 bit Little Endian
|
◉ successfully decoded 1090519040 using 32 bit Little Endian
|
||||||
16. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
17. ◉ testABunchOfNats successfully decoded 4259840 using 64 bit Big Endian
|
◉ successfully decoded 4259840 using 64 bit Big Endian
|
||||||
18. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
19. ◉ testABunchOfNats successfully decoded 4259840 using 64 bit Little Endian
|
◉ successfully decoded 4259840 using 64 bit Little Endian
|
||||||
20. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
21. ◉ testABunchOfNats successfully decoded 4259840 using 32 bit Big Endian
|
◉ successfully decoded 4259840 using 32 bit Big Endian
|
||||||
22. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
23. ◉ testABunchOfNats successfully decoded 4259840 using 32 bit Little Endian
|
◉ successfully decoded 4259840 using 32 bit Little Endian
|
||||||
24. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
25. ◉ testABunchOfNats successfully decoded 16640 using 64 bit Big Endian
|
◉ successfully decoded 16640 using 64 bit Big Endian
|
||||||
26. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
27. ◉ testABunchOfNats successfully decoded 16640 using 64 bit Little Endian
|
◉ successfully decoded 16640 using 64 bit Little Endian
|
||||||
28. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
29. ◉ testABunchOfNats successfully decoded 16640 using 32 bit Big Endian
|
◉ successfully decoded 16640 using 32 bit Big Endian
|
||||||
30. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
31. ◉ testABunchOfNats successfully decoded 16640 using 32 bit Little Endian
|
◉ successfully decoded 16640 using 32 bit Little Endian
|
||||||
32. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
33. ◉ testABunchOfNats successfully decoded 16640 using 16 bit Big Endian
|
◉ successfully decoded 16640 using 16 bit Big Endian
|
||||||
34. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
35. ◉ testABunchOfNats successfully decoded 16640 using 16 bit Little Endian
|
◉ successfully decoded 16640 using 16 bit Little Endian
|
||||||
36. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
37. ◉ testABunchOfNats successfully decoded 2255827097 using 64 bit Big Endian
|
◉ successfully decoded 2255827097 using 64 bit Big Endian
|
||||||
38. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
39. ◉ testABunchOfNats successfully decoded 2255827097 using 64 bit Little Endian
|
◉ successfully decoded 2255827097 using 64 bit Little Endian
|
||||||
40. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
41. ◉ testABunchOfNats successfully decoded 2255827097 using 32 bit Big Endian
|
◉ successfully decoded 2255827097 using 32 bit Big Endian
|
||||||
42. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
43. ◉ testABunchOfNats successfully decoded 2255827097 using 32 bit Little Endian
|
◉ successfully decoded 2255827097 using 32 bit Little Endian
|
||||||
44. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
45. ◉ testABunchOfNats successfully decoded 65 using 64 bit Big Endian
|
◉ successfully decoded 65 using 64 bit Big Endian
|
||||||
46. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
47. ◉ testABunchOfNats successfully decoded 65 using 64 bit Little Endian
|
◉ successfully decoded 65 using 64 bit Little Endian
|
||||||
48. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
49. ◉ testABunchOfNats successfully decoded 65 using 32 bit Big Endian
|
◉ successfully decoded 65 using 32 bit Big Endian
|
||||||
50. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
51. ◉ testABunchOfNats successfully decoded 65 using 32 bit Little Endian
|
◉ successfully decoded 65 using 32 bit Little Endian
|
||||||
52. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
53. ◉ testABunchOfNats successfully decoded 65 using 16 bit Big Endian
|
◉ successfully decoded 65 using 16 bit Big Endian
|
||||||
54. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
55. ◉ testABunchOfNats successfully decoded 65 using 16 bit Little Endian
|
◉ successfully decoded 65 using 16 bit Little Endian
|
||||||
56. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
57. ◉ testABunchOfNats successfully decoded 0 using 64 bit Big Endian
|
◉ successfully decoded 0 using 64 bit Big Endian
|
||||||
58. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
59. ◉ testABunchOfNats successfully decoded 0 using 64 bit Little Endian
|
◉ successfully decoded 0 using 64 bit Little Endian
|
||||||
60. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
61. ◉ testABunchOfNats successfully decoded 0 using 32 bit Big Endian
|
◉ successfully decoded 0 using 32 bit Big Endian
|
||||||
62. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
63. ◉ testABunchOfNats successfully decoded 0 using 32 bit Little Endian
|
◉ successfully decoded 0 using 32 bit Little Endian
|
||||||
64. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
65. ◉ testABunchOfNats successfully decoded 0 using 16 bit Big Endian
|
◉ successfully decoded 0 using 16 bit Big Endian
|
||||||
66. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
67. ◉ testABunchOfNats successfully decoded 0 using 16 bit Little Endian
|
◉ successfully decoded 0 using 16 bit Little Endian
|
||||||
68. ◉ testABunchOfNats consumed all input
|
◉ consumed all input
|
||||||
|
|
||||||
✅ 68 test(s) passing
|
✅ 68 test(s) passing
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ swapped name link =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -236,9 +236,9 @@ we gain the ability to capture output in a transcript, it can be modified
|
|||||||
to actual show that the serialization works.
|
to actual show that the serialization works.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test tests
|
scratch/main> io.test tests
|
||||||
.> io.test badLoad
|
scratch/main> io.test badLoad
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -278,8 +278,8 @@ codeTests =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test codeTests
|
scratch/main> io.test codeTests
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -309,6 +309,6 @@ vtests _ =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test vtests
|
scratch/main> io.test vtests
|
||||||
```
|
```
|
||||||
|
@ -200,7 +200,7 @@ swapped name link =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -344,7 +344,7 @@ we gain the ability to capture output in a transcript, it can be modified
|
|||||||
to actual show that the serialization works.
|
to actual show that the serialization works.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -360,33 +360,33 @@ to actual show that the serialization works.
|
|||||||
tests : '{IO} [Result]
|
tests : '{IO} [Result]
|
||||||
zapper : Three Nat Nat Nat -> Request {Zap} r -> r
|
zapper : Three Nat Nat Nat -> Request {Zap} r -> r
|
||||||
|
|
||||||
.> io.test tests
|
scratch/main> io.test tests
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ tests (ext f) passed
|
1. tests ◉ (ext f) passed
|
||||||
2. ◉ tests (ext h) passed
|
◉ (ext h) passed
|
||||||
3. ◉ tests (ident compound) passed
|
◉ (ident compound) passed
|
||||||
4. ◉ tests (ident fib10) passed
|
◉ (ident fib10) passed
|
||||||
5. ◉ tests (ident effect) passed
|
◉ (ident effect) passed
|
||||||
6. ◉ tests (ident zero) passed
|
◉ (ident zero) passed
|
||||||
7. ◉ tests (ident h) passed
|
◉ (ident h) passed
|
||||||
8. ◉ tests (ident text) passed
|
◉ (ident text) passed
|
||||||
9. ◉ tests (ident int) passed
|
◉ (ident int) passed
|
||||||
10. ◉ tests (ident float) passed
|
◉ (ident float) passed
|
||||||
11. ◉ tests (ident termlink) passed
|
◉ (ident termlink) passed
|
||||||
12. ◉ tests (ident bool) passed
|
◉ (ident bool) passed
|
||||||
13. ◉ tests (ident bytes) passed
|
◉ (ident bytes) passed
|
||||||
|
|
||||||
✅ 13 test(s) passing
|
✅ 13 test(s) passing
|
||||||
|
|
||||||
Tip: Use view 1 to view the source of a test.
|
Tip: Use view 1 to view the source of a test.
|
||||||
|
|
||||||
.> io.test badLoad
|
scratch/main> io.test badLoad
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ badLoad serialized77
|
1. badLoad ◉ serialized77
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
@ -443,46 +443,46 @@ codeTests =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
codeTests : '{IO} [Result]
|
codeTests : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test codeTests
|
scratch/main> io.test codeTests
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ codeTests (idem f) passed
|
1. codeTests ◉ (idem f) passed
|
||||||
2. ◉ codeTests (idem h) passed
|
◉ (idem h) passed
|
||||||
3. ◉ codeTests (idem rotate) passed
|
◉ (idem rotate) passed
|
||||||
4. ◉ codeTests (idem zapper) passed
|
◉ (idem zapper) passed
|
||||||
5. ◉ codeTests (idem showThree) passed
|
◉ (idem showThree) passed
|
||||||
6. ◉ codeTests (idem concatMap) passed
|
◉ (idem concatMap) passed
|
||||||
7. ◉ codeTests (idem big) passed
|
◉ (idem big) passed
|
||||||
8. ◉ codeTests (idem extensionality) passed
|
◉ (idem extensionality) passed
|
||||||
9. ◉ codeTests (idem identicality) passed
|
◉ (idem identicality) passed
|
||||||
10. ◉ codeTests (verified f) passed
|
◉ (verified f) passed
|
||||||
11. ◉ codeTests (verified h) passed
|
◉ (verified h) passed
|
||||||
12. ◉ codeTests (verified rotate) passed
|
◉ (verified rotate) passed
|
||||||
13. ◉ codeTests (verified zapper) passed
|
◉ (verified zapper) passed
|
||||||
14. ◉ codeTests (verified showThree) passed
|
◉ (verified showThree) passed
|
||||||
15. ◉ codeTests (verified concatMap) passed
|
◉ (verified concatMap) passed
|
||||||
16. ◉ codeTests (verified big) passed
|
◉ (verified big) passed
|
||||||
17. ◉ codeTests (verified extensionality) passed
|
◉ (verified extensionality) passed
|
||||||
18. ◉ codeTests (verified identicality) passed
|
◉ (verified identicality) passed
|
||||||
19. ◉ codeTests (verified mutual0) passed
|
◉ (verified mutual0) passed
|
||||||
20. ◉ codeTests (verified mutual1) passed
|
◉ (verified mutual1) passed
|
||||||
21. ◉ codeTests (verified mutual2) passed
|
◉ (verified mutual2) passed
|
||||||
22. ◉ codeTests (rejected missing mutual0) passed
|
◉ (rejected missing mutual0) passed
|
||||||
23. ◉ codeTests (rejected missing mutual1) passed
|
◉ (rejected missing mutual1) passed
|
||||||
24. ◉ codeTests (rejected missing mutual2) passed
|
◉ (rejected missing mutual2) passed
|
||||||
25. ◉ codeTests (rejected swapped zapper) passed
|
◉ (rejected swapped zapper) passed
|
||||||
26. ◉ codeTests (rejected swapped extensionality) passed
|
◉ (rejected swapped extensionality) passed
|
||||||
27. ◉ codeTests (rejected swapped identicality) passed
|
◉ (rejected swapped identicality) passed
|
||||||
28. ◉ codeTests (rejected swapped mututal0) passed
|
◉ (rejected swapped mututal0) passed
|
||||||
29. ◉ codeTests (rejected swapped mututal1) passed
|
◉ (rejected swapped mututal1) passed
|
||||||
30. ◉ codeTests (rejected swapped mututal2) passed
|
◉ (rejected swapped mututal2) passed
|
||||||
|
|
||||||
✅ 30 test(s) passing
|
✅ 30 test(s) passing
|
||||||
|
|
||||||
@ -530,25 +530,25 @@ vtests _ =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
validateTest : Link.Term ->{IO} Result
|
validateTest : Link.Term ->{IO} Result
|
||||||
vtests : '{IO} [Result]
|
vtests : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test vtests
|
scratch/main> io.test vtests
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ vtests validated
|
1. vtests ◉ validated
|
||||||
2. ◉ vtests validated
|
◉ validated
|
||||||
3. ◉ vtests validated
|
◉ validated
|
||||||
4. ◉ vtests validated
|
◉ validated
|
||||||
5. ◉ vtests validated
|
◉ validated
|
||||||
6. ◉ vtests validated
|
◉ validated
|
||||||
7. ◉ vtests validated
|
◉ validated
|
||||||
8. ◉ vtests validated
|
◉ validated
|
||||||
|
|
||||||
✅ 8 test(s) passing
|
✅ 8 test(s) passing
|
||||||
|
|
||||||
|
@ -33,9 +33,9 @@ Notice that an anonymous documentation block `{{ ... }}` before a definition `Im
|
|||||||
You can preview what docs will look like when rendered to the console using the `display` or `docs` commands:
|
You can preview what docs will look like when rendered to the console using the `display` or `docs` commands:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> display d1
|
scratch/main> display d1
|
||||||
.> docs ImportantConstant
|
scratch/main> docs ImportantConstant
|
||||||
.> docs DayOfWeek
|
scratch/main> docs DayOfWeek
|
||||||
```
|
```
|
||||||
|
|
||||||
The `docs ImportantConstant` command will look for `ImportantConstant.doc` in the file or codebase. You can do this instead of explicitly linking docs to definitions.
|
The `docs ImportantConstant` command will look for `ImportantConstant.doc` in the file or codebase. You can do this instead of explicitly linking docs to definitions.
|
||||||
@ -45,11 +45,11 @@ The `docs ImportantConstant` command will look for `ImportantConstant.doc` in th
|
|||||||
First, we'll load the `syntax.u` file which has examples of all the syntax:
|
First, we'll load the `syntax.u` file which has examples of all the syntax:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
|
scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Now we can review different portions of the guide.
|
Now we can review different portions of the guide.
|
||||||
@ -57,25 +57,25 @@ we'll show both the pretty-printed source using `view`
|
|||||||
and the rendered output using `display`:
|
and the rendered output using `display`:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view basicFormatting
|
scratch/main> view basicFormatting
|
||||||
.> display basicFormatting
|
scratch/main> display basicFormatting
|
||||||
.> view lists
|
scratch/main> view lists
|
||||||
.> display lists
|
scratch/main> display lists
|
||||||
.> view evaluation
|
scratch/main> view evaluation
|
||||||
.> display evaluation
|
scratch/main> display evaluation
|
||||||
.> view includingSource
|
scratch/main> view includingSource
|
||||||
.> display includingSource
|
scratch/main> display includingSource
|
||||||
.> view nonUnisonCodeBlocks
|
scratch/main> view nonUnisonCodeBlocks
|
||||||
.> display nonUnisonCodeBlocks
|
scratch/main> display nonUnisonCodeBlocks
|
||||||
.> view otherElements
|
scratch/main> view otherElements
|
||||||
.> display otherElements
|
scratch/main> display otherElements
|
||||||
```
|
```
|
||||||
|
|
||||||
Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way:
|
Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view doc.guide
|
scratch/main> view doc.guide
|
||||||
.> display doc.guide
|
scratch/main> display doc.guide
|
||||||
```
|
```
|
||||||
|
|
||||||
🌻 THE END
|
🌻 THE END
|
||||||
|
@ -51,15 +51,15 @@ Notice that an anonymous documentation block `{{ ... }}` before a definition `Im
|
|||||||
You can preview what docs will look like when rendered to the console using the `display` or `docs` commands:
|
You can preview what docs will look like when rendered to the console using the `display` or `docs` commands:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> display d1
|
scratch/main> display d1
|
||||||
|
|
||||||
Hello there Alice!
|
Hello there Alice!
|
||||||
|
|
||||||
.> docs ImportantConstant
|
scratch/main> docs ImportantConstant
|
||||||
|
|
||||||
An important constant, equal to `42`
|
An important constant, equal to `42`
|
||||||
|
|
||||||
.> docs DayOfWeek
|
scratch/main> docs DayOfWeek
|
||||||
|
|
||||||
The 7 days of the week, defined as:
|
The 7 days of the week, defined as:
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ The `docs ImportantConstant` command will look for `ImportantConstant.doc` in th
|
|||||||
First, we'll load the `syntax.u` file which has examples of all the syntax:
|
First, we'll load the `syntax.u` file which has examples of all the syntax:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
|
scratch/main> load ./unison-src/transcripts-using-base/doc.md.files/syntax.u
|
||||||
|
|
||||||
Loading changes detected in
|
Loading changes detected in
|
||||||
./unison-src/transcripts-using-base/doc.md.files/syntax.u.
|
./unison-src/transcripts-using-base/doc.md.files/syntax.u.
|
||||||
@ -100,7 +100,7 @@ we'll show both the pretty-printed source using `view`
|
|||||||
and the rendered output using `display`:
|
and the rendered output using `display`:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view basicFormatting
|
scratch/main> view basicFormatting
|
||||||
|
|
||||||
basicFormatting : Doc2
|
basicFormatting : Doc2
|
||||||
basicFormatting =
|
basicFormatting =
|
||||||
@ -130,7 +130,7 @@ and the rendered output using `display`:
|
|||||||
__Next up:__ {lists}
|
__Next up:__ {lists}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
.> display basicFormatting
|
scratch/main> display basicFormatting
|
||||||
|
|
||||||
# Basic formatting
|
# Basic formatting
|
||||||
|
|
||||||
@ -155,7 +155,7 @@ and the rendered output using `display`:
|
|||||||
|
|
||||||
*Next up:* lists
|
*Next up:* lists
|
||||||
|
|
||||||
.> view lists
|
scratch/main> view lists
|
||||||
|
|
||||||
lists : Doc2
|
lists : Doc2
|
||||||
lists =
|
lists =
|
||||||
@ -198,7 +198,7 @@ and the rendered output using `display`:
|
|||||||
3. Get dressed.
|
3. Get dressed.
|
||||||
}}
|
}}
|
||||||
|
|
||||||
.> display lists
|
scratch/main> display lists
|
||||||
|
|
||||||
# Lists
|
# Lists
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ and the rendered output using `display`:
|
|||||||
2. Take shower.
|
2. Take shower.
|
||||||
3. Get dressed.
|
3. Get dressed.
|
||||||
|
|
||||||
.> view evaluation
|
scratch/main> view evaluation
|
||||||
|
|
||||||
evaluation : Doc2
|
evaluation : Doc2
|
||||||
evaluation =
|
evaluation =
|
||||||
@ -272,7 +272,7 @@ and the rendered output using `display`:
|
|||||||
```
|
```
|
||||||
}}
|
}}
|
||||||
|
|
||||||
.> display evaluation
|
scratch/main> display evaluation
|
||||||
|
|
||||||
# Evaluation
|
# Evaluation
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ and the rendered output using `display`:
|
|||||||
cube : Nat -> Nat
|
cube : Nat -> Nat
|
||||||
cube x = x * x * x
|
cube x = x * x * x
|
||||||
|
|
||||||
.> view includingSource
|
scratch/main> view includingSource
|
||||||
|
|
||||||
includingSource : Doc2
|
includingSource : Doc2
|
||||||
includingSource =
|
includingSource =
|
||||||
@ -341,7 +341,7 @@ and the rendered output using `display`:
|
|||||||
{{ docExample 1 do x -> sqr x }}.
|
{{ docExample 1 do x -> sqr x }}.
|
||||||
}}
|
}}
|
||||||
|
|
||||||
.> display includingSource
|
scratch/main> display includingSource
|
||||||
|
|
||||||
# Including Unison source code
|
# Including Unison source code
|
||||||
|
|
||||||
@ -387,7 +387,7 @@ and the rendered output using `display`:
|
|||||||
application, you can put it in double backticks, like
|
application, you can put it in double backticks, like
|
||||||
so: `sqr x`. This is equivalent to `sqr x`.
|
so: `sqr x`. This is equivalent to `sqr x`.
|
||||||
|
|
||||||
.> view nonUnisonCodeBlocks
|
scratch/main> view nonUnisonCodeBlocks
|
||||||
|
|
||||||
nonUnisonCodeBlocks : Doc2
|
nonUnisonCodeBlocks : Doc2
|
||||||
nonUnisonCodeBlocks =
|
nonUnisonCodeBlocks =
|
||||||
@ -420,7 +420,7 @@ and the rendered output using `display`:
|
|||||||
```
|
```
|
||||||
}}
|
}}
|
||||||
|
|
||||||
.> display nonUnisonCodeBlocks
|
scratch/main> display nonUnisonCodeBlocks
|
||||||
|
|
||||||
# Non-Unison code blocks
|
# Non-Unison code blocks
|
||||||
|
|
||||||
@ -449,7 +449,7 @@ and the rendered output using `display`:
|
|||||||
xs.foldLeft(Nil : List[A])((acc,a) => a +: acc)
|
xs.foldLeft(Nil : List[A])((acc,a) => a +: acc)
|
||||||
```
|
```
|
||||||
|
|
||||||
.> view otherElements
|
scratch/main> view otherElements
|
||||||
|
|
||||||
otherElements : Doc2
|
otherElements : Doc2
|
||||||
otherElements =
|
otherElements =
|
||||||
@ -506,7 +506,7 @@ and the rendered output using `display`:
|
|||||||
] }}
|
] }}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
.> display otherElements
|
scratch/main> display otherElements
|
||||||
|
|
||||||
There are also asides, callouts, tables, tooltips, and more.
|
There are also asides, callouts, tables, tooltips, and more.
|
||||||
These don't currently have special syntax; just use the
|
These don't currently have special syntax; just use the
|
||||||
@ -549,7 +549,7 @@ and the rendered output using `display`:
|
|||||||
Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way:
|
Lastly, it's common to build longer documents including subdocuments via `{{ subdoc }}`. We can stitch together the full syntax guide in this way:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view doc.guide
|
scratch/main> view doc.guide
|
||||||
|
|
||||||
doc.guide : Doc2
|
doc.guide : Doc2
|
||||||
doc.guide =
|
doc.guide =
|
||||||
@ -569,7 +569,7 @@ Lastly, it's common to build longer documents including subdocuments via `{{ sub
|
|||||||
{{ otherElements }}
|
{{ otherElements }}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
.> display doc.guide
|
scratch/main> display doc.guide
|
||||||
|
|
||||||
# Unison computable documentation
|
# Unison computable documentation
|
||||||
|
|
||||||
|
@ -19,13 +19,13 @@ test2 = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> io.test test1
|
scratch/main> io.test test1
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> io.test test2
|
scratch/main> io.test test2
|
||||||
```
|
```
|
||||||
|
@ -33,7 +33,7 @@ test2 = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ test2 = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> io.test test1
|
scratch/main> io.test test1
|
||||||
|
|
||||||
💔💥
|
💔💥
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ test2 = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> io.test test2
|
scratch/main> io.test test2
|
||||||
|
|
||||||
💔💥
|
💔💥
|
||||||
|
|
||||||
|
@ -10,5 +10,5 @@ timingApp2 _ =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> run timingApp2
|
scratch/main> run timingApp2
|
||||||
```
|
```
|
||||||
|
@ -23,7 +23,7 @@ timingApp2 _ =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> run timingApp2
|
scratch/main> run timingApp2
|
||||||
|
|
||||||
()
|
()
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ meh = 9
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> find meh
|
scratch/main> find meh
|
||||||
.> docs 1
|
scratch/main> docs 1
|
||||||
```
|
```
|
||||||
|
@ -20,20 +20,20 @@ meh = 9
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
meh : Nat
|
meh : Nat
|
||||||
meh.doc : Doc2
|
meh.doc : Doc2
|
||||||
|
|
||||||
.> find meh
|
scratch/main> find meh
|
||||||
|
|
||||||
1. meh : Nat
|
1. meh : Nat
|
||||||
2. meh.doc : Doc2
|
2. meh.doc : Doc2
|
||||||
|
|
||||||
|
|
||||||
.> docs 1
|
scratch/main> docs 1
|
||||||
|
|
||||||
A simple doc.
|
A simple doc.
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases.
|
Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> ls builtin.Bytes
|
scratch/main> ls builtin.Bytes
|
||||||
```
|
```
|
||||||
Notice the `fromBase16` and `toBase16` functions. Here's some convenience functions for converting `Bytes` to and from base-16 `Text`.
|
Notice the `fromBase16` and `toBase16` functions. Here's some convenience functions for converting `Bytes` to and from base-16 `Text`.
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex
|
|||||||
And here's the full API:
|
And here's the full API:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> find-in builtin.crypto
|
scratch/main> find-in builtin.crypto
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the universal versions of `hash` and `hmac` are currently unimplemented and will bomb at runtime:
|
Note that the universal versions of `hash` and `hmac` are currently unimplemented and will bomb at runtime:
|
||||||
@ -189,11 +189,11 @@ test> crypto.hash.numTests =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> test
|
scratch/main> test
|
||||||
```
|
```
|
||||||
|
|
||||||
## HMAC tests
|
## HMAC tests
|
||||||
@ -251,9 +251,9 @@ test> md5.tests.ex3 =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> test
|
scratch/main> test
|
||||||
```
|
```
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases.
|
Unison has cryptographic builtins for hashing and computing [HMACs](https://en.wikipedia.org/wiki/HMAC) (hash-based message authentication codes). This transcript shows their usage and has some test cases.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> ls builtin.Bytes
|
scratch/main> ls builtin.Bytes
|
||||||
|
|
||||||
1. ++ (Bytes -> Bytes -> Bytes)
|
1. ++ (Bytes -> Bytes -> Bytes)
|
||||||
2. at (Nat -> Bytes -> Optional Nat)
|
2. at (Nat -> Bytes -> Optional Nat)
|
||||||
@ -120,7 +120,7 @@ ex5 = crypto.hmac Sha2_256 mysecret f |> hex
|
|||||||
And here's the full API:
|
And here's the full API:
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> find-in builtin.crypto
|
scratch/main> find-in builtin.crypto
|
||||||
|
|
||||||
1. type CryptoFailure
|
1. type CryptoFailure
|
||||||
2. Ed25519.sign.impl : Bytes
|
2. Ed25519.sign.impl : Bytes
|
||||||
@ -312,35 +312,35 @@ test> crypto.hash.numTests =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> test
|
scratch/main> test
|
||||||
|
|
||||||
Cached test results (`help testcache` to learn more)
|
Cached test results (`help testcache` to learn more)
|
||||||
|
|
||||||
1. ◉ blake2b_512.tests.ex1 Passed
|
1. blake2b_512.tests.ex1 ◉ Passed
|
||||||
2. ◉ blake2b_512.tests.ex2 Passed
|
2. blake2b_512.tests.ex2 ◉ Passed
|
||||||
3. ◉ blake2b_512.tests.ex3 Passed
|
3. blake2b_512.tests.ex3 ◉ Passed
|
||||||
4. ◉ blake2s_256.tests.ex1 Passed
|
4. blake2s_256.tests.ex1 ◉ Passed
|
||||||
5. ◉ crypto.hash.numTests Passed
|
5. crypto.hash.numTests ◉ Passed
|
||||||
6. ◉ sha1.tests.ex1 Passed
|
6. sha1.tests.ex1 ◉ Passed
|
||||||
7. ◉ sha1.tests.ex2 Passed
|
7. sha1.tests.ex2 ◉ Passed
|
||||||
8. ◉ sha1.tests.ex3 Passed
|
8. sha1.tests.ex3 ◉ Passed
|
||||||
9. ◉ sha1.tests.ex4 Passed
|
9. sha1.tests.ex4 ◉ Passed
|
||||||
10. ◉ sha2_256.tests.ex1 Passed
|
10. sha2_256.tests.ex1 ◉ Passed
|
||||||
11. ◉ sha2_256.tests.ex2 Passed
|
11. sha2_256.tests.ex2 ◉ Passed
|
||||||
12. ◉ sha2_256.tests.ex3 Passed
|
12. sha2_256.tests.ex3 ◉ Passed
|
||||||
13. ◉ sha2_256.tests.ex4 Passed
|
13. sha2_256.tests.ex4 ◉ Passed
|
||||||
14. ◉ sha2_512.tests.ex1 Passed
|
14. sha2_512.tests.ex1 ◉ Passed
|
||||||
15. ◉ sha2_512.tests.ex2 Passed
|
15. sha2_512.tests.ex2 ◉ Passed
|
||||||
16. ◉ sha2_512.tests.ex3 Passed
|
16. sha2_512.tests.ex3 ◉ Passed
|
||||||
17. ◉ sha2_512.tests.ex4 Passed
|
17. sha2_512.tests.ex4 ◉ Passed
|
||||||
18. ◉ sha3_256.tests.ex1 Passed
|
18. sha3_256.tests.ex1 ◉ Passed
|
||||||
19. ◉ sha3_256.tests.ex2 Passed
|
19. sha3_256.tests.ex2 ◉ Passed
|
||||||
20. ◉ sha3_256.tests.ex3 Passed
|
20. sha3_256.tests.ex3 ◉ Passed
|
||||||
21. ◉ sha3_256.tests.ex4 Passed
|
21. sha3_256.tests.ex4 ◉ Passed
|
||||||
22. ◉ sha3_512.tests.ex1 Passed
|
22. sha3_512.tests.ex1 ◉ Passed
|
||||||
23. ◉ sha3_512.tests.ex2 Passed
|
23. sha3_512.tests.ex2 ◉ Passed
|
||||||
24. ◉ sha3_512.tests.ex3 Passed
|
24. sha3_512.tests.ex3 ◉ Passed
|
||||||
25. ◉ sha3_512.tests.ex4 Passed
|
25. sha3_512.tests.ex4 ◉ Passed
|
||||||
|
|
||||||
✅ 25 test(s) passing
|
✅ 25 test(s) passing
|
||||||
|
|
||||||
@ -474,38 +474,38 @@ test> md5.tests.ex3 =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> test
|
scratch/main> test
|
||||||
|
|
||||||
Cached test results (`help testcache` to learn more)
|
Cached test results (`help testcache` to learn more)
|
||||||
|
|
||||||
1. ◉ blake2b_512.tests.ex1 Passed
|
1. blake2b_512.tests.ex1 ◉ Passed
|
||||||
2. ◉ blake2b_512.tests.ex2 Passed
|
2. blake2b_512.tests.ex2 ◉ Passed
|
||||||
3. ◉ blake2b_512.tests.ex3 Passed
|
3. blake2b_512.tests.ex3 ◉ Passed
|
||||||
4. ◉ blake2s_256.tests.ex1 Passed
|
4. blake2s_256.tests.ex1 ◉ Passed
|
||||||
5. ◉ crypto.hash.numTests Passed
|
5. crypto.hash.numTests ◉ Passed
|
||||||
6. ◉ md5.tests.ex1 Passed
|
6. md5.tests.ex1 ◉ Passed
|
||||||
7. ◉ md5.tests.ex2 Passed
|
7. md5.tests.ex2 ◉ Passed
|
||||||
8. ◉ md5.tests.ex3 Passed
|
8. md5.tests.ex3 ◉ Passed
|
||||||
9. ◉ sha1.tests.ex1 Passed
|
9. sha1.tests.ex1 ◉ Passed
|
||||||
10. ◉ sha1.tests.ex2 Passed
|
10. sha1.tests.ex2 ◉ Passed
|
||||||
11. ◉ sha1.tests.ex3 Passed
|
11. sha1.tests.ex3 ◉ Passed
|
||||||
12. ◉ sha1.tests.ex4 Passed
|
12. sha1.tests.ex4 ◉ Passed
|
||||||
13. ◉ sha2_256.tests.ex1 Passed
|
13. sha2_256.tests.ex1 ◉ Passed
|
||||||
14. ◉ sha2_256.tests.ex2 Passed
|
14. sha2_256.tests.ex2 ◉ Passed
|
||||||
15. ◉ sha2_256.tests.ex3 Passed
|
15. sha2_256.tests.ex3 ◉ Passed
|
||||||
16. ◉ sha2_256.tests.ex4 Passed
|
16. sha2_256.tests.ex4 ◉ Passed
|
||||||
17. ◉ sha2_512.tests.ex1 Passed
|
17. sha2_512.tests.ex1 ◉ Passed
|
||||||
18. ◉ sha2_512.tests.ex2 Passed
|
18. sha2_512.tests.ex2 ◉ Passed
|
||||||
19. ◉ sha2_512.tests.ex3 Passed
|
19. sha2_512.tests.ex3 ◉ Passed
|
||||||
20. ◉ sha2_512.tests.ex4 Passed
|
20. sha2_512.tests.ex4 ◉ Passed
|
||||||
21. ◉ sha3_256.tests.ex1 Passed
|
21. sha3_256.tests.ex1 ◉ Passed
|
||||||
22. ◉ sha3_256.tests.ex2 Passed
|
22. sha3_256.tests.ex2 ◉ Passed
|
||||||
23. ◉ sha3_256.tests.ex3 Passed
|
23. sha3_256.tests.ex3 ◉ Passed
|
||||||
24. ◉ sha3_256.tests.ex4 Passed
|
24. sha3_256.tests.ex4 ◉ Passed
|
||||||
25. ◉ sha3_512.tests.ex1 Passed
|
25. sha3_512.tests.ex1 ◉ Passed
|
||||||
26. ◉ sha3_512.tests.ex2 Passed
|
26. sha3_512.tests.ex2 ◉ Passed
|
||||||
27. ◉ sha3_512.tests.ex3 Passed
|
27. sha3_512.tests.ex3 ◉ Passed
|
||||||
28. ◉ sha3_512.tests.ex4 Passed
|
28. sha3_512.tests.ex4 ◉ Passed
|
||||||
|
|
||||||
✅ 28 test(s) passing
|
✅ 28 test(s) passing
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ testMvars _ =
|
|||||||
runTest test
|
runTest test
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testMvars
|
scratch/main> io.test testMvars
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -66,30 +66,30 @@ testMvars _ =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean
|
eitherCk : (a ->{g} Boolean) -> Either e a ->{g} Boolean
|
||||||
testMvars : '{IO} [Result]
|
testMvars : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test testMvars
|
scratch/main> io.test testMvars
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testMvars ma should not be empty
|
1. testMvars ◉ ma should not be empty
|
||||||
2. ◉ testMvars should read what you sow
|
◉ should read what you sow
|
||||||
3. ◉ testMvars should reap what you sow
|
◉ should reap what you sow
|
||||||
4. ◉ testMvars ma should be empty
|
◉ ma should be empty
|
||||||
5. ◉ testMvars swap returns old contents
|
◉ swap returns old contents
|
||||||
6. ◉ testMvars swap returns old contents
|
◉ swap returns old contents
|
||||||
7. ◉ testMvars tryRead should succeed when not empty
|
◉ tryRead should succeed when not empty
|
||||||
8. ◉ testMvars tryPut should fail when not empty
|
◉ tryPut should fail when not empty
|
||||||
9. ◉ testMvars tryTake should succeed when not empty
|
◉ tryTake should succeed when not empty
|
||||||
10. ◉ testMvars tryTake should not succeed when empty
|
◉ tryTake should not succeed when empty
|
||||||
11. ◉ testMvars ma2 should be empty
|
◉ ma2 should be empty
|
||||||
12. ◉ testMvars tryTake should fail when empty
|
◉ tryTake should fail when empty
|
||||||
13. ◉ testMvars tryRead should fail when empty
|
◉ tryRead should fail when empty
|
||||||
|
|
||||||
✅ 13 test(s) passing
|
✅ 13 test(s) passing
|
||||||
|
|
||||||
|
@ -33,6 +33,6 @@ test = 'let
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test test
|
scratch/main> io.test test
|
||||||
```
|
```
|
||||||
|
@ -49,7 +49,7 @@ test = 'let
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -59,24 +59,24 @@ test = 'let
|
|||||||
-> Optional Float
|
-> Optional Float
|
||||||
->{Stream Result} ()
|
->{Stream Result} ()
|
||||||
|
|
||||||
.> io.test test
|
scratch/main> io.test test
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ test expected 0.0 got 0.0
|
1. test ◉ expected 0.0 got 0.0
|
||||||
2. ◉ test round trip though float, expected 0 got 0
|
◉ round trip though float, expected 0 got 0
|
||||||
3. ◉ test expected 0 got 0
|
◉ expected 0 got 0
|
||||||
4. ◉ test round trip though Int, expected 0 got 0
|
◉ round trip though Int, expected 0 got 0
|
||||||
5. ◉ test skipped
|
◉ skipped
|
||||||
6. ◉ test expected 1 got 1
|
◉ expected 1 got 1
|
||||||
7. ◉ test round trip though Int, expected 1 got 1
|
◉ round trip though Int, expected 1 got 1
|
||||||
8. ◉ test skipped
|
◉ skipped
|
||||||
9. ◉ test expected -1 got -1
|
◉ expected -1 got -1
|
||||||
10. ◉ test round trip though Int, expected 18446744073709551615 got 18446744073709551615
|
◉ round trip though Int, expected 18446744073709551615 got 18446744073709551615
|
||||||
11. ◉ test expected 1.0000000000000002 got 1.0000000000000002
|
◉ expected 1.0000000000000002 got 1.0000000000000002
|
||||||
12. ◉ test round trip though float, expected 4607182418800017409 got 4607182418800017409
|
◉ round trip though float, expected 4607182418800017409 got 4607182418800017409
|
||||||
13. ◉ test expected 4607182418800017409 got 4607182418800017409
|
◉ expected 4607182418800017409 got 4607182418800017409
|
||||||
14. ◉ test round trip though Int, expected 4607182418800017409 got 4607182418800017409
|
◉ round trip though Int, expected 4607182418800017409 got 4607182418800017409
|
||||||
|
|
||||||
✅ 14 test(s) passing
|
✅ 14 test(s) passing
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ socketAccept = compose reraise socketAccept.impl
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
# Tests for network related builtins
|
# Tests for network related builtins
|
||||||
@ -93,8 +93,8 @@ testDefaultPort _ =
|
|||||||
runTest test
|
runTest test
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testDefaultPort
|
scratch/main> io.test testDefaultPort
|
||||||
```
|
```
|
||||||
|
|
||||||
This example demonstrates connecting a TCP client socket to a TCP server socket. A thread is started for both client and server. The server socket asks for any availalbe port (by passing "0" as the port number). The server thread then queries for the actual assigned port number, and puts that into an MVar which the client thread can read. The client thread then reads a string from the server and reports it back to the main thread via a different MVar.
|
This example demonstrates connecting a TCP client socket to a TCP server socket. A thread is started for both client and server. The server socket asks for any availalbe port (by passing "0" as the port number). The server thread then queries for the actual assigned port number, and puts that into an MVar which the client thread can read. The client thread then reads a string from the server and reports it back to the main thread via a different MVar.
|
||||||
@ -149,6 +149,6 @@ testTcpConnect = 'let
|
|||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
|
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testTcpConnect
|
scratch/main> io.test testTcpConnect
|
||||||
```
|
```
|
||||||
|
@ -107,7 +107,7 @@ testDefaultPort _ =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -115,13 +115,13 @@ testDefaultPort _ =
|
|||||||
testDefaultPort : '{IO} [Result]
|
testDefaultPort : '{IO} [Result]
|
||||||
testExplicitHost : '{IO} [Result]
|
testExplicitHost : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test testDefaultPort
|
scratch/main> io.test testDefaultPort
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testDefaultPort successfully created socket
|
1. testDefaultPort ◉ successfully created socket
|
||||||
2. ◉ testDefaultPort port should be > 1024
|
◉ port should be > 1024
|
||||||
3. ◉ testDefaultPort port should be < 65536
|
◉ port should be < 65536
|
||||||
|
|
||||||
✅ 3 test(s) passing
|
✅ 3 test(s) passing
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ testTcpConnect = 'let
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -202,11 +202,11 @@ testTcpConnect = 'let
|
|||||||
serverThread : MVar Nat -> Text -> '{IO} ()
|
serverThread : MVar Nat -> Text -> '{IO} ()
|
||||||
testTcpConnect : '{IO} [Result]
|
testTcpConnect : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test testTcpConnect
|
scratch/main> io.test testTcpConnect
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testTcpConnect should have reaped what we've sown
|
1. testTcpConnect ◉ should have reaped what we've sown
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
|
@ -56,6 +56,6 @@ serialTests = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test serialTests
|
scratch/main> io.test serialTests
|
||||||
```
|
```
|
||||||
|
@ -74,7 +74,7 @@ serialTests = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -85,15 +85,15 @@ serialTests = do
|
|||||||
serialTests : '{IO, Exception} [Result]
|
serialTests : '{IO, Exception} [Result]
|
||||||
shuffle : Nat -> [a] -> [a]
|
shuffle : Nat -> [a] -> [a]
|
||||||
|
|
||||||
.> io.test serialTests
|
scratch/main> io.test serialTests
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ serialTests case-00
|
1. serialTests ◉ case-00
|
||||||
2. ◉ serialTests case-01
|
◉ case-01
|
||||||
3. ◉ serialTests case-02
|
◉ case-02
|
||||||
4. ◉ serialTests case-03
|
◉ case-03
|
||||||
5. ◉ serialTests case-04
|
◉ case-04
|
||||||
|
|
||||||
✅ 5 test(s) passing
|
✅ 5 test(s) passing
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ casTest = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test casTest
|
scratch/main> io.test casTest
|
||||||
```
|
```
|
||||||
|
|
||||||
Promise is a simple one-shot awaitable condition.
|
Promise is a simple one-shot awaitable condition.
|
||||||
@ -54,9 +54,9 @@ promiseConcurrentTest = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test promiseSequentialTest
|
scratch/main> io.test promiseSequentialTest
|
||||||
.> io.test promiseConcurrentTest
|
scratch/main> io.test promiseConcurrentTest
|
||||||
```
|
```
|
||||||
|
|
||||||
CAS can be used to write an atomic update function.
|
CAS can be used to write an atomic update function.
|
||||||
@ -70,7 +70,7 @@ atomicUpdate ref f =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Promise can be used to write an operation that spawns N concurrent
|
Promise can be used to write an operation that spawns N concurrent
|
||||||
@ -91,7 +91,7 @@ spawnN n fa =
|
|||||||
map Promise.read (go n [])
|
map Promise.read (go n [])
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
We can use these primitives to write a more interesting example, where
|
We can use these primitives to write a more interesting example, where
|
||||||
@ -123,6 +123,6 @@ fullTest = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test fullTest
|
scratch/main> io.test fullTest
|
||||||
```
|
```
|
||||||
|
@ -32,18 +32,18 @@ casTest = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
casTest : '{IO} [Result]
|
casTest : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test casTest
|
scratch/main> io.test casTest
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ casTest CAS is successful is there were no conflicting writes
|
1. casTest ◉ CAS is successful is there were no conflicting writes
|
||||||
2. ◉ casTest CAS fails when there was an intervening write
|
◉ CAS fails when there was an intervening write
|
||||||
|
|
||||||
✅ 2 test(s) passing
|
✅ 2 test(s) passing
|
||||||
|
|
||||||
@ -95,29 +95,29 @@ promiseConcurrentTest = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
promiseConcurrentTest : '{IO} [Result]
|
promiseConcurrentTest : '{IO} [Result]
|
||||||
promiseSequentialTest : '{IO} [Result]
|
promiseSequentialTest : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test promiseSequentialTest
|
scratch/main> io.test promiseSequentialTest
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ promiseSequentialTest Should read a value that's been written
|
1. promiseSequentialTest ◉ Should read a value that's been written
|
||||||
2. ◉ promiseSequentialTest Promise can only be written to once
|
◉ Promise can only be written to once
|
||||||
|
|
||||||
✅ 2 test(s) passing
|
✅ 2 test(s) passing
|
||||||
|
|
||||||
Tip: Use view 1 to view the source of a test.
|
Tip: Use view 1 to view the source of a test.
|
||||||
|
|
||||||
.> io.test promiseConcurrentTest
|
scratch/main> io.test promiseConcurrentTest
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ promiseConcurrentTest Reads awaits for completion of the Promise
|
1. promiseConcurrentTest ◉ Reads awaits for completion of the Promise
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ atomicUpdate ref f =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ spawnN n fa =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -236,17 +236,17 @@ fullTest = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
fullTest : '{IO} [Result]
|
fullTest : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test fullTest
|
scratch/main> io.test fullTest
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ fullTest The state of the counter is consistent
|
1. fullTest ◉ The state of the counter is consistent
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
|
@ -68,6 +68,6 @@ mkTestCase = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
```
|
```
|
||||||
|
@ -95,7 +95,7 @@ mkTestCase = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ mkTestCase = do
|
|||||||
tree2 : Tree Nat
|
tree2 : Tree Nat
|
||||||
tree3 : Tree Text
|
tree3 : Tree Text
|
||||||
|
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
|
|
||||||
()
|
()
|
||||||
|
|
||||||
|
@ -16,6 +16,6 @@ mkTestCase = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
```
|
```
|
||||||
|
@ -33,7 +33,7 @@ mkTestCase = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ mkTestCase = do
|
|||||||
l3 : [Char]
|
l3 : [Char]
|
||||||
mkTestCase : '{IO, Exception} ()
|
mkTestCase : '{IO, Exception} ()
|
||||||
|
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
|
|
||||||
()
|
()
|
||||||
|
|
||||||
|
@ -30,6 +30,6 @@ mkTestCase = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
```
|
```
|
||||||
|
@ -49,7 +49,7 @@ mkTestCase = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ mkTestCase = do
|
|||||||
prod : [Nat] -> Nat
|
prod : [Nat] -> Nat
|
||||||
products : ([Nat], [Nat], [Nat]) -> Text
|
products : ([Nat], [Nat], [Nat]) -> Text
|
||||||
|
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
|
|
||||||
()
|
()
|
||||||
|
|
||||||
|
@ -44,6 +44,6 @@ mkTestCase = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
```
|
```
|
||||||
|
@ -68,7 +68,7 @@ mkTestCase = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ mkTestCase = do
|
|||||||
reset : '{DC r} r -> r
|
reset : '{DC r} r -> r
|
||||||
suspSum : [Nat] -> Delayed Nat
|
suspSum : [Nat] -> Delayed Nat
|
||||||
|
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
|
|
||||||
()
|
()
|
||||||
|
|
||||||
|
@ -14,6 +14,6 @@ mkTestCase = do
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
```
|
```
|
||||||
|
@ -28,7 +28,7 @@ mkTestCase = do
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ mkTestCase = do
|
|||||||
mutual0 : Nat -> Text
|
mutual0 : Nat -> Text
|
||||||
mutual1 : Nat -> Text
|
mutual1 : Nat -> Text
|
||||||
|
|
||||||
.> run mkTestCase
|
scratch/main> run mkTestCase
|
||||||
|
|
||||||
()
|
()
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ body k out v =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Test case.
|
Test case.
|
||||||
@ -67,6 +67,6 @@ tests = '(map spawn nats)
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test tests
|
scratch/main> io.test tests
|
||||||
```
|
```
|
||||||
|
@ -44,7 +44,7 @@ body k out v =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ tests = '(map spawn nats)
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -115,20 +115,20 @@ tests = '(map spawn nats)
|
|||||||
spawn : Nat ->{IO} Result
|
spawn : Nat ->{IO} Result
|
||||||
tests : '{IO} [Result]
|
tests : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test tests
|
scratch/main> io.test tests
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ tests verified
|
1. tests ◉ verified
|
||||||
2. ◉ tests verified
|
◉ verified
|
||||||
3. ◉ tests verified
|
◉ verified
|
||||||
4. ◉ tests verified
|
◉ verified
|
||||||
5. ◉ tests verified
|
◉ verified
|
||||||
6. ◉ tests verified
|
◉ verified
|
||||||
7. ◉ tests verified
|
◉ verified
|
||||||
8. ◉ tests verified
|
◉ verified
|
||||||
9. ◉ tests verified
|
◉ verified
|
||||||
10. ◉ tests verified
|
◉ verified
|
||||||
|
|
||||||
✅ 10 test(s) passing
|
✅ 10 test(s) passing
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ x = 999
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Now, we update that definition and define a test-watch which depends on it.
|
Now, we update that definition and define a test-watch which depends on it.
|
||||||
@ -22,7 +22,7 @@ test> mytest = checks [x + 1 == 1001]
|
|||||||
We expect this 'add' to fail because the test is blocked by the update to `x`.
|
We expect this 'add' to fail because the test is blocked by the update to `x`.
|
||||||
|
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
@ -35,5 +35,5 @@ test> useY = checks [y + 1 == 43]
|
|||||||
This should correctly identify `y` as a dependency and add that too.
|
This should correctly identify `y` as a dependency and add that too.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add useY
|
scratch/main> add useY
|
||||||
```
|
```
|
||||||
|
@ -43,7 +43,7 @@ test> mytest = checks [x + 1 == 1001]
|
|||||||
We expect this 'add' to fail because the test is blocked by the update to `x`.
|
We expect this 'add' to fail because the test is blocked by the update to `x`.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
x These definitions failed:
|
x These definitions failed:
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ test> useY = checks [y + 1 == 43]
|
|||||||
This should correctly identify `y` as a dependency and add that too.
|
This should correctly identify `y` as a dependency and add that too.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add useY
|
scratch/main> add useY
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ testBasicFork = 'let
|
|||||||
See if we can get another thread to stuff a value into a MVar
|
See if we can get another thread to stuff a value into a MVar
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testBasicFork
|
scratch/main> io.test testBasicFork
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -48,8 +48,8 @@ testBasicMultiThreadMVar = 'let
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testBasicMultiThreadMVar
|
scratch/main> io.test testBasicMultiThreadMVar
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -91,6 +91,6 @@ testTwoThreads = 'let
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testTwoThreads
|
scratch/main> io.test testTwoThreads
|
||||||
```
|
```
|
||||||
|
@ -71,18 +71,18 @@ testBasicMultiThreadMVar = 'let
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
testBasicMultiThreadMVar : '{IO} [Result]
|
testBasicMultiThreadMVar : '{IO} [Result]
|
||||||
thread1 : Nat -> MVar Nat -> '{IO} ()
|
thread1 : Nat -> MVar Nat -> '{IO} ()
|
||||||
|
|
||||||
.> io.test testBasicMultiThreadMVar
|
scratch/main> io.test testBasicMultiThreadMVar
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testBasicMultiThreadMVar other thread should have incremented
|
1. testBasicMultiThreadMVar ◉ other thread should have incremented
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ testTwoThreads = 'let
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -153,11 +153,11 @@ testTwoThreads = 'let
|
|||||||
(also named thread1)
|
(also named thread1)
|
||||||
testTwoThreads : '{IO} [Result]
|
testTwoThreads : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test testTwoThreads
|
scratch/main> io.test testTwoThreads
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testTwoThreads
|
1. testTwoThreads ◉
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ not_a_cert = "-----BEGIN SCHERMIFICATE-----\n-----END SCHERMIFICATE-----"
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
# Using an alternative certificate store
|
# Using an alternative certificate store
|
||||||
@ -32,8 +32,8 @@ what_should_work _ = this_should_work ++ this_should_not_work
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test what_should_work
|
scratch/main> io.test what_should_work
|
||||||
```
|
```
|
||||||
|
|
||||||
Test handshaking a client/server a local TCP connection using our
|
Test handshaking a client/server a local TCP connection using our
|
||||||
@ -191,8 +191,8 @@ testCNReject _ =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> io.test testConnectSelfSigned
|
scratch/main> io.test testConnectSelfSigned
|
||||||
.> io.test testCAReject
|
scratch/main> io.test testCAReject
|
||||||
.> io.test testCNReject
|
scratch/main> io.test testCNReject
|
||||||
```
|
```
|
||||||
|
@ -43,7 +43,7 @@ what_should_work _ = this_should_work ++ this_should_not_work
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -51,12 +51,12 @@ what_should_work _ = this_should_work ++ this_should_not_work
|
|||||||
this_should_work : [Result]
|
this_should_work : [Result]
|
||||||
what_should_work : ∀ _. _ -> [Result]
|
what_should_work : ∀ _. _ -> [Result]
|
||||||
|
|
||||||
.> io.test what_should_work
|
scratch/main> io.test what_should_work
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ what_should_work succesfully decoded self_signed_pem
|
1. what_should_work ◉ succesfully decoded self_signed_pem
|
||||||
2. ◉ what_should_work failed
|
◉ failed
|
||||||
|
|
||||||
✅ 2 test(s) passing
|
✅ 2 test(s) passing
|
||||||
|
|
||||||
@ -238,7 +238,7 @@ testCNReject _ =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -251,31 +251,31 @@ testCNReject _ =
|
|||||||
-> '{IO, Exception} Text
|
-> '{IO, Exception} Text
|
||||||
testConnectSelfSigned : '{IO} [Result]
|
testConnectSelfSigned : '{IO} [Result]
|
||||||
|
|
||||||
.> io.test testConnectSelfSigned
|
scratch/main> io.test testConnectSelfSigned
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testConnectSelfSigned should have reaped what we've sown
|
1. testConnectSelfSigned ◉ should have reaped what we've sown
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
Tip: Use view 1 to view the source of a test.
|
Tip: Use view 1 to view the source of a test.
|
||||||
|
|
||||||
.> io.test testCAReject
|
scratch/main> io.test testCAReject
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testCAReject correctly rejected self-signed cert
|
1. testCAReject ◉ correctly rejected self-signed cert
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
Tip: Use view 1 to view the source of a test.
|
Tip: Use view 1 to view the source of a test.
|
||||||
|
|
||||||
.> io.test testCNReject
|
scratch/main> io.test testCNReject
|
||||||
|
|
||||||
New test results:
|
New test results:
|
||||||
|
|
||||||
1. ◉ testCNReject correctly rejected self-signed cert
|
1. testCNReject ◉ correctly rejected self-signed cert
|
||||||
|
|
||||||
✅ 1 test(s) passing
|
✅ 1 test(s) passing
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ Test for new Text -> Bytes conversions explicitly using UTF-8 as the encoding
|
|||||||
Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text.
|
Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> find Utf8
|
scratch/main> find Utf8
|
||||||
```
|
```
|
||||||
|
|
||||||
ascii characters are encoded as single bytes (in the range 0-127).
|
ascii characters are encoded as single bytes (in the range 0-127).
|
||||||
|
@ -3,7 +3,7 @@ Test for new Text -> Bytes conversions explicitly using UTF-8 as the encoding
|
|||||||
Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text.
|
Unison has function for converting between `Text` and a UTF-8 `Bytes` encoding of the Text.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> find Utf8
|
scratch/main> find Utf8
|
||||||
|
|
||||||
1. builtin.Text.toUtf8 : Text -> Bytes
|
1. builtin.Text.toUtf8 : Text -> Bytes
|
||||||
2. Text.fromUtf8 : Bytes ->{Exception} Text
|
2. Text.fromUtf8 : Bytes ->{Exception} Text
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.merge
|
scratch/main> builtins.merge
|
||||||
```
|
```
|
||||||
|
|
||||||
Some random ability stuff to ensure things work.
|
Some random ability stuff to ensure things work.
|
||||||
@ -23,5 +23,5 @@ ha = cases
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
@ -32,7 +32,7 @@ ha = cases
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
|
@ -15,6 +15,6 @@ term2 _ = ()
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> names term1
|
scratch/main> names term1
|
||||||
```
|
```
|
||||||
|
@ -31,7 +31,7 @@ term2 _ = ()
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ term2 _ = ()
|
|||||||
term1 : '{Bar, Foo} ()
|
term1 : '{Bar, Foo} ()
|
||||||
term2 : '{Bar, Foo} ()
|
term2 : '{Bar, Foo} ()
|
||||||
|
|
||||||
.> names term1
|
scratch/main> names term1
|
||||||
|
|
||||||
Term
|
Term
|
||||||
Hash: #8hum58rlih
|
Hash: #8hum58rlih
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
## Basic usage
|
## Basic usage
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.merge
|
scratch/main> builtins.merge
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -20,26 +20,26 @@ is2even = '(even 2)
|
|||||||
it errors if there isn't a previous run
|
it errors if there isn't a previous run
|
||||||
|
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> add.run foo
|
scratch/main> add.run foo
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> run is2even
|
scratch/main> run is2even
|
||||||
```
|
```
|
||||||
|
|
||||||
it errors if the desired result name conflicts with a name in the
|
it errors if the desired result name conflicts with a name in the
|
||||||
unison file
|
unison file
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> add.run is2even
|
scratch/main> add.run is2even
|
||||||
```
|
```
|
||||||
|
|
||||||
otherwise, the result is successfully persisted
|
otherwise, the result is successfully persisted
|
||||||
```ucm
|
```ucm
|
||||||
.> add.run foo.bar.baz
|
scratch/main> add.run foo.bar.baz
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> view foo.bar.baz
|
scratch/main> view foo.bar.baz
|
||||||
```
|
```
|
||||||
|
|
||||||
## It resolves references within the unison file
|
## It resolves references within the unison file
|
||||||
@ -56,8 +56,8 @@ main _ = y
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> run main
|
scratch/main> run main
|
||||||
.> add.run result
|
scratch/main> add.run result
|
||||||
```
|
```
|
||||||
|
|
||||||
## It resolves references within the codebase
|
## It resolves references within the codebase
|
||||||
@ -68,7 +68,7 @@ inc x = x + 1
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add inc
|
scratch/main> add inc
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -77,9 +77,9 @@ main _ x = inc x
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> run main
|
scratch/main> run main
|
||||||
.> add.run natfoo
|
scratch/main> add.run natfoo
|
||||||
.> view natfoo
|
scratch/main> view natfoo
|
||||||
```
|
```
|
||||||
|
|
||||||
## It captures scratch file dependencies at run time
|
## It captures scratch file dependencies at run time
|
||||||
@ -91,7 +91,7 @@ main = 'y
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> run main
|
scratch/main> run main
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -101,8 +101,8 @@ x = 50
|
|||||||
|
|
||||||
this saves 2 to xres, rather than 100
|
this saves 2 to xres, rather than 100
|
||||||
```ucm
|
```ucm
|
||||||
.> add.run xres
|
scratch/main> add.run xres
|
||||||
.> view xres
|
scratch/main> view xres
|
||||||
```
|
```
|
||||||
|
|
||||||
## It fails with a message if add cannot complete cleanly
|
## It fails with a message if add cannot complete cleanly
|
||||||
@ -112,8 +112,8 @@ main = '5
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> run main
|
scratch/main> run main
|
||||||
.> add.run xres
|
scratch/main> add.run xres
|
||||||
```
|
```
|
||||||
|
|
||||||
## It works with absolute names
|
## It works with absolute names
|
||||||
|
@ -31,7 +31,7 @@ is2even = '(even 2)
|
|||||||
it errors if there isn't a previous run
|
it errors if there isn't a previous run
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add.run foo
|
scratch/main> add.run foo
|
||||||
|
|
||||||
⚠️
|
⚠️
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ it errors if there isn't a previous run
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> run is2even
|
scratch/main> run is2even
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ it errors if there isn't a previous run
|
|||||||
it errors if the desired result name conflicts with a name in the
|
it errors if the desired result name conflicts with a name in the
|
||||||
unison file
|
unison file
|
||||||
```ucm
|
```ucm
|
||||||
.> add.run is2even
|
scratch/main> add.run is2even
|
||||||
|
|
||||||
⚠️
|
⚠️
|
||||||
|
|
||||||
@ -58,7 +58,7 @@ unison file
|
|||||||
```
|
```
|
||||||
otherwise, the result is successfully persisted
|
otherwise, the result is successfully persisted
|
||||||
```ucm
|
```ucm
|
||||||
.> add.run foo.bar.baz
|
scratch/main> add.run foo.bar.baz
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ otherwise, the result is successfully persisted
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> view foo.bar.baz
|
scratch/main> view foo.bar.baz
|
||||||
|
|
||||||
foo.bar.baz : Boolean
|
foo.bar.baz : Boolean
|
||||||
foo.bar.baz = true
|
foo.bar.baz = true
|
||||||
@ -101,11 +101,11 @@ main _ = y
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> run main
|
scratch/main> run main
|
||||||
|
|
||||||
a b -> a Nat.+ b Nat.+ z 10
|
a b -> a Nat.+ b Nat.+ z 10
|
||||||
|
|
||||||
.> add.run result
|
scratch/main> add.run result
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ inc x = x + 1
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add inc
|
scratch/main> add inc
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -160,17 +160,17 @@ main _ x = inc x
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> run main
|
scratch/main> run main
|
||||||
|
|
||||||
inc
|
inc
|
||||||
|
|
||||||
.> add.run natfoo
|
scratch/main> add.run natfoo
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
natfoo : Nat -> Nat
|
natfoo : Nat -> Nat
|
||||||
|
|
||||||
.> view natfoo
|
scratch/main> view natfoo
|
||||||
|
|
||||||
natfoo : Nat -> Nat
|
natfoo : Nat -> Nat
|
||||||
natfoo = inc
|
natfoo = inc
|
||||||
@ -200,7 +200,7 @@ main = 'y
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> run main
|
scratch/main> run main
|
||||||
|
|
||||||
2
|
2
|
||||||
|
|
||||||
@ -224,13 +224,13 @@ x = 50
|
|||||||
```
|
```
|
||||||
this saves 2 to xres, rather than 100
|
this saves 2 to xres, rather than 100
|
||||||
```ucm
|
```ucm
|
||||||
.> add.run xres
|
scratch/main> add.run xres
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
xres : Nat
|
xres : Nat
|
||||||
|
|
||||||
.> view xres
|
scratch/main> view xres
|
||||||
|
|
||||||
xres : Nat
|
xres : Nat
|
||||||
xres = 2
|
xres = 2
|
||||||
@ -256,11 +256,11 @@ main = '5
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> run main
|
scratch/main> run main
|
||||||
|
|
||||||
5
|
5
|
||||||
|
|
||||||
.> add.run xres
|
scratch/main> add.run xres
|
||||||
|
|
||||||
x These definitions failed:
|
x These definitions failed:
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison:hide
|
```unison:hide
|
||||||
@ -10,6 +10,6 @@ foo = []
|
|||||||
Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though!
|
Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though!
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
.> view foo
|
scratch/main> view foo
|
||||||
```
|
```
|
||||||
|
@ -6,13 +6,13 @@ foo = []
|
|||||||
Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though!
|
Apparently when we add a test watch, we add a type annotation to it, even if it already has one. We don't want this to happen though!
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
foo : [Result]
|
foo : [Result]
|
||||||
|
|
||||||
.> view foo
|
scratch/main> view foo
|
||||||
|
|
||||||
foo : [Result]
|
foo : [Result]
|
||||||
foo : [Result]
|
foo : [Result]
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Let's set up some definitions to start:
|
Let's set up some definitions to start:
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.merge
|
scratch/main> builtins.merge
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -17,7 +17,7 @@ structural type Y = Two Nat Nat
|
|||||||
Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this.
|
Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Let's add an alias for `1` and `One`:
|
Let's add an alias for `1` and `One`:
|
||||||
@ -32,7 +32,7 @@ Expected: `z` is now `1`. UCM tells you that this definition is also called `x`.
|
|||||||
Also, `Z` is an alias for `X`.
|
Also, `Z` is an alias for `X`.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Let's update something that has an alias (to a value that doesn't have a name already):
|
Let's update something that has an alias (to a value that doesn't have a name already):
|
||||||
@ -45,7 +45,7 @@ structural type X = Three Nat Nat Nat
|
|||||||
Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated.
|
Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> update
|
scratch/main> update
|
||||||
```
|
```
|
||||||
|
|
||||||
Update it to something that already exists with a different name:
|
Update it to something that already exists with a different name:
|
||||||
@ -58,6 +58,6 @@ structural type X = Two Nat Nat
|
|||||||
Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`.
|
Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> update
|
scratch/main> update
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ structural type Y = Two Nat Nat
|
|||||||
Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this.
|
Expected: `x` and `y`, `X`, and `Y` exist as above. UCM tells you this.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ Expected: `z` is now `1`. UCM tells you that this definition is also called `x`.
|
|||||||
Also, `Z` is an alias for `X`.
|
Also, `Z` is an alias for `X`.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ structural type X = Three Nat Nat Nat
|
|||||||
Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated.
|
Expected: `x` is now `3` and `X` has constructor `Three`. UCM tells you the old definitions were also called `z` and `Z` and these names have also been updated.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> update
|
scratch/main> update
|
||||||
|
|
||||||
Okay, I'm searching the branch for code that needs to be
|
Okay, I'm searching the branch for code that needs to be
|
||||||
updated...
|
updated...
|
||||||
@ -143,7 +143,7 @@ structural type X = Two Nat Nat
|
|||||||
Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`.
|
Expected: `x` is now `2` and `X` is `Two`. UCM says the old definition was also named `z/Z`, and was also updated. And it says the new definition is also named `y/Y`.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> update
|
scratch/main> update
|
||||||
|
|
||||||
Okay, I'm searching the branch for code that needs to be
|
Okay, I'm searching the branch for code that needs to be
|
||||||
updated...
|
updated...
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.merge
|
scratch/main> builtins.merge lib.builtins
|
||||||
```
|
```
|
||||||
```unison:hide:all
|
```unison:hide:all
|
||||||
List.adjacentPairs : [a] -> [(a, a)]
|
List.adjacentPairs : [a] -> [(a, a)]
|
||||||
@ -95,14 +95,14 @@ List.takeWhile p xs =
|
|||||||
go xs []
|
go xs []
|
||||||
```
|
```
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.stuff> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
The `alias.many` command can be used to copy definitions from the current namespace into your curated one.
|
The `alias.many` command can be used to copy definitions from the current namespace into your curated one.
|
||||||
The names that will be used in the target namespace are the names you specify, relative to the current namespace:
|
The names that will be used in the target namespace are the names you specify, relative to the current namespace:
|
||||||
|
|
||||||
```
|
```
|
||||||
.> help alias.many
|
scratch/main> help alias.many
|
||||||
|
|
||||||
alias.many (or copy)
|
alias.many (or copy)
|
||||||
`alias.many <relative1> [relative2...] <namespace>` creates aliases `relative1`, `relative2`, ...
|
`alias.many <relative1> [relative2...] <namespace>` creates aliases `relative1`, `relative2`, ...
|
||||||
@ -113,8 +113,8 @@ The names that will be used in the target namespace are the names you specify, r
|
|||||||
Let's try it!
|
Let's try it!
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib
|
scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.chunksOf List.dropWhile List.first List.init List.intersperse List.isEmpty List.last List.replicate List.splitAt List.tail List.takeWhile mylib
|
||||||
.> find-in mylib
|
scratch/main> find-in mylib
|
||||||
```
|
```
|
||||||
|
|
||||||
Thanks, `alias.many`!
|
Thanks, `alias.many`!
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
The `alias.many` command can be used to copy definitions from the current namespace into your curated one.
|
The `alias.many` command can be used to copy definitions from the current namespace into your curated one.
|
||||||
The names that will be used in the target namespace are the names you specify, relative to the current namespace:
|
The names that will be used in the target namespace are the names you specify, relative to the current namespace:
|
||||||
|
|
||||||
```
|
```scratch
|
||||||
.> help alias.many
|
/main> help alias.many
|
||||||
|
|
||||||
alias.many (or copy)
|
alias.many (or copy)
|
||||||
`alias.many <relative1> [relative2...] <namespace>` creates aliases `relative1`, `relative2`, ...
|
`alias.many <relative1> [relative2...] <namespace>` creates aliases `relative1`, `relative2`, ...
|
||||||
@ -14,55 +14,51 @@ The names that will be used in the target namespace are the names you specify, r
|
|||||||
Let's try it!
|
Let's try it!
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> alias.many stuff.List.adjacentPairs stuff.List.all stuff.List.any stuff.List.chunk stuff.List.chunksOf stuff.List.dropWhile stuff.List.first stuff.List.init stuff.List.intersperse stuff.List.isEmpty stuff.List.last stuff.List.replicate stuff.List.splitAt stuff.List.tail stuff.List.takeWhile .mylib
|
scratch/main> alias.many List.adjacentPairs List.all List.any List.chunk List.chunksOf List.dropWhile List.first List.init List.intersperse List.isEmpty List.last List.replicate List.splitAt List.tail List.takeWhile mylib
|
||||||
|
|
||||||
Here's what changed in .mylib :
|
Here's what changed in mylib :
|
||||||
|
|
||||||
Added definitions:
|
Added definitions:
|
||||||
|
|
||||||
1. stuff.List.adjacentPairs : [a] -> [(a, a)]
|
1. List.adjacentPairs : [a] -> [(a, a)]
|
||||||
2. stuff.List.all : (a ->{g} Boolean)
|
2. List.all : (a ->{g} Boolean)
|
||||||
-> [a]
|
-> [a]
|
||||||
->{g} Boolean
|
->{g} Boolean
|
||||||
3. stuff.List.any : (a ->{g} Boolean)
|
3. List.any : (a ->{g} Boolean)
|
||||||
-> [a]
|
-> [a]
|
||||||
->{g} Boolean
|
->{g} Boolean
|
||||||
4. stuff.List.chunk : Nat -> [a] -> [[a]]
|
4. List.chunk : Nat -> [a] -> [[a]]
|
||||||
5. stuff.List.chunksOf : Nat -> [a] -> [[a]]
|
5. List.chunksOf : Nat -> [a] -> [[a]]
|
||||||
6. stuff.List.dropWhile : (a ->{g} Boolean)
|
6. List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a]
|
||||||
-> [a]
|
7. List.first : [a] -> Optional a
|
||||||
->{g} [a]
|
8. List.init : [a] -> Optional [a]
|
||||||
7. stuff.List.first : [a] -> Optional a
|
9. List.intersperse : a -> [a] -> [a]
|
||||||
8. stuff.List.init : [a] -> Optional [a]
|
10. List.isEmpty : [a] -> Boolean
|
||||||
9. stuff.List.intersperse : a -> [a] -> [a]
|
11. List.last : [a] -> Optional a
|
||||||
10. stuff.List.isEmpty : [a] -> Boolean
|
12. List.replicate : Nat -> a -> [a]
|
||||||
11. stuff.List.last : [a] -> Optional a
|
13. List.splitAt : Nat -> [a] -> ([a], [a])
|
||||||
12. stuff.List.replicate : Nat -> a -> [a]
|
14. List.tail : [a] -> Optional [a]
|
||||||
13. stuff.List.splitAt : Nat -> [a] -> ([a], [a])
|
15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a]
|
||||||
14. stuff.List.tail : [a] -> Optional [a]
|
|
||||||
15. stuff.List.takeWhile : (a ->{𝕖} Boolean)
|
|
||||||
-> [a]
|
|
||||||
->{𝕖} [a]
|
|
||||||
|
|
||||||
Tip: You can use `undo` or `reflog` to undo this change.
|
Tip: You can use `undo` or `reflog` to undo this change.
|
||||||
|
|
||||||
.> find-in mylib
|
scratch/main> find-in mylib
|
||||||
|
|
||||||
1. stuff.List.adjacentPairs : [a] -> [(a, a)]
|
1. List.adjacentPairs : [a] -> [(a, a)]
|
||||||
2. stuff.List.all : (a ->{g} Boolean) -> [a] ->{g} Boolean
|
2. List.all : (a ->{g} Boolean) -> [a] ->{g} Boolean
|
||||||
3. stuff.List.any : (a ->{g} Boolean) -> [a] ->{g} Boolean
|
3. List.any : (a ->{g} Boolean) -> [a] ->{g} Boolean
|
||||||
4. stuff.List.chunk : Nat -> [a] -> [[a]]
|
4. List.chunk : Nat -> [a] -> [[a]]
|
||||||
5. stuff.List.chunksOf : Nat -> [a] -> [[a]]
|
5. List.chunksOf : Nat -> [a] -> [[a]]
|
||||||
6. stuff.List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a]
|
6. List.dropWhile : (a ->{g} Boolean) -> [a] ->{g} [a]
|
||||||
7. stuff.List.first : [a] -> Optional a
|
7. List.first : [a] -> Optional a
|
||||||
8. stuff.List.init : [a] -> Optional [a]
|
8. List.init : [a] -> Optional [a]
|
||||||
9. stuff.List.intersperse : a -> [a] -> [a]
|
9. List.intersperse : a -> [a] -> [a]
|
||||||
10. stuff.List.isEmpty : [a] -> Boolean
|
10. List.isEmpty : [a] -> Boolean
|
||||||
11. stuff.List.last : [a] -> Optional a
|
11. List.last : [a] -> Optional a
|
||||||
12. stuff.List.replicate : Nat -> a -> [a]
|
12. List.replicate : Nat -> a -> [a]
|
||||||
13. stuff.List.splitAt : Nat -> [a] -> ([a], [a])
|
13. List.splitAt : Nat -> [a] -> ([a], [a])
|
||||||
14. stuff.List.tail : [a] -> Optional [a]
|
14. List.tail : [a] -> Optional [a]
|
||||||
15. stuff.List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a]
|
15. List.takeWhile : (a ->{𝕖} Boolean) -> [a] ->{𝕖} [a]
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
28
unison-src/transcripts/alias-type.md
Normal file
28
unison-src/transcripts/alias-type.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
`alias.type` makes a new name for a type.
|
||||||
|
|
||||||
|
```ucm:hide
|
||||||
|
project/main> builtins.mergeio lib.builtins
|
||||||
|
```
|
||||||
|
|
||||||
|
```ucm
|
||||||
|
project/main> alias.type lib.builtins.Nat Foo
|
||||||
|
project/main> ls
|
||||||
|
```
|
||||||
|
|
||||||
|
It won't create a conflicted name, though.
|
||||||
|
|
||||||
|
```ucm:error
|
||||||
|
project/main> alias.type lib.builtins.Int Foo
|
||||||
|
```
|
||||||
|
|
||||||
|
```ucm
|
||||||
|
project/main> ls
|
||||||
|
```
|
||||||
|
|
||||||
|
You can use `debug.alias.type.force` for that.
|
||||||
|
|
||||||
|
```ucm
|
||||||
|
project/main> debug.alias.type.force lib.builtins.Int Foo
|
||||||
|
project/main> ls
|
||||||
|
```
|
||||||
|
|
44
unison-src/transcripts/alias-type.output.md
Normal file
44
unison-src/transcripts/alias-type.output.md
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
`alias.type` makes a new name for a type.
|
||||||
|
|
||||||
|
```ucm
|
||||||
|
project/main> alias.type lib.builtins.Nat Foo
|
||||||
|
|
||||||
|
Done.
|
||||||
|
|
||||||
|
project/main> ls
|
||||||
|
|
||||||
|
1. Foo (builtin type)
|
||||||
|
2. lib/ (643 terms, 92 types)
|
||||||
|
|
||||||
|
```
|
||||||
|
It won't create a conflicted name, though.
|
||||||
|
|
||||||
|
```ucm
|
||||||
|
project/main> alias.type lib.builtins.Int Foo
|
||||||
|
|
||||||
|
⚠️
|
||||||
|
|
||||||
|
A type by that name already exists.
|
||||||
|
|
||||||
|
```
|
||||||
|
```ucm
|
||||||
|
project/main> ls
|
||||||
|
|
||||||
|
1. Foo (builtin type)
|
||||||
|
2. lib/ (643 terms, 92 types)
|
||||||
|
|
||||||
|
```
|
||||||
|
You can use `debug.alias.type.force` for that.
|
||||||
|
|
||||||
|
```ucm
|
||||||
|
project/main> debug.alias.type.force lib.builtins.Int Foo
|
||||||
|
|
||||||
|
Done.
|
||||||
|
|
||||||
|
project/main> ls
|
||||||
|
|
||||||
|
1. Foo (builtin type)
|
||||||
|
2. Foo (builtin type)
|
||||||
|
3. lib/ (643 terms, 92 types)
|
||||||
|
|
||||||
|
```
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.merge
|
scratch/main> builtins.merge
|
||||||
```
|
```
|
||||||
|
|
||||||
This tests a variable related bug in the ANF compiler.
|
This tests a variable related bug in the ANF compiler.
|
||||||
@ -29,6 +29,6 @@ foo _ =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ foo _ =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# Unit tests for Any.unsafeExtract
|
# Unit tests for Any.unsafeExtract
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
.> load unison-src/transcripts-using-base/base.u
|
scratch/main> load unison-src/transcripts-using-base/base.u
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Any.unsafeExtract is a way to extract the value contained in an Any. This is unsafe because it allows the programmer to coerce a value into any type, which would cause undefined behaviour if used to coerce a value to the wrong type.
|
Any.unsafeExtract is a way to extract the value contained in an Any. This is unsafe because it allows the programmer to coerce a value into any type, which would cause undefined behaviour if used to coerce a value to the wrong type.
|
||||||
@ -19,5 +19,5 @@ test> Any.unsafeExtract.works =
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
@ -32,7 +32,7 @@ test> Any.unsafeExtract.works =
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Doc rendering
|
# Doc rendering
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison:hide
|
```unison:hide
|
||||||
@ -82,13 +82,13 @@ term = 42
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> display term.doc
|
scratch/main> display term.doc
|
||||||
```
|
```
|
||||||
|
|
||||||
```api
|
```api
|
||||||
GET /api/non-project-code/getDefinition?names=term
|
GET /api/projects/scratch/branches/main/getDefinition?names=term
|
||||||
```
|
```
|
||||||
|
@ -78,7 +78,7 @@ term = 42
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> display term.doc
|
scratch/main> display term.doc
|
||||||
|
|
||||||
# Heading
|
# Heading
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ term = 42
|
|||||||
|
|
||||||
```
|
```
|
||||||
```api
|
```api
|
||||||
GET /api/non-project-code/getDefinition?names=term
|
GET /api/projects/scratch/branches/main/getDefinition?names=term
|
||||||
{
|
{
|
||||||
"missingDefinitions": [],
|
"missingDefinitions": [],
|
||||||
"termDefinitions": {
|
"termDefinitions": {
|
||||||
|
@ -8,19 +8,19 @@ joey.yaml.zz = 45
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```api
|
```api
|
||||||
-- Namespace segment prefix search
|
-- Namespace segment prefix search
|
||||||
GET /api/non-project-code/find?query=http
|
GET /api/projects/scratch/branches/main/find?query=http
|
||||||
|
|
||||||
-- Namespace segment suffix search
|
-- Namespace segment suffix search
|
||||||
GET /api/non-project-code/find?query=Server
|
GET /api/projects/scratch/branches/main/find?query=Server
|
||||||
|
|
||||||
-- Substring search
|
-- Substring search
|
||||||
GET /api/non-project-code/find?query=lesys
|
GET /api/projects/scratch/branches/main/find?query=lesys
|
||||||
|
|
||||||
-- Cross-segment search
|
-- Cross-segment search
|
||||||
GET /api/non-project-code/find?query=joey.http
|
GET /api/projects/scratch/branches/main/find?query=joey.http
|
||||||
```
|
```
|
||||||
|
@ -24,7 +24,7 @@ joey.yaml.zz = 45
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ joey.yaml.zz = 45
|
|||||||
```
|
```
|
||||||
```api
|
```api
|
||||||
-- Namespace segment prefix search
|
-- Namespace segment prefix search
|
||||||
GET /api/non-project-code/find?query=http
|
GET /api/projects/scratch/branches/main/find?query=http
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -122,7 +122,7 @@ GET /api/non-project-code/find?query=http
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
-- Namespace segment suffix search
|
-- Namespace segment suffix search
|
||||||
GET /api/non-project-code/find?query=Server
|
GET /api/projects/scratch/branches/main/find?query=Server
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -167,7 +167,7 @@ GET /api/non-project-code/find?query=Server
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
-- Substring search
|
-- Substring search
|
||||||
GET /api/non-project-code/find?query=lesys
|
GET /api/projects/scratch/branches/main/find?query=lesys
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@ -212,7 +212,7 @@ GET /api/non-project-code/find?query=lesys
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
-- Cross-segment search
|
-- Cross-segment search
|
||||||
GET /api/non-project-code/find?query=joey.http
|
GET /api/projects/scratch/branches/main/find?query=joey.http
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
@ -1,54 +1,50 @@
|
|||||||
# Get Definitions Test
|
# Get Definitions Test
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.nested> builtins.mergeio
|
scratch/main> builtins.mergeio lib.builtins
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison:hide
|
```unison:hide
|
||||||
{{ Documentation }}
|
nested.names.x.doc = {{ Documentation }}
|
||||||
names.x = 42
|
nested.names.x = 42
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.nested> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```api
|
```api
|
||||||
-- Should NOT find names by suffix
|
-- Should NOT find names by suffix
|
||||||
GET /api/non-project-code/getDefinition?names=x
|
GET /api/projects/scratch/branches/main/getDefinition?names=x
|
||||||
|
|
||||||
-- Term names should strip relativeTo prefix.
|
-- Term names should strip relativeTo prefix.
|
||||||
GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested
|
GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested
|
||||||
|
|
||||||
-- Should find definitions by hash, names should be relative
|
-- Should find definitions by hash, names should be relative
|
||||||
GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested
|
GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested
|
||||||
```
|
|
||||||
|
|
||||||
```ucm:hide
|
|
||||||
.doctest> builtins.mergeio
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison:hide
|
```unison:hide
|
||||||
thing.doc = {{ The correct docs for the thing }}
|
doctest.thing.doc = {{ The correct docs for the thing }}
|
||||||
thing = "A thing"
|
doctest.thing = "A thing"
|
||||||
thingalias.doc = {{ Docs for the alias, should not be displayed }}
|
doctest.thingalias.doc = {{ Docs for the alias, should not be displayed }}
|
||||||
thingalias = "A thing"
|
doctest.thingalias = "A thing"
|
||||||
otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }}
|
doctest.otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }}
|
||||||
otherstuff.thing = "A different thing"
|
doctest.otherstuff.thing = "A different thing"
|
||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.doctest> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Only docs for the term we request should be returned, even if there are other term docs with the same suffix.
|
Only docs for the term we request should be returned, even if there are other term docs with the same suffix.
|
||||||
|
|
||||||
```api
|
```api
|
||||||
GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest
|
GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest
|
||||||
```
|
```
|
||||||
|
|
||||||
If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list.
|
If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list.
|
||||||
|
|
||||||
```api
|
```api
|
||||||
GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest
|
GET /api/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest
|
||||||
```
|
```
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
# Get Definitions Test
|
# Get Definitions Test
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
{{ Documentation }}
|
nested.names.x.doc = {{ Documentation }}
|
||||||
names.x = 42
|
nested.names.x = 42
|
||||||
```
|
```
|
||||||
|
|
||||||
```api
|
```api
|
||||||
-- Should NOT find names by suffix
|
-- Should NOT find names by suffix
|
||||||
GET /api/non-project-code/getDefinition?names=x
|
GET /api/projects/scratch/branches/main/getDefinition?names=x
|
||||||
{
|
{
|
||||||
"missingDefinitions": [
|
"missingDefinitions": [
|
||||||
"x"
|
"x"
|
||||||
@ -16,7 +16,7 @@ GET /api/non-project-code/getDefinition?names=x
|
|||||||
"typeDefinitions": {}
|
"typeDefinitions": {}
|
||||||
}
|
}
|
||||||
-- Term names should strip relativeTo prefix.
|
-- Term names should strip relativeTo prefix.
|
||||||
GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested
|
GET /api/projects/scratch/branches/main/getDefinition?names=names.x&relativeTo=nested
|
||||||
{
|
{
|
||||||
"missingDefinitions": [],
|
"missingDefinitions": [],
|
||||||
"termDefinitions": {
|
"termDefinitions": {
|
||||||
@ -104,14 +104,14 @@ GET /api/non-project-code/getDefinition?names=names.x&relativeTo=nested
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"termNames": [
|
"termNames": [
|
||||||
"names.x"
|
"nested.names.x"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typeDefinitions": {}
|
"typeDefinitions": {}
|
||||||
}
|
}
|
||||||
-- Should find definitions by hash, names should be relative
|
-- Should find definitions by hash, names should be relative
|
||||||
GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested
|
GET /api/projects/scratch/branches/main/getDefinition?names=%23qkhkl0n238&relativeTo=nested
|
||||||
{
|
{
|
||||||
"missingDefinitions": [],
|
"missingDefinitions": [],
|
||||||
"termDefinitions": {
|
"termDefinitions": {
|
||||||
@ -199,30 +199,30 @@ GET /api/non-project-code/getDefinition?names=%23qkhkl0n238&relativeTo=nested
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"termNames": [
|
"termNames": [
|
||||||
"names.x"
|
"nested.names.x"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typeDefinitions": {}
|
"typeDefinitions": {}
|
||||||
}
|
}
|
||||||
``````unison
|
``````unison
|
||||||
thing.doc = {{ The correct docs for the thing }}
|
doctest.thing.doc = {{ The correct docs for the thing }}
|
||||||
thing = "A thing"
|
doctest.thing = "A thing"
|
||||||
thingalias.doc = {{ Docs for the alias, should not be displayed }}
|
doctest.thingalias.doc = {{ Docs for the alias, should not be displayed }}
|
||||||
thingalias = "A thing"
|
doctest.thingalias = "A thing"
|
||||||
otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }}
|
doctest.otherstuff.thing.doc = {{ A doc for a different term with the same name, should not be displayed }}
|
||||||
otherstuff.thing = "A different thing"
|
doctest.otherstuff.thing = "A different thing"
|
||||||
```
|
```
|
||||||
|
|
||||||
Only docs for the term we request should be returned, even if there are other term docs with the same suffix.
|
Only docs for the term we request should be returned, even if there are other term docs with the same suffix.
|
||||||
|
|
||||||
```api
|
```api
|
||||||
GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest
|
GET /api/projects/scratch/branches/main/getDefinition?names=thing&relativeTo=doctest
|
||||||
{
|
{
|
||||||
"missingDefinitions": [],
|
"missingDefinitions": [],
|
||||||
"termDefinitions": {
|
"termDefinitions": {
|
||||||
"#jksc1s5kud95ro5ivngossullt2oavsd41s3u48bch67jf3gknru5j6hmjslonkd5sdqs8mr8k4rrnef8fodngbg4sm7u6au564ekjg": {
|
"#jksc1s5kud95ro5ivngossullt2oavsd41s3u48bch67jf3gknru5j6hmjslonkd5sdqs8mr8k4rrnef8fodngbg4sm7u6au564ekjg": {
|
||||||
"bestTermName": "thing",
|
"bestTermName": "doctest.thing",
|
||||||
"defnTermTag": "Plain",
|
"defnTermTag": "Plain",
|
||||||
"signature": [
|
"signature": [
|
||||||
{
|
{
|
||||||
@ -237,10 +237,10 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest
|
|||||||
"contents": [
|
"contents": [
|
||||||
{
|
{
|
||||||
"annotation": {
|
"annotation": {
|
||||||
"contents": "thing",
|
"contents": "doctest.thing",
|
||||||
"tag": "HashQualifier"
|
"tag": "HashQualifier"
|
||||||
},
|
},
|
||||||
"segment": "thing"
|
"segment": "doctest.thing"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"annotation": {
|
"annotation": {
|
||||||
@ -265,10 +265,10 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"annotation": {
|
"annotation": {
|
||||||
"contents": "thing",
|
"contents": "doctest.thing",
|
||||||
"tag": "HashQualifier"
|
"tag": "HashQualifier"
|
||||||
},
|
},
|
||||||
"segment": "thing"
|
"segment": "doctest.thing"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"annotation": {
|
"annotation": {
|
||||||
@ -291,7 +291,7 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest
|
|||||||
},
|
},
|
||||||
"termDocs": [
|
"termDocs": [
|
||||||
[
|
[
|
||||||
"thing.doc",
|
"doctest.thing.doc",
|
||||||
"#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o",
|
"#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o",
|
||||||
{
|
{
|
||||||
"contents": [
|
"contents": [
|
||||||
@ -325,8 +325,8 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"termNames": [
|
"termNames": [
|
||||||
"thing",
|
"doctest.thing",
|
||||||
"thingalias"
|
"doctest.thingalias"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -335,12 +335,12 @@ GET /api/non-project-code/getDefinition?names=thing&relativeTo=doctest
|
|||||||
```If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list.
|
```If we request a doc, the api should return the source, but also the rendered doc should appear in the 'termDocs' list.
|
||||||
|
|
||||||
```api
|
```api
|
||||||
GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest
|
GET /api/projects/scratch/branches/main/getDefinition?names=thing.doc&relativeTo=doctest
|
||||||
{
|
{
|
||||||
"missingDefinitions": [],
|
"missingDefinitions": [],
|
||||||
"termDefinitions": {
|
"termDefinitions": {
|
||||||
"#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o": {
|
"#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o": {
|
||||||
"bestTermName": "thing.doc",
|
"bestTermName": "doctest.thing.doc",
|
||||||
"defnTermTag": "Doc",
|
"defnTermTag": "Doc",
|
||||||
"signature": [
|
"signature": [
|
||||||
{
|
{
|
||||||
@ -355,10 +355,10 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest
|
|||||||
"contents": [
|
"contents": [
|
||||||
{
|
{
|
||||||
"annotation": {
|
"annotation": {
|
||||||
"contents": "thing.doc",
|
"contents": "doctest.thing.doc",
|
||||||
"tag": "HashQualifier"
|
"tag": "HashQualifier"
|
||||||
},
|
},
|
||||||
"segment": "thing.doc"
|
"segment": "doctest.thing.doc"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"annotation": {
|
"annotation": {
|
||||||
@ -383,10 +383,10 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"annotation": {
|
"annotation": {
|
||||||
"contents": "thing.doc",
|
"contents": "doctest.thing.doc",
|
||||||
"tag": "HashQualifier"
|
"tag": "HashQualifier"
|
||||||
},
|
},
|
||||||
"segment": "thing.doc"
|
"segment": "doctest.thing.doc"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"annotation": {
|
"annotation": {
|
||||||
@ -467,7 +467,7 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest
|
|||||||
},
|
},
|
||||||
"termDocs": [
|
"termDocs": [
|
||||||
[
|
[
|
||||||
"thing.doc",
|
"doctest.thing.doc",
|
||||||
"#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o",
|
"#t9qfdoiuskj4n9go8cftj1r83s43s3o7sppafm5vr0bq5feieb7ap0cie5ed2qsf9g3ig448vffhnajinq81pnnkila1jp2epa7f26o",
|
||||||
{
|
{
|
||||||
"contents": [
|
"contents": [
|
||||||
@ -501,7 +501,7 @@ GET /api/non-project-code/getDefinition?names=thing.doc&relativeTo=doctest
|
|||||||
]
|
]
|
||||||
],
|
],
|
||||||
"termNames": [
|
"termNames": [
|
||||||
"thing.doc"
|
"doctest.thing.doc"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# List Projects And Branches Test
|
# List Projects And Branches Test
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> project.create-empty project-one
|
scratch/main> project.create-empty project-one
|
||||||
.> project.create-empty project-two
|
scratch/main> project.create-empty project-two
|
||||||
.> project.create-empty project-three
|
scratch/main> project.create-empty project-three
|
||||||
project-one/main> branch branch-one
|
project-one/main> branch branch-one
|
||||||
project-one/main> branch branch-two
|
project-one/main> branch branch-two
|
||||||
project-one/main> branch branch-three
|
project-one/main> branch branch-three
|
||||||
|
@ -12,6 +12,9 @@ GET /api/projects
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"projectName": "project-two"
|
"projectName": "project-two"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"projectName": "scratch"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
-- Should list projects starting with project-t
|
-- Should list projects starting with project-t
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Namespace Details Test
|
# Namespace Details Test
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -14,10 +14,10 @@ Here's a *README*!
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```api
|
```api
|
||||||
-- Should find names by suffix
|
-- Should find names by suffix
|
||||||
GET /api/non-project-code/namespaces/nested.names
|
GET /api/projects/scratch/branches/main/namespaces/nested.names
|
||||||
```
|
```
|
||||||
|
@ -25,7 +25,7 @@ Here's a *README*!
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ Here's a *README*!
|
|||||||
```
|
```
|
||||||
```api
|
```api
|
||||||
-- Should find names by suffix
|
-- Should find names by suffix
|
||||||
GET /api/non-project-code/namespaces/nested.names
|
GET /api/projects/scratch/branches/main/namespaces/nested.names
|
||||||
{
|
{
|
||||||
"fqn": "nested.names",
|
"fqn": "nested.names",
|
||||||
"hash": "#6tnmlu9knsce0u2991u6fvcmf4v44fdf0aiqtmnq7mjj0gi5sephg3lf12iv3odr5rc7vlgq75ciborrd3625c701bdmdomia2gcm3o",
|
"hash": "#6tnmlu9knsce0u2991u6fvcmf4v44fdf0aiqtmnq7mjj0gi5sephg3lf12iv3odr5rc7vlgq75ciborrd3625c701bdmdomia2gcm3o",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Namespace list api
|
# Namespace list api
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -12,11 +12,11 @@ nested.names.readme = {{ I'm a readme! }}
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
```api
|
```api
|
||||||
GET /api/non-project-code/list?namespace=nested.names
|
GET /api/projects/scratch/branches/main/list?namespace=nested.names
|
||||||
|
|
||||||
GET /api/non-project-code/list?namespace=names&relativeTo=nested
|
GET /api/projects/scratch/branches/main/list?namespace=names&relativeTo=nested
|
||||||
```
|
```
|
||||||
|
@ -23,7 +23,7 @@ nested.names.readme = {{ I'm a readme! }}
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ nested.names.readme = {{ I'm a readme! }}
|
|||||||
|
|
||||||
```
|
```
|
||||||
```api
|
```api
|
||||||
GET /api/non-project-code/list?namespace=nested.names
|
GET /api/projects/scratch/branches/main/list?namespace=nested.names
|
||||||
{
|
{
|
||||||
"namespaceListingChildren": [
|
"namespaceListingChildren": [
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ GET /api/non-project-code/list?namespace=nested.names
|
|||||||
"namespaceListingFQN": "nested.names",
|
"namespaceListingFQN": "nested.names",
|
||||||
"namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0"
|
"namespaceListingHash": "#oms19b4f9s3c8tb5skeb8jii95ij35n3hdg038pu6rv5b0fikqe4gd7lnu6a1i6aq5tdh2opdo4s0sfrupvk6vfkr9lf0n752gbl8o0"
|
||||||
}
|
}
|
||||||
GET /api/non-project-code/list?namespace=names&relativeTo=nested
|
GET /api/projects/scratch/branches/main/list?namespace=names&relativeTo=nested
|
||||||
{
|
{
|
||||||
"namespaceListingChildren": [
|
"namespaceListingChildren": [
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Definition Summary APIs
|
# Definition Summary APIs
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.mergeio
|
scratch/main> builtins.mergeio
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -25,56 +25,56 @@ structural ability Stream s where
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> add
|
scratch/main> add
|
||||||
.> alias.type ##Nat Nat
|
scratch/main> alias.type ##Nat Nat
|
||||||
.> alias.term ##IO.putBytes.impl.v3 putBytesImpl
|
scratch/main> alias.term ##IO.putBytes.impl.v3 putBytesImpl
|
||||||
```
|
```
|
||||||
|
|
||||||
## Term Summary APIs
|
## Term Summary APIs
|
||||||
|
|
||||||
```api
|
```api
|
||||||
-- term
|
-- term
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat
|
||||||
|
|
||||||
-- term without name uses hash
|
-- term without name uses hash
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary
|
||||||
|
|
||||||
-- doc
|
-- doc
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc
|
||||||
|
|
||||||
-- test
|
-- test
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest
|
||||||
|
|
||||||
-- function
|
-- function
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func
|
||||||
|
|
||||||
-- constructor
|
-- constructor
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This
|
||||||
|
|
||||||
-- Long type signature
|
-- Long type signature
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType
|
||||||
|
|
||||||
-- Long type signature with render width
|
-- Long type signature with render width
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType
|
||||||
|
|
||||||
-- Builtin Term
|
-- Builtin Term
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl
|
||||||
```
|
```
|
||||||
|
|
||||||
## Type Summary APIs
|
## Type Summary APIs
|
||||||
|
|
||||||
```api
|
```api
|
||||||
-- data
|
-- data
|
||||||
GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing
|
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing
|
||||||
|
|
||||||
-- data with type args
|
-- data with type args
|
||||||
GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe
|
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe
|
||||||
|
|
||||||
-- ability
|
-- ability
|
||||||
GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream
|
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream
|
||||||
|
|
||||||
-- builtin type
|
-- builtin type
|
||||||
GET /api/non-project-code/definitions/types/by-hash/@@Nat/summary?name=Nat
|
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ structural ability Stream s where
|
|||||||
|
|
||||||
```api
|
```api
|
||||||
-- term
|
-- term
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary?name=nat
|
||||||
{
|
{
|
||||||
"displayName": "nat",
|
"displayName": "nat",
|
||||||
"hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
|
"hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
|
||||||
@ -42,7 +42,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sq
|
|||||||
"tag": "Plain"
|
"tag": "Plain"
|
||||||
}
|
}
|
||||||
-- term without name uses hash
|
-- term without name uses hash
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8/summary
|
||||||
{
|
{
|
||||||
"displayName": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
|
"displayName": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
|
||||||
"hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
|
"hash": "#qkhkl0n238s1eqibd1ecb8605sqj1m4hpoaag177cu572otqlaf1u28c8suuuqgljdtthsjtr07rv04np05o6oa27ml9105k7uas0t8",
|
||||||
@ -61,7 +61,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@qkhkl0n238s1eqibd1ecb8605sq
|
|||||||
"tag": "Plain"
|
"tag": "Plain"
|
||||||
}
|
}
|
||||||
-- doc
|
-- doc
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo/summary?name=doc
|
||||||
{
|
{
|
||||||
"displayName": "doc",
|
"displayName": "doc",
|
||||||
"hash": "#icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo",
|
"hash": "#icfnhas71n8q5rm7rmpe51hh7bltsr7rb4lv7qadc4cbsifu1mhonlqj2d7836iar2ptc648q9p4u7hf40ijvld574421b6u8gpu0lo",
|
||||||
@ -80,7 +80,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@icfnhas71n8q5rm7rmpe51hh7bl
|
|||||||
"tag": "Doc"
|
"tag": "Doc"
|
||||||
}
|
}
|
||||||
-- test
|
-- test
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8/summary?name=mytest
|
||||||
{
|
{
|
||||||
"displayName": "mytest",
|
"displayName": "mytest",
|
||||||
"hash": "#u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8",
|
"hash": "#u17p9803hdibisou6rlr1sjbccdossgh7vtkd03ovlvnsl2n91lq94sqhughc62tnrual2jlrfk922sebp4nm22o7m5u9j40emft8r8",
|
||||||
@ -111,7 +111,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@u17p9803hdibisou6rlr1sjbccd
|
|||||||
"tag": "Test"
|
"tag": "Test"
|
||||||
}
|
}
|
||||||
-- function
|
-- function
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o/summary?name=func
|
||||||
{
|
{
|
||||||
"displayName": "func",
|
"displayName": "func",
|
||||||
"hash": "#6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o",
|
"hash": "#6ee6j48hk3eovokflkgbmpbfr3oqj4hedqn8ocg3i4i0ko8j7nls7njjirmnh4k2bg8h95seaot798uuloqk62u2ttiqoceulkbmq2o",
|
||||||
@ -151,7 +151,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@6ee6j48hk3eovokflkgbmpbfr3o
|
|||||||
"tag": "Plain"
|
"tag": "Plain"
|
||||||
}
|
}
|
||||||
-- constructor
|
-- constructor
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0@d0/summary?name=Thing.This
|
||||||
{
|
{
|
||||||
"displayName": "Thing.This",
|
"displayName": "Thing.This",
|
||||||
"hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0#0",
|
"hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0#0",
|
||||||
@ -191,7 +191,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@altimqs66j3dh94dpab5pg7j5ad
|
|||||||
"tag": "DataConstructor"
|
"tag": "DataConstructor"
|
||||||
}
|
}
|
||||||
-- Long type signature
|
-- Long type signature
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?name=funcWithLongType
|
||||||
{
|
{
|
||||||
"displayName": "funcWithLongType",
|
"displayName": "funcWithLongType",
|
||||||
"hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8",
|
"hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8",
|
||||||
@ -378,7 +378,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59tton
|
|||||||
"tag": "Plain"
|
"tag": "Plain"
|
||||||
}
|
}
|
||||||
-- Long type signature with render width
|
-- Long type signature with render width
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8/summary?renderWidth=20&name=funcWithLongType
|
||||||
{
|
{
|
||||||
"displayName": "funcWithLongType",
|
"displayName": "funcWithLongType",
|
||||||
"hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8",
|
"hash": "#ieskgcjjvuegpecq9pbha59ttonke7pf31keeq0jlh31ijkfq00e06fdi36ae90u24pjva6ucqdbedropjgi3g3b75nu76ll5ls8ke8",
|
||||||
@ -565,7 +565,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@ieskgcjjvuegpecq9pbha59tton
|
|||||||
"tag": "Plain"
|
"tag": "Plain"
|
||||||
}
|
}
|
||||||
-- Builtin Term
|
-- Builtin Term
|
||||||
GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl
|
GET /api/projects/scratch/branches/main/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summary?name=putBytesImpl
|
||||||
{
|
{
|
||||||
"displayName": "putBytesImpl",
|
"displayName": "putBytesImpl",
|
||||||
"hash": "##IO.putBytes.impl.v3",
|
"hash": "##IO.putBytes.impl.v3",
|
||||||
@ -671,7 +671,7 @@ GET /api/non-project-code/definitions/terms/by-hash/@@IO.putBytes.impl.v3/summar
|
|||||||
|
|
||||||
```api
|
```api
|
||||||
-- data
|
-- data
|
||||||
GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing
|
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0/summary?name=Thing
|
||||||
{
|
{
|
||||||
"displayName": "Thing",
|
"displayName": "Thing",
|
||||||
"hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0",
|
"hash": "#altimqs66j3dh94dpab5pg7j5adjrndq61n803j7fg0v0ohdiut6or66bu1fiongpd45s5euiuo8ru47b928aqv8osln1ikdeg05hq0",
|
||||||
@ -710,7 +710,7 @@ GET /api/non-project-code/definitions/types/by-hash/@altimqs66j3dh94dpab5pg7j5ad
|
|||||||
"tag": "Data"
|
"tag": "Data"
|
||||||
}
|
}
|
||||||
-- data with type args
|
-- data with type args
|
||||||
GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe
|
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg/summary?name=Maybe
|
||||||
{
|
{
|
||||||
"displayName": "Maybe",
|
"displayName": "Maybe",
|
||||||
"hash": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg",
|
"hash": "#nirp5os0q69o4e1u9p3t6mmq6l6otluefi3ksm7dhm0diidjvkkgl8o9bvnflbj0sanuvdusf34f1qrins3ktcaglpcqv9oums2slsg",
|
||||||
@ -759,7 +759,7 @@ GET /api/non-project-code/definitions/types/by-hash/@nirp5os0q69o4e1u9p3t6mmq6l6
|
|||||||
"tag": "Data"
|
"tag": "Data"
|
||||||
}
|
}
|
||||||
-- ability
|
-- ability
|
||||||
GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream
|
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8/summary?name=Stream
|
||||||
{
|
{
|
||||||
"displayName": "Stream",
|
"displayName": "Stream",
|
||||||
"hash": "#rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8",
|
"hash": "#rfi1v9429f9qluv533l2iba77aadttilrpmnhljfapfnfa6sru2nr8ibpqvib9nc4s4nb9s1as45upsfqfqe6ivqi2p82b2vd866it8",
|
||||||
@ -808,7 +808,7 @@ GET /api/non-project-code/definitions/types/by-hash/@rfi1v9429f9qluv533l2iba77aa
|
|||||||
"tag": "Ability"
|
"tag": "Ability"
|
||||||
}
|
}
|
||||||
-- builtin type
|
-- builtin type
|
||||||
GET /api/non-project-code/definitions/types/by-hash/@@Nat/summary?name=Nat
|
GET /api/projects/scratch/branches/main/definitions/types/by-hash/@@Nat/summary?name=Nat
|
||||||
{
|
{
|
||||||
"displayName": "Nat",
|
"displayName": "Nat",
|
||||||
"hash": "##Nat",
|
"hash": "##Nat",
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Should block an `add` if it requires an update on an in-file dependency.
|
Should block an `add` if it requires an update on an in-file dependency.
|
||||||
|
|
||||||
```ucm:hide
|
```ucm:hide
|
||||||
.> builtins.merge
|
scratch/main> builtins.merge
|
||||||
```
|
```
|
||||||
|
|
||||||
```unison
|
```unison
|
||||||
@ -11,7 +11,7 @@ x = 1
|
|||||||
```
|
```
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
```
|
```
|
||||||
|
|
||||||
Update `x`, and add a new `y` which depends on the update
|
Update `x`, and add a new `y` which depends on the update
|
||||||
@ -24,5 +24,5 @@ y = x + 1
|
|||||||
Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'.
|
Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'.
|
||||||
|
|
||||||
```ucm:error
|
```ucm:error
|
||||||
.> add y
|
scratch/main> add y
|
||||||
```
|
```
|
||||||
|
@ -20,7 +20,7 @@ x = 1
|
|||||||
|
|
||||||
```
|
```
|
||||||
```ucm
|
```ucm
|
||||||
.> add
|
scratch/main> add
|
||||||
|
|
||||||
⍟ I've added these definitions:
|
⍟ I've added these definitions:
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ y = x + 1
|
|||||||
Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'.
|
Try to add only the new `y`. This should fail because it requires an update to `x`, but we only ran an 'add'.
|
||||||
|
|
||||||
```ucm
|
```ucm
|
||||||
.> add y
|
scratch/main> add y
|
||||||
|
|
||||||
x These definitions failed:
|
x These definitions failed:
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user