Commit c1ad4464 authored by Felix Buehler's avatar Felix Buehler
Browse files

lib/trivial: add boolToYesNo

parent e7f33001
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ let
        bitXor
        bitNot
        boolToString
        boolToYesNo
        mergeAttrs
        flip
        defaultTo
+20 −0
Original line number Diff line number Diff line
@@ -240,6 +240,26 @@ in
  */
  boolToString = b: if b then "true" else "false";

  /**
    Converts a boolean to a string.

    This function uses the strings "yes" and "no" to represent
    boolean values.

    # Inputs

    `b`

    : The boolean to convert

    # Type

    ```
    boolToYesNo :: bool -> string
    ```
  */
  boolToYesNo = b: if b then "yes" else "no";

  /**
    Merge two attribute sets shallowly, right side trumps left