Skip to content

Commit

Permalink
quasar: Rename Resource modules to Disposer
Browse files Browse the repository at this point in the history
  • Loading branch information
queezle42 committed Jun 13, 2024
1 parent 70f58e3 commit 15985f7
Show file tree
Hide file tree
Showing 22 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion quasar-network/src/Quasar/Network/Runtime/Observable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Control.Monad.Catch
import Data.Binary (Binary)
import Data.Map.Strict (Map)
import Quasar.Async
import Quasar.Disposer
import Quasar.Exceptions
import Quasar.MonadQuasar
import Quasar.MonadQuasar.Misc
Expand All @@ -22,7 +23,6 @@ import Quasar.Observable.Map
import Quasar.Observable.Subject
import Quasar.Observable.Traversable
import Quasar.Prelude
import Quasar.Resources


-- * ObservableT instance
Expand Down
2 changes: 1 addition & 1 deletion quasar-timer/src/Quasar/Timer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import Control.Monad.Catch
import Data.Heap
import Data.Time.Clock (UTCTime, diffUTCTime, getCurrentTime)
import Quasar.Async
import Quasar.Disposer
import Quasar.Exceptions
import Quasar.Future
import Quasar.MonadQuasar
import Quasar.Prelude
import Quasar.Resources


data TimerCancelled = TimerCancelled
Expand Down
4 changes: 2 additions & 2 deletions quasar-timer/src/Quasar/Timer/PosixTimer.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ module Quasar.Timer.PosixTimer (
import Control.Concurrent
import Foreign
import Foreign.C
import Quasar.Prelude
import Quasar.Disposer
import Quasar.MonadQuasar
import Quasar.Resources
import Quasar.Prelude
import System.Posix.Types

#include <signal.h>
Expand Down
4 changes: 2 additions & 2 deletions quasar-timer/src/Quasar/Timer/TimerFd.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import Control.Concurrent
import Control.Monad.Catch
import Foreign
import Foreign.C
import Quasar.Future
import Quasar.Async
import Quasar.Disposer
import Quasar.Future
import Quasar.MonadQuasar
import Quasar.Prelude
import Quasar.Resources
import Quasar.Timer.PosixTimer
import System.Posix.Types

Expand Down
2 changes: 1 addition & 1 deletion quasar-web/src/Quasar/Web.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import Data.Sequence (Seq)
import Data.Sequence qualified as Seq
import Data.String (IsString(..))
import Data.Text (Text)
import Quasar.Disposer (TDisposer, isTrivialTDisposer, disposeTDisposer)
import Quasar.Observable.AccumulatingObserver
import Quasar.Observable.Core
import Quasar.Observable.List (ListOperation(..), ObservableList, updateToOperations)
Expand All @@ -38,7 +39,6 @@ import Quasar.Observable.Map (ObservableMap)
import Quasar.Observable.Map qualified as ObservableMap
import Quasar.Observable.Traversable
import Quasar.Prelude
import Quasar.Resources (TDisposer, isTrivialTDisposer, disposeTDisposer)

type ComponentRef = Word64

Expand Down
10 changes: 5 additions & 5 deletions quasar/quasar.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ library
Quasar
Quasar.Async
Quasar.Async.Fork
Quasar.Disposer
Quasar.Disposer.DisposableVar
Quasar.Disposer.Rc
Quasar.Exceptions
Quasar.Exceptions.ExceptionSink
Quasar.Future
Expand All @@ -85,9 +88,6 @@ library
Quasar.Pool
Quasar.Prelude
Quasar.PreludeExtras
Quasar.Resources
Quasar.Resources.DisposableVar
Quasar.Resources.Rc
Quasar.Utils.CallbackRegistry
Quasar.Utils.Exceptions
Quasar.Utils.ExtraT
Expand All @@ -98,7 +98,7 @@ library
Quasar.Utils.TOnce
other-modules:
Quasar.Disposer.Core
Quasar.Resources.FutureDisposer
Quasar.Disposer.FutureDisposer
hs-source-dirs:
src

Expand All @@ -120,13 +120,13 @@ test-suite quasar-test
main-is: Spec.hs
other-modules:
Quasar.AsyncSpec
Quasar.DisposerSpec
Quasar.FutureSpec
Quasar.Observable.BindSpec
Quasar.Observable.LiftSpec
Quasar.Observable.ListSpec
Quasar.Observable.ObservableVarSpec
Quasar.ObservableSpec
Quasar.ResourcesSpec
Quasar.Utils.ReaderLockSpec
hs-source-dirs:
test
4 changes: 2 additions & 2 deletions quasar/src/Quasar.hs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module Quasar (
module Quasar.Async,
module Quasar.Disposer,
module Quasar.Future,
module Quasar.Logger,
module Quasar.MonadQuasar,
module Quasar.MonadQuasar.Misc,
--module Quasar.Observable,
module Quasar.Resources,
) where

import Quasar.Async
import Quasar.Disposer
import Quasar.Future
import Quasar.Logger
import Quasar.MonadQuasar
import Quasar.MonadQuasar.Misc
--import Quasar.Observable
import Quasar.Resources
2 changes: 1 addition & 1 deletion quasar/src/Quasar/Async.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ import Control.Exception (throwTo)
import Control.Monad.Catch
import GHC.Stack (withFrozenCallStack)
import Quasar.Async.Fork
import Quasar.Disposer
import Quasar.Exceptions
import Quasar.Future
import Quasar.MonadQuasar
import Quasar.Prelude
import Quasar.Resources
import Quasar.Utils.Fix


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Quasar.Resources (
module Quasar.Disposer (
-- * Resources
Disposable(..),
dispose,
Expand Down Expand Up @@ -76,7 +76,7 @@ import Quasar.Exceptions
import Quasar.Future
import Quasar.MonadQuasar
import Quasar.Prelude
import Quasar.Resources.FutureDisposer
import Quasar.Disposer.FutureDisposer


registerDisposeAction :: HasCallStack => (MonadQuasar m, MonadSTMc NoRetry '[FailedToAttachResource] m) => IO () -> m Disposer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Quasar.Resources.DisposableVar (
module Quasar.Disposer.DisposableVar (
DisposableVar,
newDisposableVar,
newDisposableVarIO,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Quasar.Resources.FutureDisposer (
module Quasar.Disposer.FutureDisposer (
futureDisposer,
futureDisposerGeneric,
) where
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Quasar.Resources.Rc (
module Quasar.Disposer.Rc (
Rc,
newRc,
newRcIO,
Expand All @@ -13,8 +13,8 @@ module Quasar.Resources.Rc (
) where

import Quasar.Prelude
import Quasar.Resources
import Quasar.Resources.DisposableVar
import Quasar.Disposer
import Quasar.Disposer.DisposableVar
import Quasar.Exceptions (mkDisposedException, DisposedException(..))
import Control.Exception (finally)

Expand Down
4 changes: 2 additions & 2 deletions quasar/src/Quasar/MonadQuasar/Misc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ module Quasar.MonadQuasar.Misc (
import Control.Monad.Catch
import Control.Monad.Reader
import Data.List.NonEmpty
import Quasar.Future
import Quasar.Async
import Quasar.Disposer
import Quasar.Exceptions
import Quasar.Exceptions.ExceptionSink
import Quasar.Future
import Quasar.MonadQuasar
import Quasar.Prelude
import Quasar.Resources
import Quasar.Utils.Exceptions
import System.Exit

Expand Down
2 changes: 1 addition & 1 deletion quasar/src/Quasar/Observable/AccumulatingObserver.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ module Quasar.Observable.AccumulatingObserver (
disposeAccumulatingObserver,
) where

import Quasar.Disposer
import Quasar.Observable.Core
import Quasar.Prelude
import Quasar.Resources
import Quasar.Utils.Fix (mfixTVar)

data AccumulatingObserver canLoad exceptions c v =
Expand Down
2 changes: 1 addition & 1 deletion quasar/src/Quasar/Observable/Cache.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module Quasar.Observable.Cache (

import Control.Applicative
import Data.Functor.Identity
import Quasar.Disposer
import Quasar.Observable.Core
import Quasar.Prelude
import Quasar.Resources
import Quasar.Utils.CallbackRegistry

-- * Cache
Expand Down
2 changes: 1 addition & 1 deletion quasar/src/Quasar/Observable/Core.hs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ import Data.Binary (Binary)
import Data.String (IsString(..))
import Data.Type.Equality ((:~:)(Refl))
import GHC.Records (HasField(..))
import Quasar.Disposer
import Quasar.Future
import Quasar.Prelude
import Quasar.Resources
import Quasar.Utils.Fix

-- * Generalized observables
Expand Down
2 changes: 1 addition & 1 deletion quasar/src/Quasar/Observable/List.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ import Data.FingerTree qualified as FT
import Data.Sequence (Seq(Empty))
import Data.Sequence qualified as Seq
import Data.Traversable qualified as Traversable
import Quasar.Disposer (TDisposer)
import Quasar.Observable.Cache
import Quasar.Observable.Core
import Quasar.Observable.Subject
import Quasar.Observable.Traversable
import Quasar.Prelude hiding (traverse)
import Quasar.Resources (TDisposer)


newtype ListDelta v
Expand Down
2 changes: 1 addition & 1 deletion quasar/src/Quasar/Observable/Map.hs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ import Data.Sequence (Seq)
import Data.Sequence qualified as Seq
import Data.Traversable qualified as Traversable
import GHC.Records (HasField (..))
import Quasar.Disposer
import Quasar.Observable.Cache
import Quasar.Observable.Core
import Quasar.Observable.Lift
Expand All @@ -92,7 +93,6 @@ import Quasar.Observable.List qualified as ObservableList
import Quasar.Observable.Subject
import Quasar.Observable.Traversable
import Quasar.Prelude hiding (filter, lookup, traverse)
import Quasar.Resources
import Quasar.Utils.Map qualified as MapUtils


Expand Down
4 changes: 2 additions & 2 deletions quasar/src/Quasar/Observable/Traversable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ module Quasar.Observable.Traversable (
) where

import Control.Applicative hiding (empty)
import Data.Traversable (for)
import Quasar.Disposer
import Quasar.Observable.Core
import Quasar.Prelude hiding (filter, lookup)
import Quasar.Resources
import Quasar.Utils.Fix
import Data.Traversable (for)


-- * Selecting removals from a delta
Expand Down
2 changes: 1 addition & 1 deletion quasar/src/Quasar/Pool.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ module Quasar.Pool (

import Control.Monad.Catch (handleAll, mask_)
import Quasar.Async (unmanagedAsync)
import Quasar.Disposer
import Quasar.Exceptions (ExceptionSink, throwToExceptionSinkIO)
import Quasar.Observable.Core
import Quasar.Observable.List (ObservableList)
import Quasar.Observable.Map (ObservableMapVar, toObservableMap)
import Quasar.Observable.Map qualified as ObservableMap
import Quasar.Prelude
import Quasar.Resources


-- TODO rename
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module Quasar.ResourcesSpec (spec) where
module Quasar.DisposerSpec (spec) where

import Control.Concurrent
import Control.Exception
import Control.Monad.Catch
import Quasar.Disposer
import Quasar.Exceptions
import Quasar.Exceptions.ExceptionSink
import Quasar.Future
import Quasar.Prelude
import Quasar.Resources
import Quasar.Utils.Exceptions
import Test.Hspec

Expand Down
2 changes: 1 addition & 1 deletion quasar/test/Quasar/Observable/BindSpec.hs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Quasar.Observable.BindSpec (spec) where

import Quasar.Disposer (dispose)
import Quasar.Observable.Core
import Quasar.Observable.ObservableVar
import Quasar.Prelude
import Quasar.Resources (dispose)
import Test.Hspec

spec :: Spec
Expand Down

0 comments on commit 15985f7

Please sign in to comment.