about summary refs log tree commit diff
path: root/lib/fixed-points.nix
AgeCommit message (Collapse)AuthorFilesLines
2024-05-17doc: migrate lib.fixedPoints to doc-comment formatJohannes Kirschbauer1-32/+120
2024-02-29lib.fixedPoints: fix rendering of docs for `extends`DS1-7/+6
2024-01-12Merge pull request #248220 from infinisil/document-extendsSilvan Mosberger1-23/+136
Improve the documentation of `lib.extends` and how it relates to overlays
2023-10-31lib/fixed-points.nix: correct typoAlexander Groleau1-1/+1
Corrects a minor typo in the description of `fix`; namely that `fix` allows factoring out syntactic recursion from another function.
2023-10-12lib.fix: Improve doc moreSilvan Mosberger1-14/+24
Done together in and after the docs team meeting Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
2023-09-28lib.fixedPoints.extends: Doc improvementsSilvan Mosberger1-12/+71
Co-Authored-By: Valentin Gagarin <valentin.gagarin@tweag.io>
2023-08-10lib.fixedPoints.extends: Refactor implementation and document argumentsSilvan Mosberger1-1/+14
- Better names: - self -> final - super -> prev - rattrs -> f - f -> overlay - Add documentation to the function arguments - Add some spacing
2023-08-10lib.fixedPoints.extends: Add type and examplesSilvan Mosberger1-0/+20
2023-08-10lib.fixedPoints.extends: Improve documentationSilvan Mosberger1-23/+44
The previous one was unnecessarily confusing.
2023-07-08lib.fix: Improve docRobert Hensing1-9/+49
The original doc did not help with understanding at all, and the wikipedia link was actively harmful.
2023-07-08doc: Render lib.fixedPointsRobert Hensing1-81/+115
2023-01-15lib: make extender available on self-referencesChris Hodapp1-2/+2
2021-08-26lib.compose{Many,}Extensions: Make compatible with nix flake checkShea Levy1-5/+5
2020-11-13lib: Add composeManyExtensionsJoe Hermaszewski1-1/+10
2019-04-17lib.converge: optimiseAlyssa Ross1-3/+6
2018-12-11bundlerEnv: ensure dependencies always includedAlyssa Ross1-0/+10
Suppose I have a Gemfile like this: source "https://rubygems.org" gem "actioncable" gem "websocket-driver", group: :test The gemset.nix generated by Bundix 2.4.1 will set ActionCable's groups to [ "default" ], and websocket-driver's to [ "test" ]. This means that the generated bundlerEnv wouldn't include websocket-driver unless the test group was included, even though it's required by the default group. This is arguably a bug in Bundix (websocket-driver's groups should probably be [ "default" "test" ] or just [ "default" ]), but there's no reason bundlerEnv should omit dependencies even given such an input -- it won't necessarily come from Bundix, and it would be good for bundlerEnv to do the right thing. To fix this, filterGemset is now a recursive function, that adds dependencies of gems in the group to the filtered gemset until it stabilises on the gems that match the required groups, and all of their recursive dependencies.
2018-11-21lib/fixed-points.nix: add an example for extendsEric Wolf1-0/+12
- helped me understand how extends works, hopefully it can help others too
2017-09-29Revert "Merge branch 'improved-make-overridable' of ↵Shea Levy1-30/+4
git://github.com/ElvishJerricco/nixpkgs" This reverts commit c3af1210b4c5d7ef380e75add463b37574fdcc8b, reversing changes made to 49f175cd0c80a39e1d05fc687c4a2a40e0aba58c.
2017-09-28Merge branch 'improved-make-overridable' of ↵Shea Levy1-4/+30
git://github.com/ElvishJerricco/nixpkgs
2017-09-16Convert libs to a fixed-pointGraham Christensen1-0/+1
This does break the API of being able to import any lib file and get its libs, however I'm not sure people did this. I made this while exploring being able to swap out docFn with a stub in #2305, to avoid functor performance problems. I don't know if that is going to move forward (or if it is a problem or not,) but after doing all this work figured I'd put it up anyway :) Two notable advantages to this approach: 1. when a lib inherits another lib's functions, it doesn't automatically get put in to the scope of lib 2. when a lib implements a new obscure functions, it doesn't automatically get put in to the scope of lib Using the test script (later in this commit) I got the following diff on the API: + diff master fixed-lib 11764a11765,11766 > .types.defaultFunctor > .types.defaultTypeMerge 11774a11777,11778 > .types.isOptionType > .types.isType 11781a11786 > .types.mkOptionType 11788a11794 > .types.setType 11795a11802 > .types.types This means that this commit _adds_ to the API, however I can't find a way to fix these last remaining discrepancies. At least none are _removed_. Test script (run with nix-repl in the PATH): #!/bin/sh set -eux repl() { suff=${1:-} echo "(import ./lib)$suff" \ | nix-repl 2>&1 } attrs_to_check() { repl "${1:-}" \ | tr ';' $'\n' \ | grep "\.\.\." \ | cut -d' ' -f2 \ | sed -e "s/^/${1:-}./" \ | sort } summ() { repl "${1:-}" \ | tr ' ' $'\n' \ | sort \ | uniq } deep_summ() { suff="${1:-}" depth="${2:-4}" depth=$((depth - 1)) summ "$suff" for attr in $(attrs_to_check "$suff" | grep -v "types.types"); do if [ $depth -eq 0 ]; then summ "$attr" | sed -e "s/^/$attr./" else deep_summ "$attr" "$depth" | sed -e "s/^/$attr./" fi done } ( cd nixpkgs #git add . #git commit -m "Auto-commit, sorry" || true git checkout fixed-lib deep_summ > ../fixed-lib git checkout master deep_summ > ../master ) if diff master fixed-lib; then echo "SHALLOW MATCH!" fi ( cd nixpkgs git checkout fixed-lib repl .types )
2017-07-14Added `self` views of the interface in `makeExtensibleWithInterface`Will Fancher1-14/+29
Fixing the `overrideScope` in `haskellpackages`.
2017-07-12Added `makeExtensibleWithInterface`Will Fancher1-4/+15
2017-05-29lib: Move fixed-point combinators out of trivialJohn Ericson1-0/+78
Trivia != prelude. This is a better organized and less likely to scare off new contributors.