making an absolute mess in git

This commit is contained in:
Arya Irani 2021-04-06 12:50:18 -06:00
parent b6afd46a05
commit e4f76472d6
19 changed files with 1109 additions and 505 deletions

View File

@ -0,0 +1,21 @@
```ucm
.> alias.type ##Int Int
```
```unison
type Optional a = None | Some a
type Boptional = Bconstructional (Optional ##Int)
```
```ucm
.mytypes> add
```
```unison
```
```ucm
.> names Optional
.> names Boptional
.> find
```

View File

@ -0,0 +1,67 @@
```ucm
.> alias.type ##Int Int
Done.
```
```unison
type Optional a = None | Some a
type Boptional = Bconstructional (Optional ##Int)
```
```ucm
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
type Boptional
type Optional a
```
```ucm
☝️ The namespace .mytypes is empty.
.mytypes> add
⍟ I've added these definitions:
type Boptional
type Optional a
```
```unison
```
```ucm
I loaded scratch.u and didn't find anything.
```
```ucm
.> names Optional
Type
Hash: #5isltsdct9
Names: mytypes.Optional
.> names Boptional
Type
Hash: #5q7ug1s3tb
Names: mytypes.Boptional
.> find
1. builtin type Int
2. type mytypes.Boptional
3. mytypes.Boptional.Bconstructional : Optional Int
-> Boptional
4. type mytypes.Optional a
5. mytypes.Optional.None : Optional a
6. mytypes.Optional.Some : a -> Optional a
```

View File

@ -0,0 +1,3 @@
```ucm
.> builtins.merge
```

View File

@ -0,0 +1,6 @@
```ucm
.> builtins.merge
Done.
```

View File

@ -0,0 +1,8 @@
```unison
unique type Foo = Foo
```
```ucm
.> add
.> find
```

View File

@ -0,0 +1,29 @@
```unison
unique type Foo = Foo
```
```ucm
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
unique type Foo
```
```ucm
.> add
⍟ I've added these definitions:
unique type Foo
.> find
1. unique type Foo
2. Foo.Foo : Foo
```

View File

@ -0,0 +1,26 @@
```ucm
.> alias.term ##Nat.+ +
```
```unison:hide
type Foo = Foo | Bar
a = 3
b = a + 1
```
```ucm
.foo.bar> add
```
```unison:hide
a = 4
```
```ucm
.foo.bar> update
.> find
```
```unison
> b
```

View File

@ -0,0 +1,64 @@
```ucm
.> alias.term ##Nat.+ +
Done.
```
```unison
type Foo = Foo | Bar
a = 3
b = a + 1
```
```ucm
☝️ The namespace .foo.bar is empty.
.foo.bar> add
⍟ I've added these definitions:
type Foo
a : ##Nat
b : ##Nat
```
```unison
a = 4
```
```ucm
.foo.bar> update
⍟ I've updated these names to your new definition:
a : ##Nat
.> find
1. + : ##Nat -> ##Nat -> ##Nat
2. type foo.bar.Foo
3. foo.bar.Foo.Bar : Foo
4. foo.bar.Foo.Foo : Foo
5. foo.bar.a : ##Nat
6. foo.bar.b : ##Nat
```
```unison
> b
```
```ucm
scratch.u changed.
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
1 | > b
5
```

View File

@ -0,0 +1,17 @@
name: unison-util-serialization
library:
source-dirs: .
dependencies:
- base
- bytes
- bytestring
- containers
- extra
- filepath
- text
- text-short
- unliftio
- vector
- unison-util

View File

@ -1,34 +1,32 @@
cabal-version: 2.2
-- Initial package description 'unison-codebase2-core.cabal' generated by
-- 'cabal init'. For further documentation, see
-- http://haskell.org/cabal/users-guide/
cabal-version: 1.12
name: unison-util-serialization
version: 0.1.0.0
-- synopsis:
-- description:
homepage: https://github.com/unisonweb/unison
-- bug-reports:
license: MIT
copyright: Unison Computing, PBC
category: Development
-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: f313cfc57110dcc277ac24eb79210d1dc8071221e3452971ad26e8a3e1d8abc4
name: unison-util-serialization
version: 0.0.0
build-type: Simple
library
exposed-modules:
U.Util.Serialization
-- other-modules:
-- other-extensions:
U.Util.Serialization
other-modules:
Paths_unison_util_serialization
hs-source-dirs:
./.
build-depends:
base,
bytes,
bytestring,
containers,
extra,
filepath,
text,
text-short,
unliftio,
vector,
unison-util
hs-source-dirs: .
default-language: Haskell2010
base
, bytes
, bytestring
, containers
, extra
, filepath
, text
, text-short
, unison-util
, unliftio
, vector
default-language: Haskell2010

10
defaults.yaml Normal file
View File

@ -0,0 +1,10 @@
dependencies:
- base
- bytestring
- containers
- extra
- lens
- memory
- text
- unliftio
- safe

View File

