haskell-nix / hnix-store

Haskell implementation of the Nix store
Apache License 2.0
83 stars 23 forks source link

Move `Recursive` newtype to `core` #238

Closed sorki closed 8 months ago

sorki commented 8 months ago

I've replaced Bool with it in remote but same thing is used by ReadOnlyStore and S3 in #37

For the reference since it will move around

-- | Recursive, used by @addToStore@
newtype Recursive = Recursive { unRecursive :: Bool }
  deriving (Eq, Ord, Show)

addRecursive, addNonRecursive :: Recursive
-- | Add target directory recursively
addRecursive = Recursive True
-- | Add target directory non-recursively
addNonRecursive = Recursive False

Maybe sum type / enum would be even better, draft

data Recursive =
  Recursive_Recursive
  Recursive_NonRecursive

sounds kind-of superfluous and very recursive :upside_down_face:

Also wondering where to put it, considering System.Nix.Store.Types