Skip to content

Releases: haskell-nix/hnix

0.13.0.1

11 May 19:44
8aee668
Compare
Choose a tag to compare
  • link Nix.Expr.Types: instance TH.Lift (Fix NExprF): lift: fixing package requirement constains for its compilation

0.13.0

11 May 17:07
Compare
Choose a tag to compare

(diff) 0.13.0 (2021-05-10)

  • Breaking:

    • (link) (link) (link) Nix.Thunk: class MonadThunk t m a | t -> m, t -> a. Class was initially designed with Kleisli arrows (v -> m a) in mind, which where put to have the design open and inviting customization & integration. Those functional arguments are for custom implementation, so which in reality of the project were never used and HNax just "essentially" (simplifying, because pure was mixed with monadic binds to f) was passing pure into them (actually, f <=< pure). These Kliesli functors got arguments sorted properly and were moved to a MonadThunkF class and names gained *F. And MonadThunk now does only what is needed, for example force gets the thunk and computes it. All MonadThunk{,F} functions become with a classic Haskell arguments order, specialized, and got more straigh-forward to understand and use, and so now they tail recurse also.

      Now, for example, instead of force t f use it as v <- force t f =<< force t, or f <=< force.

      tl;dr: results:

      class MonadThunkId m => MonadThunk t m a | t -> m, t -> a where
      
        thunkId  :: t -> ThunkId m
      
        thunk    :: m a -> m t
      
        queryM   :: m a -> t -> m a
        -- old became `queryMF`
      
        force    :: t -> m a
        -- old became `forceF`
      
        forceEff :: t -> m a
        -- old became `forceEffF`
      
        further  :: t -> m t
        -- old became `furtherF`
      
      
      -- | Class of Kleisli functors for easiness of customized implementation developlemnt.
      class MonadThunkF t m a | t -> m, t -> a where
      
        queryMF   :: (a   -> m r) -> m r -> t -> m r
        -- was :: t -> m r -> (a   -> m r) -> m r
      
        forceF    :: (a   -> m r) -> t   -> m r
        -- was :: t   -> (a   -> m r) -> m r
      
        forceEffF :: (a   -> m r) -> t   -> m r
        -- was :: t   -> (a   -> m r) -> m r
      
        furtherF  :: (m a -> m a) -> t   -> m t
        -- was :: t   -> (m a -> m a) -> m t
      
    • (link) (link) (link) (link) (link) Nix.Value.Monad: class MonadValue v m: instances became specialized, Kleisli versions unflipped the arguments of methods into a classical order and moved to the class MonadValueF. As a result, demand now gets optimized by GHC and also tail recurse. Please, use f =<< demand t, or just use demandF, while demandF in fact just kleisli =<< demand t.

      class MonadValue v m where
      
        demand :: v       ->         m v
        -- old became `demandF`
      
        inform :: v -> m v
        -- old became `informF`
      
      
      class MonadValueF v m where
      
        demandF :: (v -> m r) -> v -> m r
        -- was :: v -> (v -> m r) -> m r
      
        informF :: (m v -> m v) -> v -> m v
        -- was :: v -> (m v -> m v) -> m v
    • (link) Nix.Normal: normalizeValue removed first functional argument that was passing the function that did the thunk forcing. Now function provides the thunk forcing. Now to normalize simply use normalizeValue v. Old implementation now is normalizeValueF.

    • (link) Nix.Value.Equal: valueEqM: freed from RankNTypes: forall t f m ..

    • (link) Nix.Strings: all hacky* functions replaced with lawful implemetations, because of that all functions become lawful - dropped the principled suffix from functions:

      • Nix.String:
        hackyGetStringNoContext          ->
             getStringNoContext
        hackyStringIgnoreContext         ->
             stringIgnoreContext
        hackyMakeNixStringWithoutContext ->
             makeNixStringWithoutContext
        
        principledMempty        -> mempty
        principledStringMempty  -> mempty
        principledStringMConcat -> mconcat
        principledStringMappend -> mappend
        
        principledGetContext                        ->
                  getContext
        principledMakeNixString                     ->
                  makeNixString
        principledIntercalateNixStrin               ->
                  intercalateNixString
        principledGetStringNoContext                ->
                  getStringNoContext
        principledStringIgnoreContext               ->
                  stringIgnoreContext
        principledMakeNixStringWithoutContext       ->
                  makeNixStringWithoutContext
        principledMakeNixStringWithSingletonContext ->
                  makeNixStringWithSingletonContext
        principledModifyNixContents                 ->
                  modifyNixContents
    • (link):

      • Data type: MonadFix1T t m: Nix.Standard -> Nix.Utils.Fix1

      • Children found their parents:

        Binary   NAtom :: Nix.Expr.Types -> Nix.Atoms
        FromJSON NAtom :: Nix.Expr.Types -> Nix.Atoms
        ToJSON   NAtom :: Nix.Expr.Types -> Nix.Atoms
        
        Eq1 (NValueF p m)     :: Nix.Value.Equal -> Nix.Value
        
        Eq1 (NValue' t f m a) :: Nix.Value.Equal -> Nix.Value 
        
        HasCitations m v (NValue' t f m a) :: Nix.Pretty -> Nix.Cited
        HasCitations m v (NValue  t f m)   :: Nix.Pretty -> Nix.Cited
        
        when
          (package hashable >= 1.3.1) -- gained instance
          $ Hashable1 NonEmpty:: Nix.Expr.Types -> Void -- please use upstreamed instance
        
        -- | Was upstreamed, released in `ref-tf >= 0.5`.
        MonadAtomicRef   (Fix1T t m) :: Nix.Standard -> Void
        
        MonadRef         (Fix1T t m) :: Nix.Standard -> Nix.Utils.Fix1
        MonadEnv         (Fix1T t m) :: Nix.Standard -> Nix.Effects
        MonadExec        (Fix1T t m) :: Nix.Standard -> Nix.Effects
        MonadHttp        (Fix1T t m) :: Nix.Standard -> Nix.Effects
        MonadInstantiate (Fix1T t m) :: Nix.Standard -> Nix.Effects
        MonadIntrospect  (Fix1T t m) :: Nix.Standard -> Nix.Effects
        MonadPaths       (Fix1T t m) :: Nix.Standard -> Nix.Effects
        MonadPutStr      (Fix1T t m) :: Nix.Standard -> Nix.Effects
        MonadStore       (Fix1T t m) :: Nix.Standard -> Nix.Effects
        MonadFile        (Fix1T t m) :: Nix.Standard -> Nix.Render
        
        MonadEnv         (Fix1 t)    :: Nix.Standard -> Nix.Effects
        MonadExec        (Fix1 t)    :: Nix.Standard -> Nix.Effects
        MonadHttp        (Fix1 t)    :: Nix.Standard -> Nix.Effects
        MonadInstantiate (Fix1 t)    :: Nix.Standard -> Nix.Effects
        MonadIntrospect  (Fix1 t)    :: Nix.Standard -> Nix.Effects
        MonadPaths       (Fix1 t)    :: Nix.Standard -> Nix.Effects
        MonadPutStr      (Fix1 t)    :: Nix.Standard -> Nix.Effects
    • (link) Nix.Value: nvSet{,',P}: got unflipped, now accept source position argument before the value.

    • (link) Nix.Pretty: mkNixDoc: got unflipped.

    • (link) Nix.Value: Data constructor for NValue' t f m a changed (NValue -> NValue').

    • (link) Nix.Parser: Parser: Data type was equivalent to Either, so became a type synonim for Either.

    • (link) Nix.Thunk.Basic: instance MonadThunk (NThunkF m v) m v: queryM: implementation no longer blocks the thunk resource it only reads from.

    • (link): Migrated (String -> Text):

      • Nix.Value: {NValueF, nvBuiltin{,'}, builtin{,2,3}, describeValue}
      • Nix.Eval: MonadNixEval
      • Nix.Render.Frame: render{Expr,Value}
      • Nix.Type: TVar
      • Nix.Thunk: ThunkLoop
      • Nix.Exec: {nvBuiltinP, nixInstantiateExpr, exec}
      • Nix.Effects:
        • class:
          • MonadExec: exec'
          • MonadEnv: getEnvVar
          • MonadInstantiate: instatiateExpr
        • parseStoreResult
      • Nix.Effects.Derivation: renderSymbolic
      • Nix.Lint: {NTypeF, symerr}
  • Additional:

    • (link) cabal.project: freed from the cryptohash-sha512 override, Hackage trustees made a revision.
    • (link) To be more approachable for user understanding, the thunk representation in outputs changed from "<CYCLE>" -> "<expr>".
    • (link) The Nix evaluation cycle representation changed "<CYCLE>" -> "<cycle>".
    • (link) Nix.Expr.Types: added hacky implementation of liftTyped for instance Lift (Fix NExprF).
    • [(link)](https://github.com/...
Read more

pre-0.13.0-2

11 May 16:36
707fca7
Compare
Choose a tag to compare
pre-0.13.0-2 Pre-release
Pre-release
cabal: version: 0.13.0 (#929)

pre-0.13.0-1

11 May 16:27
707fca7
Compare
Choose a tag to compare
pre-0.13.0-1 Pre-release
Pre-release
cabal: version: 0.13.0 (#929)

0.12.0.1

04 Jan 23:43
Compare
Choose a tag to compare
  • fx changelog

0.12.0

04 Jan 23:12
Compare
Choose a tag to compare

(diff) 0.12.0 (2020-01-05)

  • Disclaimer: Current derivationStrict primOp implementation and so every evaluation of a derivation into a store path currently relies on the hnix-store-remote, which for those operations relies on the running nix-daemon, and so operations use/produce effects into the /nix/store. Be cautious - it is effectful.

  • Introduction:

    • New module Nix.Effects.Derivation.
    • Operations on derivations:
      • old got principled implementations.
      • also new operations got introduced.
    • Implementation of the derivationStrict primOp.
  • Breaking:

    • (link) Nix.Effects: class MonadStore got principled implementation.
      • addPath' got principled into addToStore.
      • toFile_ got principled into addTextToStore'.
      • For help & easy migration you may use addPath & toFile_ addTextToStore standalone functions in the module.
    • (link) Nix.Effects.Basic: defaultDerivationStrict got reimplemented & moved into Nix.Effects.Derivation.
    • (link) Nix.Standard: instance for MonadStore (Fix1T t m) got principled accoding to class MonadStore changes.
    • (link) Nix.Fresh.Basic: instance for MonadStore (StdIdT m) got principled.
  • Additional:

    • (link) New module Nix.Effects.Derivation: HNix(0.12.0):Nix.Effects.Derivation documentation.
    • (link) Nix.Convert: Principled NVPath -> NixString coercion.
      • In a form of principled instance FromValue NixString m (NValue' t f m (NValue t f m)).
    • (link) Nix.String: Allow custom computations inside string contexts.
      • By providing runWithStringContext{T,}' methods into the API.
    • (link) Includded support for new base16-bytestring, which advertices 2x-4x speed increase of its operations.
    • (link) Nix.Effects: addPath & toFile_ standalone functions got principled implementation through the internal use of the new MonadStore type class implementation.
    • (link) Nix.Effects: added addTextToStore, parseStoreResult implementations.
    • (link) Nix.Effects: added type synonyms {RecursiveFlag, RepairFlag, StorePathName, FilePathFilter, StorePathSet}.
    • (link) Nix.Exec: Fixed the rendering of internal Frames.
      • Which is an internal mechanism of a project to passing around messages with their context, still to be used internally).
    • (link) HNix / Nix: The library now also uses hnix-store-remote.
    • (link) cabal.project: project uses cryptohash-sha512 override, the hnix-store-core requires it from hnix and uses that override also. Detailed info. We promise to attend to this issue, probably by migrating to cryptonite in the nearest releases.

Future note: The HNix is a big project. During the initial development and currently the API for simplicity exposes allmost all functions, types, etc. Big open API means a big effort to create/maintain a quite noisy changelog and you parsing through it, and also creates a frequent requirements to mark releases as major and bother you due to some type changes in some parts that may not be used or applicable to be public API.

This year the most gracious API clean-up would happen, we would check and keep open what Hackage projects are using from the API, and the other parts would be open on the request by a way of rapid minor releases. That clean-up is also a work toward splitting the project into several packages some time in the future (split would be into something like Expressions, Evaluation, Executable, Extra), which migration also would be done most thoughful and graceful as possible, with as much easiness and automation provided for migration downstream as possible. If all goes as planned - all downstream would need to do is to get and run our script that would migrate our old map of module imports to new ones, and maybe manually add those newly formed packages into .cabal description.

If it is possible, please, try to switch & use the higher-level API functions where it is applicable. Thank you.

pre-0.12.0

01 Jan 17:59
8a6ff07
Compare
Choose a tag to compare
pre-0.12.0 Pre-release
Pre-release
Merge #554: Implementation of derivationStrict primOp & use of the St…

…ore 0.4

Implement derivationStrict primOp

Closes #364

0.11.1

09 Dec 17:17
a326589
Compare
Choose a tag to compare

(diff) 0.11.1 (2020-12-09)

  • Additional:
    • (link) Nix/Builtins: isString fixed - It used to return True for values coercible to string like derivations and paths. It only accepts string values now.
    • (link) Nix/Builtins: substring fixed - Negative lengths used to capture an empty string. Now they capture the whole rmeainder of the string.
    • (link) Nix/Effects: pathExists fixed - Now also works with directories.
    • (link) Nix/Parser: -> is now properly right-associative (was non-associative).
    • (link) Nix/Parser: Nix assert parser (nixAssert function) now accepts top-level Nix format also (which means also accepts all kinds of statements), before that it accepted only regular Nix expressions.
    • (link) Nix/Render: renderLocation now also shows/handles location of errors in raw strings.

0.11.0

02 Nov 17:14
b21bb48
Compare
Choose a tag to compare

(diff) 0.11.0 (2020-11-02)

  • Breaking:

    • (link) Deleted incorrect instance Generic1 NKeyName from module Nix.Expr.Types.
    • (link) Parentheses now are properly included in the location annotation for Nix expressions, change of nixParens in module Nix.Parser essentially results in the change of all module nix* function results, essentially making results of the whole module more proper.
  • Additional:

pre-0.11.0

02 Nov 16:33
9d0adda
Compare
Choose a tag to compare
pre-0.11.0 Pre-release
Pre-release
CHANGELOG.md: add 0.11.0 (#749)