@ -0,0 +1,203 @@
name: unison-parser-typechecker
github: unisonweb/unison
executables:
unison:
source-dirs: unison
main: Main.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-I0 -optP-Wno-nonportable-include-path
dependencies:
- base
- bytestring
- containers
- configurator
- directory
- errors
- filepath
- lens
- megaparsec
- mtl
- safe
- shellmet
- template-haskell
- temporary
- text
- unison-core1
- unison-parser-typechecker
- unison-codebase-sync
- uri-encode
when:
- condition: '!os(windows)'
dependencies: unix
tests:
source-dirs: tests
main: Suite.hs
ghc-options: -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
dependencies:
- async
- base
- bytestring
- containers
- directory
- easytest
- errors
- extra
- filepath
- filemanip
- here
- lens
- megaparsec
- mtl
- raw-strings-qq
- stm
- shellmet
- split
- temporary
- text
- transformers
- unliftio
- unison-core1
- unison-parser-typechecker
- unison-util
transcripts:
source-dirs: transcripts
main: Transcripts.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N -v0
dependencies:
- base
- directory
- easytest
- filepath
- shellmet
- process
- text
- unison-core1
- unison-parser-typechecker
benchmarks:
runtime:
source-dirs: benchmarks/runtime
main: Main.hs
dependencies:
- base
- criterion
- containers
- unison-core1
- unison-parser-typechecker
library:
source-dirs: src
dependencies:
- aeson
- ansi-terminal
- async
- base
- base16 >= 0.2.1.0
- base64-bytestring
- basement
- bifunctors
- bytes
- bytestring
- cereal
- containers >= 0.6.3
- comonad
- concurrent-supply
- configurator
- cryptonite
- data-default
- directory
- either
- guid
- data-memocombinators
- edit-distance
- errors
- exceptions
- extra
- filepath
- filepattern
- fingertree
- free
- fsnotify
- generic-monoid
- hashable
- hashtables
- haskeline
- http-types
- io-streams
- lens
- ListLike
- megaparsec >= 5.0.0 && < 7.0.0
- memory
- mmorph
- monad-loops
- monad-validate
- mtl
- murmur-hash
- mutable-containers
- natural-transformation
- network
- network-simple
- nonempty-containers
- openapi3
- pem
- process
- primitive
- random >= 1.2.0
- raw-strings-qq
- regex-base
- regex-tdfa
- safe
- servant
- servant-docs
- servant-openapi3
- servant-server
- shellmet
- split
- stm
- strings
- sqlite-simple
- tagged
- temporary
- terminal-size
- text
- time
- tls
- transformers
- unison-core1
- unliftio
- unliftio-core
- util
- unicode-show
- validation
- vector
- wai
- warp
- unicode-show
- x509
- x509-store
- x509-system
- unison-core
- unison-codebase
- unison-codebase-sqlite
- unison-codebase-sync
- unison-util
- unison-util-serialization
default-extensions:
- ApplicativeDo
- BlockArguments
- DeriveFunctor
- DerivingStrategies
- DoAndIfThenElse
- FlexibleContexts
- FlexibleInstances
- LambdaCase
- MultiParamTypeClasses
- ScopedTypeVariables
- TupleSections
- TypeApplications
ghc-options: -Wall -funbox-strict-fields -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures

View File

