(diff) 0.17.0
- Additional
- Breaking:
-
Nix.Effect
- (link) MonadStore's addToStore signature changed to
StorePathName -> NarContent -> RecursiveFlag -> RepairFlag -> m (Either ErrorCall StorePath)
with new introduction of NarContent. Which enable us to add byteString as file to Store. It is corresponding to the hnix-store api change.
- (link) MonadStore's addToStore signature changed to
-
Nix.Expr.Types
- (link) The central HNix type
NExprF
changed, theNApp
was moved out ofNBinary
& now aNExprF
constructor of its own, the type signatures were changed accordingly. - (link) project was using
megaparsec
{,Source}Pos
and to use it shipped a lot of orphan instances. To improve the situation & performance (reports #1026, #746) project usesN{,Source}Pos
types, related type signatures were changed accordingly.
- (link) The central HNix type
-
Nix.Value
- (link) Unify builder
mkNV*
andNV*
patterns by bidirectional synonyms, a lot of buildersmkNV*
are removed, and merged toNV*
. e.g. instead of buildermkNVList
,NVList
should be used. - (link) Constraint
NVConstraint f = (Comonad f, Applicative f)
was introduced, in order to unify buildermkNV*
andNV*
patterns.
- (link) Unify builder
-
Nix.Parser
:- (link) rm
OperatorInfo
, usingNOperatorDef
. Number of functions changed signatures accordingly: - In
Nix.Pretty
:NixDoc ann
mkNixDoc
selectOp
hasAttrOp
precedenceWrap
wrapPath
- In
Nix.Parser
:- rm
get{App,Unary,Binary,Special}Operator
, currelyNOp
class instances are used instead.
- rm
- (link) rm
-
Nix.Pretty
:
-
(diff) 0.16.0
On update problems, please reach out to us. For support refere to: #984
Partial log (for now):
-
Breaking:
- Where
coerce
should work, removednewtype
accessors. - (link), (link) Incomprehensible record accessors zoo like:
arg
,options
,unStore
,scFlavor
,nsContext
_provenance
- was organized, now all record accessors start withget*
, and their names tend to have according unique sematic meaning of data action they do. - Builder names got unified. Now they all start with
mk*
. So a lof ofnvSet
becamemkNVSet
. Nix.String
builders/destructors instead ofmake
usemk
, & where mentioning ofstring
is superflous - dropped it from the name, sostringIgnoreContext
, becameignoreContext
.- Type system:
- Things that are paths are now
newtype Path = Path String
. - Things that are indentifier names are now
newtype VarName = VarName Text
. - Function signatures changed accordingly.
- Things that are paths are now
- Where
-
Additional:
-
Other notes:
Shorthands
was kept untouched.
(diff) 0.15.0
For support refere to: #984
Partial log (for now):
-
Breaking:
Nix.Expr.Shorthands
:-
inherit{,From}
:- dropped second(/third) argument as irrelevant (report)
- bindings to inherit changed type from complex
[NKeyName]
(which is for static & dynamic keys) to[VarName]
(VarName
is newtype ofText
). - So examples of use now are:
inherit ["a", "b"]
,inheritFrom (var "a") ["b", "c"]
-
mkAssert
: fixed (report). -
fx presedence between the operators:
(@@), (@.), (@./), ($==), ($!=), ($<), ($<=), ($>), ($>=), ($&&), ($||), ($->), ($//), ($+), ($-), ($*), ($/), ($++), (==>)
Now these shorthands can be used without sectioning & so represent the Nix expressions one to one.
nix = " a/b // c/def // <g> < def/d" hask = mkRelPath "a/b" $// mkRelPath "c/def" $// mkEnvPath "g" $< mkRelPath "def/d"
-
-
Additional
Nix.Expr.Shorthands
:- added:
emptySet
emptyList
mkOp{,2}
mk{,Named,Variadic,General}ParamSet
mkNeg
- number negation.@.<|>
for Nix languages.x or y
expession.
- entered deprecation:
mkOper{,2}
bacamemkOp{,2}
.mkBinop
becamemkOp2
.mkParaset
supeceeded bymk{,Named{,Variadic},Variadic,General}ParamSet
.
- fixed:
mkAssert
was creatingwith
, now properly createsassert
.
- added:
(diff) 0.14.0 (2021-07-08)
-
GHC 9.0 support.
-
HNix switched to pre-0.9 style of log (aka "no log"). We temporarily stopped producing log, choosing effectiveness over writing about it.
-
All changes seem trivial (from the inside). There is no changes in
Nix.Expr.Shorthands
module. Would there be difficulties in migration - please write to us - we would tackle & solve it togather.
A partial log:
-
Breaking:
-
Nix.Effects
:- rm
pathExits
in favour ofdoesPathExist
(inNix.Render
:class MonadFile
:doesPathExist
)
- rm
-
Nix.Var
: was found being superflous (report), so reduced. useControl.Monad.Ref
instead. -
Nix.Normal
- rename
opaque(,->Val)
, indicate that it is a literal.
- rename
-
Nix.Thunk
:class MonadThunkId m => MonadThunk{,F} t m a
:- rename
query(M->){,F}
- rename
-
-
Additional:
-
Nix.Utils
:- added type
TransformF
- added type
-
Nix.Eval
:- added fun:
evalContent
addMetaInfo
- added fun:
-
Nix.Types.Assumption
:- added instances:
Assumption
:{Semigroup,Monoid,One}
- added instances:
-
Nix.Type.Env
:- added instances:
Env
:{Semigroup,Monoid,One}
- added instances:
-
Nix
:- changed argument order:
-
nixEval
:-- was: => Maybe FilePath -> Transform g (m a) -> Alg g (m a) -> Fix g -> m a -- became: => Transform g (m a) -> Alg g (m a) -> Maybe FilePath -> Fix g -> m a
-
- changed argument order:
-
Nix.Normal
- add
thunkVal
literal & use it where appropriate{deThunk, removeEffects}
- add
-
Nix.Thunk.Basic
:- export
deferred
- export
-
(diff) 0.13.1 (2021-05-22)
- (link)
Nix.Parser
:annotateLocation
: Fix source location preservation. - (link) Require Cabal dependency
relude
>= 1.0
: since imports & Cabal file got cleaned-up & that clean-up depends onrelude
reimports introduced in aforementioned version. - Refactors, reorganization in some modules, docs, clean-ups.
(diff) 0.13.0.1 (2021-05-11)
- (link)
Nix.Expr.Types
: Fix CPP onInstances.TH.Lift
import.
(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, becausepure
was mixed with monadic binds tof
) was passingpure
into them (actually,f <=< pure
). These Kliesli functors got arguments sorted properly and were moved to aMonadThunkF
class and names gained*F
. AndMonadThunk
now does only what is needed, for exampleforce
gets the thunk and computes it. AllMonadThunk{,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 asv <- force t
f =<< force t
, orf <=< 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 theclass MonadValueF
. As a result,demand
now gets optimized by GHC and also tail recurse. Please, usef =<< demand t
, or just usedemandF
, whiledemandF
in fact justkleisli =<< 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 usenormalizeValue v
. Old implementation now isnormalizeValueF
. -
(link)
Nix.Value.Equal
:valueEqM
: freed fromRankNTypes: forall t f m .
. -
(link)
Nix.Strings
: allhacky*
functions replaced with lawful implemetations, because of that all functions become lawful - dropped theprincipled
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
-
-
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 (ST s) :: Nix.Standard -> Void MonadAtomicRef (Fix1T t m) :: Nix.Standard -> Nix.Utils.Fix1 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 forNValue' t f m a
changed (NValue -> NValue'
). -
(link)
Nix.Parser
:Parser
: Data type was equivalent toEither
, so became a type synonim forEither
. -
(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 thecryptohash-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 ofliftTyped
forinstance Lift (Fix NExprF)
. - (link)
Nix.Builtins
:derivation
primOp internal code always fully evaluated, so GHC now always ships only fully compiled version in the bytecode. - (link): Project switched to prelude
relude
. - A bunch of other stuff that is not user-facing.
- (link)
(diff) 0.12.0 (2021-01-05)
-
Disclaimer: Current
derivationStrict
primOp implementation and so every evaluation of a derivation into a store path currently relies on thehnix-store-remote
, which for those operations relies on the runningnix-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.
- New module
-
Breaking:
- (link)
Nix.Effects
: classMonadStore
got principled implementation.addPath'
got principled intoaddToStore
.toFile_
got principled intoaddTextToStore'
.- For help & easy migration you may use
addPath
&toFile_
addTextToStore
standalone functions in the module.
- (link)
Nix.Effects.Basic
:defaultDerivationStrict
got reimplemented & moved intoNix.Effects.Derivation
. - (link)
Nix.Standard
: instance forMonadStore (Fix1T t m)
got principled accoding to classMonadStore
changes. - (link)
Nix.Fresh.Basic
: instance forMonadStore (StdIdT m)
got principled.
- (link)
-
Additional:
- (link) New module
Nix.Effects.Derivation
: HNix(0.12.0):Nix.Effects.Derivation documentation. - (link)
Nix.Convert
: PrincipledNVPath -> NixString
coercion.- In a form of principled
instance FromValue NixString m (NValue' t f m (NValue t f m))
.
- In a form of principled
- (link)
Nix.String
: Allow custom computations inside string contexts.- By providing
runWithStringContext{T,}'
methods into the API.
- By providing
- (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 newMonadStore
type class implementation. - (link)
Nix.Effects
: addedaddTextToStore
,parseStoreResult
implementations. - (link)
Nix.Effects
: added type synonyms{RecursiveFlag, RepairFlag, StorePathName, FilePathFilter, StorePathSet}
. - (link)
Nix.Exec
: Fixed the rendering of internalFrames
.- 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 useshnix-store-remote
. - (link)
cabal.project
: project usescryptohash-sha512
override, thehnix-store-core
requires it fromhnix
and uses that override also. Detailed info. We promise to attend to this issue, probably by migrating tocryptonite
in the nearest releases.
- (link) New module
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.
(diff) 0.11.1 (2020-12-09)
- Additional:
- (link)
Nix.Builtins
:isString
fixed - It used to returnTrue
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
: Nixassert
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.
- (link)
(diff) 0.11.0 (2020-11-02)
-
Breaking:
- (link) Deleted incorrect
instance Generic1 NKeyName
frommodule Nix.Expr.Types
. - (link) Parentheses now are properly included in the location annotation for Nix expressions, change of
nixParens
inmodule Nix.Parser
essentially results in the change of all modulenix*
function results, essentially making results of the whole module more proper.
- (link) Deleted incorrect
-
Additional:
- (link) Fix QQ Text lifting error: work around of GHC#12596 "can't find interface-file declaration".
- (link) Fix comments inclusion into location annotations, by using pre-whitespace position for source end locations.
(diff) 0.10.1 (2020-09-13)
- Additional:
- (link)
{Binding, NExpr, NExprF, NKeyName}
gainedOrd1
instances.- These instances were required by downstream projects to be able to use newer HNix.
- (link) CLI gained
--long-version
option for gathering a detailed debug information.- Currently, reports Git commit and its date.
- (link) Currently does not work in case of use of the
nix-build
, in which case simply returnsUNKNOWN
placeholder.
- (link)
(diff) 0.10.0 (2020-09-12)
-
Breaking:
- (link) Removed
NExpr
{FromJSON, ToJSON}
instances.- This also removed the JSON output feature for unevaluated expression trees.
- (link) Removed
-
Additional:
(diff) 0.9.1 (2020-07-13)
- Additional:
- REPL:
- Better tab completion.
- Accepting multi-line input.
- Support for passing evaluated expression result of
hnix --eval -E
. to REPL as aninput
variable. - Support for loading
.hnixrc
from the current directory.
- Reporting of
builtins.nixVersion
bumped from 2.0 to 2.3. - Dependencies:
- Freed from:
{interpolate, contravariant, semigroups, generic-random, tasty-quickcheck}
. - Requires last major
repline
(0.4
).
- Freed from:
- REPL:
(diff) 0.9.0 (2020-06-15)
-
Breaking:
- Removed instances due to migration to
haskeline 0.8
:instance MonadException m => MonadException(StateT(HashMap FilePath NExprLoc) m)
.instance MonadException m => MonadException(Fix1T StandardTF m)
.
- Dependencies:
- Requires last major
haskeline
(0.8
).
- Requires last major
- Removed instances due to migration to
-
Additional:
- Library: Official support for
GHC 8.4 - 8.10
. - Executable complies only under
GHC 8.10
.
- Library: Official support for
-
Changelog started. Previous release was
0.8.0
.
HNix uses PVP Versioning.