haskell-nix/hnix

Get string coercions right

オープン

#245 opened on 2018/04/28

 (2 件のコメント) (0 件のリアクション) (1 人の担当者)Nix (116 件のフォーク)github user discovery
easy with C++ knowledgegood first issuehelp wanted

Repository metrics

Stars
 (835 個のスター)
PR merge metrics
 (30d に merged 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.

コントリビューターガイド