@ -2,58 +2,58 @@
module Unison.Test.Ucm where
import Control.Monad.Writer (WriterT)
import qualified Control.Monad.Writer as Writer
import qualified Data.Sequence as Seq
import qualified Data.Text as Text
import System.FilePath ((</>))
import U.Util.Text (stripMargin)
import qualified Unison.Codebase.FileCodebase as FC
import qualified Unison.Codebase.Init as Codebase.Init
import qualified Unison.Codebase.SqliteCodebase as SC
import qualified Unison.Codebase.TranscriptParser as TR
import Unison.Prelude
import qualified Unison.Util.Pretty as P
-- import Control.Monad.Writer (WriterT)
-- import qualified Control.Monad.Writer as Writer
-- import qualified Data.Sequence as Seq
-- import qualified Data.Text as Text
-- import System.FilePath ((</>))
-- import U.Util.Text (stripMargin)
-- import qualified Unison.Codebase.FileCodebase as FC
-- import qualified Unison.Codebase.Init as Codebase.Init
-- import qualified Unison.Codebase.SqliteCodebase as SC
-- import qualified Unison.Codebase.TranscriptParser as TR
-- import Unison.Prelude
-- import qualified Unison.Util.Pretty as P
data Runtime = Runtime1 | Runtime2
-- data Runtime = Runtime1 | Runtime2
data CodebaseFormat = CodebaseFormat1 | CodebaseFormat2
-- data CodebaseFormat = CodebaseFormat1 | CodebaseFormat2
newtype CodebaseName = CodebaseName {unCodebaseName :: String}
-- newtype CodebaseName = CodebaseName {unCodebaseName :: String}
type Args = Map String String
-- -- type Args = Map String String
newtype Transcript = Transcript {unTranscript :: Text} deriving (IsString) via Text
-- newtype Transcript = Transcript {unTranscript :: Text} deriving (IsString) via Text
type TranscriptOutput = String
-- type TranscriptOutput = String
type Cleanup = Seq (IO ())
-- type Cleanup = Seq (IO ())
runTranscript ::
FilePath ->
CodebaseName ->
CodebaseFormat ->
Runtime ->
Args ->
(Args -> Transcript) ->
WriterT Cleanup IO TranscriptOutput
runTranscript tmpDir codebaseName fmt rt args mkTranscript = do
let configFile = tmpDir </> ".unisonConfig"
codebasePath = tmpDir </> unCodebaseName codebaseName
let err err = error $ "Parse error: \n" <> show err
cbInit = case fmt of CodebaseFormat1 -> FC.init; CodebaseFormat2 -> SC.init
codebase <-
lift (Codebase.Init.createCodebase cbInit codebasePath) >>= \case
Left e -> fail $ P.toANSI 80 e
Right (cleanup, c) -> do
Writer.tell . Seq.singleton $ cleanup
pure c
-- parse and run the transcript
flip (either err) (TR.parse "transcript" (stripMargin . unTranscript $ mkTranscript args)) $ \stanzas ->
liftIO . fmap Text.unpack $
TR.run
(case rt of Runtime1 -> Just False; Runtime2 -> Just True)
codebasePath
configFile
stanzas
codebase
-- runTranscript ::
-- FilePath ->
-- CodebaseName ->
-- CodebaseFormat ->
-- Runtime ->
-- Args ->
-- (Args -> Transcript) ->
-- WriterT Cleanup IO TranscriptOutput
-- runTranscript tmpDir codebaseName fmt rt args mkTranscript = do
-- let configFile = tmpDir </> ".unisonConfig"
-- codebasePath = tmpDir </> unCodebaseName codebaseName
-- let err err = error $ "Parse error: \n" <> show err
-- cbInit = case fmt of CodebaseFormat1 -> FC.init; CodebaseFormat2 -> SC.init
-- codebase <-
-- lift (Codebase.Init.createCodebase cbInit codebasePath) >>= \case
-- Left e -> fail $ P.toANSI 80 e
-- Right (cleanup, c) -> do
-- Writer.tell . Seq.singleton $ cleanup
-- pure c
-- -- parse and run the transcript
-- flip (either err) (TR.parse "transcript" (stripMargin . unTranscript $ mkTranscript args)) $ \stanzas ->
-- liftIO . fmap Text.unpack $
-- TR.run
-- (case rt of Runtime1 -> Just False; Runtime2 -> Just True)
-- codebasePath
-- configFile
-- stanzas
-- codebase

View File

