Skip to content

Commit

Permalink
⅄ trunk → 22-12-14-tidy-up-hashing-package
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellwrosen committed Dec 15, 2022
2 parents b062e71 + afe1ba3 commit 6e99914
Show file tree
Hide file tree
Showing 53 changed files with 1,267 additions and 312 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ jobs:
run: stack --no-terminal build --fast --test unison-syntax
- name: unison-util-bytes tests
run: stack --no-terminal build --fast --test unison-util-bytes
- name: unison-util-cache tests
run: stack --no-terminal build --fast --test unison-util-cache
- name: unison-util-relation tests
run: stack --no-terminal build --fast --test unison-util-relation
- name: transcripts
Expand Down
1 change: 0 additions & 1 deletion codebase2/codebase-sqlite-hashing-v2/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ dependencies:
- unison-hashing-v2
- unison-prelude
- unison-sqlite
- unison-util
- unison-util-base32hex
- unison-util-term
- vector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ library
, unison-hashing-v2
, unison-prelude
, unison-sqlite
, unison-util
, unison-util-base32hex
, unison-util-term
, vector
Expand Down
4 changes: 2 additions & 2 deletions codebase2/codebase-sqlite/U/Codebase/Sqlite/Queries.hs
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,17 @@ import qualified U.Codebase.Term as C.Term
import qualified U.Codebase.Type as C.Type
import U.Codebase.WatchKind (WatchKind)
import qualified U.Core.ABT as ABT
import qualified U.Util.Alternative as Alternative
import U.Util.Hash (Hash)
import qualified U.Util.Hash as Hash
import U.Util.Hash32 (Hash32)
import qualified U.Util.Hash32 as Hash32
import U.Util.Hash32.Orphans.Sqlite ()
import qualified U.Util.Lens as Lens
import qualified U.Util.Serialization as S
import qualified U.Util.Term as TermUtil
import Unison.Prelude
import Unison.Sqlite
import qualified Unison.Util.Alternative as Alternative
import qualified Unison.Util.Lens as Lens

-- * main squeeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ import qualified U.Core.ABT as ABT
import qualified U.Util.Base32Hex as Base32Hex
import U.Util.Hash32 (Hash32)
import qualified U.Util.Hash32 as Hash32
import qualified U.Util.Monoid as Monoid
import U.Util.Serialization hiding (debug)
import Unison.Prelude
import qualified Unison.Util.Monoid as Monoid
import Prelude hiding (getChar, putChar)

debug :: Bool
Expand Down
4 changes: 2 additions & 2 deletions codebase2/codebase-sqlite/U/Codebase/Sqlite/Sync22.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ import qualified U.Codebase.Sqlite.Term.Format as TermFormat
import U.Codebase.Sync (Sync (Sync), TrySyncResult)
import qualified U.Codebase.Sync as Sync
import qualified U.Codebase.WatchKind as WK
import U.Util.Cache (Cache)
import qualified U.Util.Cache as Cache
import Unison.Prelude
import Unison.Sqlite (Transaction)
import Unison.Util.Cache (Cache)
import qualified Unison.Util.Cache as Cache

data Entity
= O ObjectId
Expand Down
2 changes: 1 addition & 1 deletion codebase2/codebase-sqlite/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ dependencies:
- unison-hash-orphans-sqlite
- unison-prelude
- unison-sqlite
- unison-util
- unison-util-base32hex
- unison-util-cache
- unison-util-serialization
- unison-util-term
- unliftio
Expand Down
2 changes: 1 addition & 1 deletion codebase2/codebase-sqlite/unison-codebase-sqlite.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ library
, unison-hash-orphans-sqlite
, unison-prelude
, unison-sqlite
, unison-util
, unison-util-base32hex
, unison-util-cache
, unison-util-serialization
, unison-util-term
, unliftio
Expand Down
1 change: 0 additions & 1 deletion codebase2/codebase/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ dependencies:
- text
- unison-core
- unison-hash
- unison-util
- unison-util-base32hex
- unison-prelude
- time
1 change: 0 additions & 1 deletion codebase2/codebase/unison-codebase.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,5 @@ library
, unison-core
, unison-hash
, unison-prelude
, unison-util
, unison-util-base32hex
default-language: Haskell2010
1 change: 0 additions & 1 deletion codebase2/core/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ dependencies:
- vector
- unison-hash
- unison-prelude
- unison-util
- unison-util-base32hex

default-extensions:
Expand Down
1 change: 0 additions & 1 deletion codebase2/core/unison-core.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ library
, text
, unison-hash
, unison-prelude
, unison-util
, unison-util-base32hex
, vector
default-language: Haskell2010
40 changes: 0 additions & 40 deletions codebase2/util/bench/Main.hs

This file was deleted.

55 changes: 0 additions & 55 deletions codebase2/util/package.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions codebase2/util/src/U/Util/Alternative.hs

This file was deleted.

49 changes: 0 additions & 49 deletions codebase2/util/src/U/Util/Components.hs

This file was deleted.

31 changes: 0 additions & 31 deletions codebase2/util/src/U/Util/Monoid.hs

This file was deleted.

7 changes: 0 additions & 7 deletions codebase2/util/src/U/Util/String.hs

This file was deleted.

12 changes: 6 additions & 6 deletions hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ cradle:
- path: "codebase2/core/./"
component: "unison-core:lib"

- path: "codebase2/util/src"
component: "unison-util:lib"

- path: "codebase2/util/bench/Main.hs"
component: "unison-util:bench:bench"

- path: "codebase2/util-serialization/./"
component: "unison-util-serialization:lib"

Expand Down Expand Up @@ -63,6 +57,12 @@ cradle:
- path: "lib/unison-util-bytes/test"
component: "unison-util-bytes:test:util-bytes-tests"

- path: "lib/unison-util-cache/src"
component: "unison-util-cache:lib"

- path: "lib/unison-util-cache/test"
component: "unison-util-cache:test:util-cache-tests"

- path: "lib/unison-util-relation/src"
component: "unison-util-relation:lib"

Expand Down
9 changes: 6 additions & 3 deletions lib/unison-prelude/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,25 @@ dependencies:
- containers
- either
- extra
- lens
- mtl
- pretty-simple
- safe
- text
- time
- transformers
- lens
- vector
- unliftio
- pretty-simple
- vector
- witherable

ghc-options:
-Wall

default-extensions:
- ApplicativeDo
- BangPatterns
- BlockArguments
- ConstraintKinds
- DeriveFunctor
- DerivingStrategies
- DoAndIfThenElse
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}

module U.Util.Text where
module U.Util.Text
( stripMargin,
)
where

import qualified Data.Char as Char
import Data.Maybe (fromMaybe)
Expand Down
11 changes: 11 additions & 0 deletions lib/unison-prelude/src/Unison/Util/Alternative.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Unison.Util.Alternative
( whenM
) where

import Control.Applicative (Alternative (empty))

whenM :: (Monad m, Alternative m) => m Bool -> a -> m a
whenM m a = do
b <- m
if b then pure a else empty

Loading

0 comments on commit 6e99914

Please sign in to comment.