Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement all of the builtins actually used by nixpkgs #157

Closed
1 of 15 tasks
jwiegley opened this issue Apr 9, 2018 · 4 comments
Closed
1 of 15 tasks

Implement all of the builtins actually used by nixpkgs #157

jwiegley opened this issue Apr 9, 2018 · 4 comments
Labels
help wanted When someone explicitly requests for help
Milestone

Comments

@jwiegley
Copy link
Member

jwiegley commented Apr 9, 2018

It's possible this may include some features not exercised by the language tests.

The symbolic evaluator should be good example of writing a custom grep-style tool for doing pointed queries like this, since it can take with and let bindings into account.

From @mightybyte: Comparing this with what we have in Builtins.hs, we are missing at least these functions:

  • currentTime
  • div
  • fetchurl
  • filterSource
  • genericClosure
  • hasContext
  • langVersion
  • max
  • min
  • nixPath
  • nixVersion
  • storeDir
  • storePath
  • toFile
  • trace
@jwiegley jwiegley added help wanted When someone explicitly requests for help good first issue Suggested for someone who is not yet familiar with the codebase labels Apr 10, 2018
@mightybyte
Copy link
Member

mightybyte commented Apr 22, 2018

Here are all the unique things matching builtins.\w+ that I found in nixpkgs. This doesn't take with and let bindings into account, but should be a good start.

builtins.add
builtins.all
builtins.any
builtins.attrNames
builtins.attrValues
builtins.baseNameOf
builtins.catAttrs
builtins.compareVersions
builtins.concatLists
builtins.concatStringsSep
builtins.currentSystem
builtins.currentTime
builtins.deepSeq
builtins.div
builtins.elem
builtins.elemAt
builtins.fetchurl
builtins.filter
builtins.filterSource
builtins.foldl'
builtins.fromJSON
builtins.functionArgs
builtins.genList
builtins.genericClosure
builtins.getAttr
builtins.getEnv
builtins.hasAttr
builtins.hasContext
builtins.hashString
builtins.head
builtins.intersectAttrs
builtins.isAttrs
builtins.isBool
builtins.isFunction
builtins.isInt
builtins.isList
builtins.isNull
builtins.isString
builtins.langVersion
builtins.length
builtins.lessThan
builtins.listToAttrs
builtins.map
builtins.match
builtins.max
builtins.min
builtins.nixPath
builtins.nixVersion
builtins.parseDrvName
builtins.partition
builtins.pathExists
builtins.readDir
builtins.readFile
builtins.removeAttrs
builtins.replaceStrings
builtins.seq
builtins.sort
builtins.split
builtins.splitVersion
builtins.storeDir
builtins.storePath
builtins.stringLength
builtins.sub
builtins.substring
builtins.tail
builtins.throw
builtins.toFile
builtins.toJSON
builtins.toPath
builtins.toString
builtins.toXML
builtins.trace
builtins.tryEval
builtins.typeOf
builtins.unsafeDiscardStringContext
builtins.unsafeGetAttrPos

@jwiegley
Copy link
Member Author

Thanks @mightybyte! I've converted your last comment into a work list.

@jwiegley
Copy link
Member Author

I wonder how nixPath differs from __nixPath...

@jwiegley jwiegley changed the title Compile a list of all builtins actually used by nixpkgs Implement all builtins actually used by nixpkgs Apr 23, 2018
@haskell-nix haskell-nix deleted a comment from mightybyte Apr 23, 2018
@jwiegley jwiegley removed the good first issue Suggested for someone who is not yet familiar with the codebase label Apr 23, 2018
@jwiegley jwiegley changed the title Implement all builtins actually used by nixpkgs Implement all of the builtins actually used by nixpkgs Apr 23, 2018
@jwiegley
Copy link
Member Author

These are all broken out into separate issues now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted When someone explicitly requests for help
Projects
None yet
Development

No branches or pull requests

2 participants