@ -1,444 +1,406 @@
cabal-version: 2.2
name: unison-parser-typechecker
category: Compiler
version: 0.1
license: MIT
license-file: LICENSE
author: Unison Computing, public benefit corp
maintainer: Paul Chiusano <paul.chiusano@gmail.com>, Runar Bjarnason <runarorama@gmail.com>, Arya Irani <arya.irani@gmail.com>
stability: provisional
homepage: http://unisonweb.org
bug-reports: https://github.com/unisonweb/unison/issues
copyright: Copyright (C) 2013-2018 Unison Computing, PBC and contributors
synopsis: Parser and typechecker for the Unison language
description:
cabal-version: 1.12
build-type: Simple
extra-source-files:
data-files:
-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 0ae2571ad379b4554048a2fd52c78425b207f9626279fea937c4628afd6fafb0
name: unison-parser-typechecker
version: 0.0.0
homepage: https://github.com/unisonweb/unison#readme
bug-reports: https://github.com/unisonweb/unison/issues
license: MIT
license-file: LICENSE
build-type: Simple
source-repository head
type: git
location: git://github.com/unisonweb/unison.git
-- `cabal install -foptimized` enables optimizations
flag optimized
manual: True
default: False
flag quiet
manual: True
default: False
-- NOTE: Keep in sync throughout repo.
common unison-common
default-language: Haskell2010
default-extensions:
ApplicativeDo,
BlockArguments,
DeriveFunctor,
DerivingStrategies,
DoAndIfThenElse,
FlexibleContexts,
FlexibleInstances,
LambdaCase,
MultiParamTypeClasses,
ScopedTypeVariables,
TupleSections,
TypeApplications
location: https://github.com/unisonweb/unison
library
import: unison-common
hs-source-dirs: src
exposed-modules:
Unison.Builtin
Unison.Builtin.Decls
Unison.Builtin.Terms
Unison.Codecs
Unison.Codebase
Unison.Codebase.Branch
Unison.Codebase.BranchDiff
Unison.Codebase.BranchUtil
Unison.Codebase.Causal
Unison.Codebase.Classes
Unison.Codebase.CodeLookup
Unison.Codebase.Conversion.Sync12
Unison.Codebase.Conversion.Sync12BranchDependencies
Unison.Codebase.Editor.AuthorInfo
Unison.Codebase.Editor.Command
Unison.Codebase.Editor.DisplayObject
Unison.Codebase.Editor.Git
Unison.Codebase.Editor.HandleInput
Unison.Codebase.Editor.HandleCommand
Unison.Codebase.Editor.Input
Unison.Codebase.Editor.Output
Unison.Codebase.Editor.Output.BranchDiff
Unison.Codebase.Editor.Propagate
Unison.Codebase.Editor.RemoteRepo
Unison.Codebase.Editor.SlurpResult
Unison.Codebase.Editor.SlurpComponent
Unison.Codebase.Editor.TodoOutput
Unison.Codebase.Editor.UriParser
Unison.Codebase.Editor.VersionParser
Unison.Codebase.FileCodebase
Unison.Codebase.FileCodebase.Branch.Dependencies
Unison.Codebase.FileCodebase.Common
Unison.Codebase.FileCodebase.SlimCopyRegenerateIndex
Unison.Codebase.GitError
Unison.Codebase.Init
Unison.Codebase.Metadata
Unison.Codebase.NameEdit
Unison.Codebase.Path
Unison.Codebase.Patch
Unison.Codebase.Reflog
Unison.Codebase.Runtime
Unison.Codebase.Serialization
Unison.Codebase.Serialization.PutT
Unison.Codebase.Serialization.V1
Unison.Codebase.ShortBranchHash
Unison.Codebase.SqliteCodebase
Unison.Codebase.SqliteCodebase.Branch.Dependencies
Unison.Codebase.SqliteCodebase.Conversions
Unison.Codebase.SqliteCodebase.SyncEphemeral
Unison.Codebase.SyncMode
Unison.Codebase.TermEdit
Unison.Codebase.TranscriptParser
Unison.Codebase.TypeEdit
Unison.Codebase.Watch
Unison.Codebase.Execute
Unison.Codebase.MainTerm
Unison.CommandLine
Unison.CommandLine.DisplayValues
Unison.CommandLine.InputPattern
Unison.CommandLine.InputPatterns
Unison.CommandLine.Main
Unison.CommandLine.OutputMessages
Unison.DeclPrinter
Unison.FileParser
Unison.FileParsers
Unison.Lexer
Unison.NamePrinter
Unison.Parser
Unison.Parsers
Unison.Path
Unison.PrettyPrintEnv
Unison.PrettyTerminal
Unison.PrintError
Unison.Result
Unison.Runtime.ANF
Unison.Runtime.ANF.Serialize
Unison.Runtime.Builtin
Unison.Runtime.Debug
Unison.Runtime.Decompile
Unison.Runtime.Exception
Unison.Runtime.Foreign
Unison.Runtime.Foreign.Function
Unison.Runtime.Interface
Unison.Runtime.IR
Unison.Runtime.MCode
Unison.Runtime.Machine
Unison.Runtime.Pattern
Unison.Runtime.Rt1
Unison.Runtime.Rt1IO
Unison.Runtime.IOSource
Unison.Runtime.Vector
Unison.Runtime.SparseVector
Unison.Runtime.Stack
Unison.Server.Backend
Unison.Server.CodebaseServer
Unison.Server.Endpoints.GetDefinitions
Unison.Server.Endpoints.ListNamespace
Unison.Server.Errors
Unison.Server.QueryResult
Unison.Server.SearchResult
Unison.Server.SearchResult'
Unison.Server.Syntax
Unison.Server.Types
Unison.TermParser
Unison.TermPrinter
Unison.TypeParser
Unison.TypePrinter
Unison.Typechecker
Unison.Typechecker.Components
Unison.Typechecker.Context
Unison.Typechecker.Extractor
Unison.Typechecker.TypeError
Unison.Typechecker.TypeLookup
Unison.Typechecker.TypeVar
Unison.UnisonFile
Unison.Util.AnnotatedText
Unison.Util.Bytes
Unison.Util.ColorText
Unison.Util.EnumContainers
Unison.Util.Exception
Unison.Util.Free
Unison.Util.Find
Unison.Util.Less
Unison.Util.Logger
Unison.Util.Map
Unison.Util.Menu
Unison.Util.PinBoard
Unison.Util.Pretty
Unison.Util.Range
Unison.Util.Star3
Unison.Util.SyntaxText
Unison.Util.Timing
Unison.Util.TQueue
Unison.Util.TransitiveClosure
Unison.Util.CycleTable
Unison.Util.CyclicEq
Unison.Util.CyclicOrd
build-depends:
aeson,
ansi-terminal,
async,
base,
base16 >= 0.2.1.0,
base64-bytestring,
basement,
bifunctors,
bytes,
bytestring,
cereal,
containers >= 0.6.3,
comonad,
concurrent-supply,
configurator,
cryptonite,
data-default,
directory,
either,
guid,
data-memocombinators,
edit-distance,
errors,
exceptions,
extra,
filepath,
filepattern,
fingertree,
free,
fsnotify,
generic-monoid,
hashable,
hashtables,
haskeline,
http-types,
io-streams,
lens,
ListLike,
megaparsec >= 5.0.0 && < 7.0.0,
memory,
mmorph,
monad-loops,
monad-validate,
mtl,
murmur-hash,
mutable-containers,
natural-transformation,
network,
network-simple,
nonempty-containers,
openapi3,
pem,
process,
primitive,
random >= 1.2.0,
raw-strings-qq,
regex-base,
regex-tdfa,
safe,
servant,
servant-docs,
servant-openapi3,
servant-server,
shellmet,
split,
stm,
strings,
sqlite-simple,
tagged,
temporary,
terminal-size,
text,
time,
tls,
transformers,
unison-core1,
unliftio,
unliftio-core,
util,
unicode-show,
validation,
vector,
wai,
warp,
unicode-show,
x509,
x509-store,
x509-system,
-- v2
unison-core,
unison-codebase,
unison-codebase-sqlite,
unison-codebase-sync,
unison-util,
unison-util-serialization
ghc-options: -Wall -O0 -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
if flag(optimized)
ghc-options: -funbox-strict-fields -O2
if flag(quiet)
ghc-options: -v0
executable unison
import: unison-common
main-is: Main.hs
hs-source-dirs: unison
ghc-options: -Wall -threaded -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -rtsopts -with-rtsopts=-I0 -optP-Wno-nonportable-include-path
Unison.Builtin
Unison.Builtin.Decls
Unison.Builtin.Terms
Unison.Codebase
Unison.Codebase.Branch
Unison.Codebase.BranchDiff
Unison.Codebase.BranchUtil
Unison.Codebase.Causal
Unison.Codebase.Classes
Unison.Codebase.CodeLookup
Unison.Codebase.Conversion.Sync12
Unison.Codebase.Conversion.Sync12BranchDependencies
Unison.Codebase.Conversion.Upgrade12
Unison.Codebase.Editor.AuthorInfo
Unison.Codebase.Editor.Command
Unison.Codebase.Editor.DisplayObject
Unison.Codebase.Editor.Git
Unison.Codebase.Editor.HandleCommand
Unison.Codebase.Editor.HandleInput
Unison.Codebase.Editor.Input
Unison.Codebase.Editor.Output
Unison.Codebase.Editor.Output.BranchDiff
Unison.Codebase.Editor.Propagate
Unison.Codebase.Editor.RemoteRepo
Unison.Codebase.Editor.SlurpComponent
Unison.Codebase.Editor.SlurpResult
Unison.Codebase.Editor.TodoOutput
Unison.Codebase.Editor.UriParser
Unison.Codebase.Editor.VersionParser
Unison.Codebase.Execute
Unison.Codebase.FileCodebase
Unison.Codebase.FileCodebase.Branch.Dependencies
Unison.Codebase.FileCodebase.Common
Unison.Codebase.FileCodebase.SlimCopyRegenerateIndex
Unison.Codebase.GitError
Unison.Codebase.Init
Unison.Codebase.MainTerm
Unison.Codebase.Metadata
Unison.Codebase.NameEdit
Unison.Codebase.Patch
Unison.Codebase.Path
Unison.Codebase.Reflog
Unison.Codebase.Runtime
Unison.Codebase.Serialization
Unison.Codebase.Serialization.PutT
Unison.Codebase.Serialization.V1
Unison.Codebase.ShortBranchHash
Unison.Codebase.SqliteCodebase
Unison.Codebase.SqliteCodebase.Branch.Dependencies
Unison.Codebase.SqliteCodebase.Conversions
Unison.Codebase.SqliteCodebase.SyncEphemeral
Unison.Codebase.SyncMode
Unison.Codebase.TermEdit
Unison.Codebase.TranscriptParser
Unison.Codebase.TypeEdit
Unison.Codebase.Watch
Unison.Codecs
Unison.CommandLine
Unison.CommandLine.DisplayValues
Unison.CommandLine.InputPattern
Unison.CommandLine.InputPatterns
Unison.CommandLine.Main
Unison.CommandLine.OutputMessages
Unison.DeclPrinter
Unison.FileParser
Unison.FileParsers
Unison.Lexer
Unison.NamePrinter
Unison.Parser
Unison.Parsers
Unison.Path
Unison.PrettyPrintEnv
Unison.PrettyTerminal
Unison.PrintError
Unison.Result
Unison.Runtime.ANF
Unison.Runtime.ANF.Serialize
Unison.Runtime.Builtin
Unison.Runtime.Debug
Unison.Runtime.Decompile
Unison.Runtime.Exception
Unison.Runtime.Foreign
Unison.Runtime.Foreign.Function
Unison.Runtime.Interface
Unison.Runtime.IOSource
Unison.Runtime.IR
Unison.Runtime.Machine
Unison.Runtime.MCode
Unison.Runtime.Pattern
Unison.Runtime.Rt1
Unison.Runtime.Rt1IO
Unison.Runtime.SparseVector
Unison.Runtime.Stack
Unison.Runtime.Vector
Unison.Server.Backend
Unison.Server.CodebaseServer
Unison.Server.Endpoints.GetDefinitions
Unison.Server.Endpoints.ListNamespace
Unison.Server.Errors
Unison.Server.QueryResult
Unison.Server.SearchResult
Unison.Server.SearchResult'
Unison.Server.Syntax
Unison.Server.Types
Unison.TermParser
Unison.TermPrinter
Unison.Typechecker
Unison.Typechecker.Components
Unison.Typechecker.Context
Unison.Typechecker.Extractor
Unison.Typechecker.TypeError
Unison.Typechecker.TypeLookup
Unison.Typechecker.TypeVar
Unison.TypeParser
Unison.TypePrinter
Unison.UnisonFile
Unison.Util.AnnotatedText
Unison.Util.Bytes
Unison.Util.ColorText
Unison.Util.CycleTable
Unison.Util.CyclicEq
Unison.Util.CyclicOrd
Unison.Util.EnumContainers
Unison.Util.Exception
Unison.Util.Find
Unison.Util.Free
Unison.Util.Less
Unison.Util.Logger
Unison.Util.Map
Unison.Util.Menu
Unison.Util.PinBoard
Unison.Util.Pretty
Unison.Util.Range
Unison.Util.Star3
Unison.Util.SyntaxText
Unison.Util.Timing
Unison.Util.TQueue
Unison.Util.TransitiveClosure
other-modules:
System.Path
Version
Paths_unison_parser_typechecker
hs-source-dirs:
src
default-extensions: ApplicativeDo BlockArguments DeriveFunctor DerivingStrategies DoAndIfThenElse FlexibleContexts FlexibleInstances LambdaCase MultiParamTypeClasses ScopedTypeVariables TupleSections TypeApplications
ghc-options: -Wall -funbox-strict-fields -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base,
bytestring,
containers,
configurator,
directory,
errors,
filepath,
lens,
megaparsec,
mtl,
safe,
shellmet,
template-haskell,
temporary,
text,
unison-core1,
unison-parser-typechecker,
unison-codebase-sync,
uri-encode
if !os(windows)
build-depends:
unix
executable prettyprintdemo
import: unison-common
main-is: Main.hs
hs-source-dirs: prettyprintdemo
ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base,
safe,
text,
unison-parser-typechecker
ListLike
, aeson
, ansi-terminal
, async
, base
, base16 >=0.2.1.0
, base64-bytestring
, basement
, bifunctors
, bytes
, bytestring
, cereal
, comonad
, concurrent-supply
, configurator
, containers >=0.6.3
, cryptonite
, data-default
, data-memocombinators
, directory
, edit-distance
, either
, errors
, exceptions
, extra
, filepath
, filepattern
, fingertree
, free
, fsnotify
, generic-monoid
, guid
, hashable
, hashtables
, haskeline
, http-types
, io-streams
, lens
, megaparsec >=5.0.0 && <7.0.0
, memory
, mmorph
, monad-loops
, monad-validate
, mtl
, murmur-hash
, mutable-containers
, natural-transformation
, network
, network-simple
, nonempty-containers
, openapi3
, pem
, primitive
, process
, random >=1.2.0
, raw-strings-qq
, regex-base
, regex-tdfa
, safe
, servant
, servant-docs
, servant-openapi3
, servant-server
, shellmet
, split
, sqlite-simple
, stm
, strings
, tagged
, temporary
, terminal-size
, text
, time
, tls
, transformers
, unicode-show
, unison-codebase
, unison-codebase-sqlite
, unison-codebase-sync
, unison-core
, unison-core1
, unison-util
, unison-util-serialization
, unliftio
, unliftio-core
, util
, validation
, vector
, wai
, warp
, x509
, x509-store
, x509-system
default-language: Haskell2010
executable tests
import: unison-common
main-is: Suite.hs
hs-source-dirs: tests
ghc-options: -W -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-depends:
base,
easytest
main-is: Suite.hs
other-modules:
Unison.Test.ABT
Unison.Test.ANF
Unison.Test.Cache
Unison.Test.Codebase
Unison.Test.Codebase.Causal
Unison.Test.Codebase.FileCodebase
Unison.Test.Codebase.Path
Unison.Test.Codebase.Sync12
Unison.Test.ColorText
Unison.Test.Common
Unison.Test.DataDeclaration
Unison.Test.FileParser
Unison.Test.Git
Unison.Test.GitSimple
Unison.Test.Lexer
Unison.Test.IO
Unison.Test.MCode
Unison.Test.Range
Unison.Test.Referent
Unison.Test.Term
Unison.Test.TermParser
Unison.Test.TermPrinter
Unison.Test.Type
Unison.Test.TypePrinter
Unison.Test.Typechecker
Unison.Test.Typechecker.Components
Unison.Test.Typechecker.Context
Unison.Test.Typechecker.TypeError
Unison.Test.Ucm
Unison.Test.UnisonSources
Unison.Test.UriParser
Unison.Test.Util.Bytes
Unison.Test.Util.PinBoard
Unison.Test.Util.Pretty
Unison.Test.Var
Unison.Test.VersionParser
Unison.Core.Test.Name
Unison.Core.Test.Name
Unison.Test.ABT
Unison.Test.ANF
Unison.Test.Cache
Unison.Test.Codebase
Unison.Test.Codebase.Causal
Unison.Test.Codebase.FileCodebase
Unison.Test.Codebase.Path
Unison.Test.Codebase.Sync12
Unison.Test.ColorText
Unison.Test.Common
Unison.Test.DataDeclaration
Unison.Test.FileParser
Unison.Test.Git
Unison.Test.GitSimple
Unison.Test.IO
Unison.Test.Lexer
Unison.Test.MCode
Unison.Test.Range
Unison.Test.Referent
Unison.Test.Term
Unison.Test.TermParser
Unison.Test.TermPrinter
Unison.Test.Type
Unison.Test.Typechecker
Unison.Test.Typechecker.Components
Unison.Test.Typechecker.Context
Unison.Test.Typechecker.TypeError
Unison.Test.TypePrinter
Unison.Test.Ucm
Unison.Test.UnisonSources
Unison.Test.UriParser
Unison.Test.Util.Bytes
Unison.Test.Util.PinBoard
Unison.Test.Util.Pretty
Unison.Test.Var
Unison.Test.VersionParser
Paths_unison_parser_typechecker
hs-source-dirs:
tests
default-extensions: ApplicativeDo BlockArguments DeriveFunctor DerivingStrategies DoAndIfThenElse FlexibleContexts FlexibleInstances LambdaCase MultiParamTypeClasses ScopedTypeVariables TupleSections TypeApplications
ghc-options: -Wall -funbox-strict-fields -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -W -threaded -rtsopts "-with-rtsopts=-N -T" -v0
build-depends:
async,
base,
bytestring,
containers,
directory,
easytest,
errors,
extra,
filepath,
filemanip,
here,
lens,
megaparsec,
mtl,
raw-strings-qq,
stm,
shellmet,
split,
temporary,
text,
transformers,
unliftio,
unison-core1,
unison-parser-typechecker,
unison-util
async
, base
, bytestring
, containers
, directory
, easytest
, errors
, extra
, filemanip
, filepath
, here
, lens
, megaparsec
, mtl
, raw-strings-qq
, shellmet
, split
, stm
, temporary
, text
, transformers
, unison-core1
, unison-parser-typechecker
, unison-util
, unliftio
default-language: Haskell2010
executable transcripts
import: unison-common
main-is: Transcripts.hs
ghc-options: -W -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -threaded -rtsopts -with-rtsopts=-N -v0
hs-source-dirs: transcripts
main-is: Transcripts.hs
other-modules:
Paths_unison_parser_typechecker
hs-source-dirs:
transcripts
default-extensions: ApplicativeDo BlockArguments DeriveFunctor DerivingStrategies DoAndIfThenElse FlexibleContexts FlexibleInstances LambdaCase MultiParamTypeClasses ScopedTypeVariables TupleSections TypeApplications
ghc-options: -Wall -funbox-strict-fields -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -threaded -rtsopts -with-rtsopts=-N -v0
build-depends:
base,
directory,
easytest,
filepath,
shellmet,
process,
text,
unison-core1,
unison-parser-typechecker
base
, directory
, easytest
, filepath
, process
, shellmet
, text
, unison-core1
, unison-parser-typechecker
default-language: Haskell2010
executable unison
main-is: Main.hs
other-modules:
System.Path
Version
Paths_unison_parser_typechecker
hs-source-dirs:
unison
default-extensions: ApplicativeDo BlockArguments DeriveFunctor DerivingStrategies DoAndIfThenElse FlexibleContexts FlexibleInstances LambdaCase MultiParamTypeClasses ScopedTypeVariables TupleSections TypeApplications
ghc-options: -Wall -funbox-strict-fields -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures -threaded -rtsopts -with-rtsopts=-I0 -optP-Wno-nonportable-include-path
build-depends:
base
, bytestring
, configurator
, containers
, directory
, errors
, filepath
, lens
, megaparsec
, mtl
, safe
, shellmet
, template-haskell
, temporary
, text
, unison-codebase-sync
, unison-core1
, unison-parser-typechecker
, uri-encode
if !os(windows)
build-depends:
unix
default-language: Haskell2010
benchmark runtime
import: unison-common
type: exitcode-stdio-1.0
main-is: Main.hs
ghc-options: -O2
hs-source-dirs: benchmarks/runtime
other-modules:
Paths_unison_parser_typechecker
hs-source-dirs:
benchmarks/runtime
default-extensions: ApplicativeDo BlockArguments DeriveFunctor DerivingStrategies DoAndIfThenElse FlexibleContexts FlexibleInstances LambdaCase MultiParamTypeClasses ScopedTypeVariables TupleSections TypeApplications
ghc-options: -Wall -funbox-strict-fields -fno-warn-name-shadowing -fno-warn-missing-pattern-synonym-signatures
build-depends:
base,
criterion,
containers,
unison-core1,
unison-parser-typechecker
base
, containers
, criterion
, unison-core1
, unison-parser-typechecker
default-language: Haskell2010

