dhall-haskell/dhall/tests/normalization/success/remoteSystemsA.dhall
Gabriel Gonzalez abdd442814
Restore Parent constructor for Local (#718)
This is essentially a revert of 25d86e8e5d

The primary motivation for this is so that paths beginning with `../`
don't get reformatted to begin `./../`.

The secondary motivation for this is to more closely match the standard.
There are fewer special cases in the logic if there is a dedicated
constructor for the `Parent` case.
2018-11-28 19:30:38 -08:00

53 lines
1.3 KiB
Plaintext

let Text/concatMap = (../../../Prelude/package.dhall).`Text`.concatMap
let Text/concatSep = (../../../Prelude/package.dhall).`Text`.concatSep
let Row =
{ cores :
Natural
, host :
Text
, key :
Text
, mandatoryFeatures :
List Text
, platforms :
List Text
, speedFactor :
Natural
, supportedFeatures :
List Text
, user :
Optional Text
}
let renderRow =
λ ( row
: Row
)
→ let host =
Optional/fold
Text
row.user
Text
(λ(user : Text) → "${user}@${row.host}")
row.host
let platforms = Text/concatSep "," row.platforms
let key = row.key
let cores = Integer/show (Natural/toInteger row.cores)
let speedFactor = Integer/show (Natural/toInteger row.speedFactor)
let supportedFeatures = Text/concatSep "," row.supportedFeatures
let mandatoryFeatures = Text/concatSep "," row.mandatoryFeatures
in ''
${host} ${platforms} ${key} ${cores} ${speedFactor} ${supportedFeatures} ${mandatoryFeatures}
''
in Text/concatMap Row renderRow