haskell-nix/hnix

Get string coercions right

开放

#245 创建于 2018年4月28日

 (2 条评论) (0 个反应) (1 位负责人)Nix (116 个派生)github user discovery
easy with C++ knowledgegood first issuehelp wanted

仓库指标

星标
 (835 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

According to @shlevy , there are 2 axes of string coercion:

  • coerceToString + coerceMore: Do I coerce integers? Do I recurse into lists?
  • addToStore: If coercing a path, do I just convert it into a string, or add it to the store?

There are several string coercion contexts:

  • toString: coerceMore = true, addToStore = false
  • ${: coerceMore = false, addToStore = true
  • derivation argument: coerceMore = true, addToStore = true
  • implicit coercion: coerceMore = false, addToStore = false
  • forceString: it simply must be a string and nothing else

Shea will double check this.

According to these criteria, we are getting this wrong on toString right now.

贡献者指南