View File

@ -1,6 +1,6 @@
next steps:
- [ ] add format tag to watch cache expressions?
- [x] add format tag to watch cache expressions?
- [x] fix up `Operations.loadBranchByCausalHash`; currently it's getting a single namespace, but we need to somewhere get the causal history.
- [x] load a causal, allowing a missing value (C.Branch.Spine)
- [x] load a causal and require its value (C.Branch.Causal)

View File

@ -24,7 +24,7 @@ c = 3
c : ##Nat
.> push /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-term-6e0da114c2313a44/repo.git
.> push /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-term-d431dff9390554a1/repo.git
Done.
@ -32,7 +32,7 @@ c = 3
-------
```ucm
.> pull /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-term-6e0da114c2313a44/repo.git
.> pull /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-term-d431dff9390554a1/repo.git
Here's what's changed in the current namespace after the
merge:

View File

@ -26,7 +26,7 @@ c = 3
c : ##Nat
.myLib> push /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-term2-6e1967b10dc504d9/repo.git
.myLib> push /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-term2-0b775fa442535bdb/repo.git
Done.
@ -36,7 +36,7 @@ c = 3
```ucm
☝️ The namespace .yourLib is empty.
.yourLib> pull /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-term2-6e1967b10dc504d9/repo.git
.yourLib> pull /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-term2-0b775fa442535bdb/repo.git
Here's what's changed in the current namespace after the
merge:

