/hall/hpack/License/conjoin
Copy path to clipboardSource
let P =
https://prelude.dhall-lang.org/v20.1.0/package.dhall sha256:26b0ef498663d269e4dc6a82b0ee289ec565d683ef4c00d0ebdd25333a5a3c98
let License = ./Type
in λ(conjunction : Text) →
λ(transformation : Text → Text) →
λ(expression : List Text) →
let len = List/length Text expression
in P.Optional.map
Text
License
License.Expression
( if Natural/isZero (Natural/subtract 1 len)
then List/head Text expression
else List/fold
Text
expression
(Optional Text)
( λ(head : Text) →
λ(tail : Optional Text) →
Some
( transformation head
++ merge
{ None = ""
, Some =
λ(prevs : Text) →
" " ++ conjunction ++ " " ++ prevs
}
tail
)
)
(None Text)
)
: Optional License