View File

@ -26,7 +26,7 @@ type Foo = Foo
type Foo
.myLib> push /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-type-cc52d9c301e40738/repo.git
.myLib> push /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-type-202b2f75069902c8/repo.git
Done.
@ -36,7 +36,7 @@ type Foo = Foo
```ucm
☝️ The namespace .yourLib is empty.
.yourLib> pull /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-type-cc52d9c301e40738/repo.git
.yourLib> pull /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-one-type-202b2f75069902c8/repo.git
Here's what's changed in the current namespace after the
merge:

View File

@ -0,0 +1,190 @@
```ucm
☝️ The namespace .myLib is empty.
.myLib> alias.term ##Nat.+ +
Done.
```
```unison
improveNat x = x + 3
```
```ucm
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
improveNat : ##Nat -> ##Nat
```
```ucm
.myLib> add
⍟ I've added these definitions:
improveNat : ##Nat -> ##Nat
.myLib> ls
1. + (##Nat -> ##Nat -> ##Nat)
2. improveNat (##Nat -> ##Nat)
.myLib> move.namespace .myLib .workaround1552.myLib.v1
Done.
.workaround1552.myLib> ls
1. v1/ (2 definitions)
.workaround1552.myLib> fork v1 v2
Done.
```
```unison
improveNat x = x + 100
```
```ucm
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These names already exist. You can `update` them to your
new definition:
improveNat : ##Nat -> ##Nat
```
```ucm
.workaround1552.myLib.v2> update
⍟ I've updated these names to your new definition:
improveNat : ##Nat -> ##Nat
.workaround1552.myLib> push /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-patching-7fa752c409f898ef/repo.git
Done.
```
-------
```ucm
☝️ The namespace .myApp is empty.
.myApp> pull /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-patching-7fa752c409f898ef/repo.git:.v1 external.yourLib
Here's what's changed in external.yourLib after the merge:
Added definitions:
1. + : ##Nat -> ##Nat -> ##Nat
2. improveNat : ##Nat -> ##Nat
Tip: You can use `todo` to see if this generated any work to
do in this namespace and `test` to run the tests. Or you
can use `undo` or `reflog` to undo the results of this
merge.
.myApp> alias.term ##Nat.* *
Done.
```
`
```unison
> greatApp = improveNat 5 * improveNat 6
```
```ucm
scratch.u changed.
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
1 | > greatApp = improveNat 5 * improveNat 6
72
```
```ucm
.myApp> add
.myApp> pull /private/var/folders/gg/lqv4nxmx0nv3_35tg9_8c15r0000gn/T/git-simple-patching-7fa752c409f898ef/repo.git:.v2 external.yourLib
Here's what's changed in external.yourLib after the merge:
Updates:
1. improveNat : ##Nat -> ##Nat
2. improveNat : ##Nat -> ##Nat
Added definitions:
3. patch patch (added 1 updates)
Tip: You can use `todo` to see if this generated any work to
do in this namespace and `test` to run the tests. Or you
can use `undo` or `reflog` to undo the results of this
merge.
```
```unison
> greatApp = improveNat 5 * improveNat 6
```
```ucm
scratch.u changed.
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
1 | > greatApp = improveNat 5 * improveNat 6
11130
```
```ucm
.myApp> patch external.yourLib.patch
😶
This had no effect. Perhaps the patch has already been applied
or it doesn't intersect with the definitions in
the current namespace.
```
```unison
> greatApp = improveNat 5 * improveNat 6
```
```ucm
scratch.u changed.
Now evaluating any watch expressions (lines starting with
`>`)... Ctrl+C cancels.
1 | > greatApp = improveNat 5 * improveNat 6
11130
```