fixup! Render Dhal to init XML, freeze
This commit is contained in:
parent
7b2ca8f3d2
commit
2f2afc88b7
|
@ -1,7 +1,7 @@
|
|||
{ construct =
|
||||
./construct.dhall sha256:cc3743aa1980e8acc2ad09bf24f8de700d7ccaac4e13d23d530834cdb35317f2
|
||||
? ./construct.dhall
|
||||
./construct sha256:cc3743aa1980e8acc2ad09bf24f8de700d7ccaac4e13d23d530834cdb35317f2
|
||||
? ./construct
|
||||
, toXML =
|
||||
./toXML.dhall sha256:4a0beb3ffe7c058359a983d93a2f122823c99bec41f2e8261d15c2bb19c5e598
|
||||
? ./toXML.dhall
|
||||
./toXML sha256:4a0beb3ffe7c058359a983d93a2f122823c99bec41f2e8261d15c2bb19c5e598
|
||||
? ./toXML
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
./Start/package.dhall sha256:96d2dc53d20dedfc47bf225a268a6ec3eb6f2e8deff34198193dfe6636dc4c10
|
||||
? ./Start/package.dhall
|
||||
, toXML =
|
||||
./toXML.dhall sha256:cd1a1e812b0557945964e2881dc33ce2df380ca1f8f7f6ed19696d4a9457f0db
|
||||
? ./toXML.dhall
|
||||
./toXML sha256:cd1a1e812b0557945964e2881dc33ce2df380ca1f8f7f6ed19696d4a9457f0db
|
||||
? ./toXML
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ parent =
|
||||
./parent.dhall sha256:be4b66fbc9ffe2c942efcc4213f5e1bc0968820ad0dfa11c40ad1092cc650940
|
||||
? ./parent.dhall
|
||||
./parent sha256:be4b66fbc9ffe2c942efcc4213f5e1bc0968820ad0dfa11c40ad1092cc650940
|
||||
? ./parent
|
||||
, toXML =
|
||||
./toXML.dhall sha256:fb8c9ce4e5fbd094485a502b9a43cbc8d16f5aab8214cb02f953e50809fed1ce
|
||||
? ./toXML.dhall
|
||||
./toXML sha256:fb8c9ce4e5fbd094485a502b9a43cbc8d16f5aab8214cb02f953e50809fed1ce
|
||||
? ./toXML
|
||||
}
|
||||
|
|
1
dhall/Runtime/Require/Type
Normal file
1
dhall/Runtime/Require/Type
Normal file
|
@ -0,0 +1 @@
|
|||
{ service : Text, label : Optional Text }
|
23
dhall/Runtime/Type
Normal file
23
dhall/Runtime/Type
Normal file
|
@ -0,0 +1,23 @@
|
|||
let XML/Type =
|
||||
../types/XML.dhall sha256:461930f3aab769ba537d1a4fd71f411504b0c8d1c1a78d65177be8ded0df8a5c
|
||||
? ../types/XML.dhall
|
||||
|
||||
let Require/Type =
|
||||
./Require/Type sha256:f2db2f0c00df8aeb48ead61704edae325b0ee475c03b20a097a0c3afb1d13bd5
|
||||
? ./Require/Type
|
||||
|
||||
in { ram :
|
||||
Natural
|
||||
, caps :
|
||||
Natural
|
||||
, binary :
|
||||
Text
|
||||
, provides :
|
||||
List Text
|
||||
, requires :
|
||||
List Require/Type
|
||||
, config :
|
||||
XML/Type
|
||||
, roms :
|
||||
List Text
|
||||
}
|
4
dhall/Runtime/package.dhall
Normal file
4
dhall/Runtime/package.dhall
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ toXML =
|
||||
./toXML sha256:ade06f49eac07ac46b5cf598dba93bd3531bb5b4999598403814889577a140b3
|
||||
? ./toXML
|
||||
}
|
75
dhall/Runtime/toXML
Normal file
75
dhall/Runtime/toXML
Normal file
|
@ -0,0 +1,75 @@
|
|||
let Prelude =
|
||||
./../Prelude.dhall sha256:2acd9f8eae045eae46d8288d76b01678c4ac4883a58eadb6be0da00b3ba590cf
|
||||
? ./../Prelude.dhall
|
||||
|
||||
let types =
|
||||
./../types.dhall sha256:eae1ed33d61769930cf5ec7a73f556d8b11341abb28fe0555652de5d4c2b08d0
|
||||
? ./../types.dhall
|
||||
|
||||
let XML = Prelude.XML
|
||||
|
||||
let List/map = Prelude.List.map
|
||||
|
||||
let renderAttr =
|
||||
λ(key : Text)
|
||||
→ λ(val : Optional Text)
|
||||
→ let render = λ(val : Text) → " ${key}=\"${val}\""
|
||||
|
||||
in Optional/fold Text val Text render ""
|
||||
|
||||
let renderLabel = λ(l : Optional Text) → renderAttr "label" l
|
||||
|
||||
let Attribute = { mapKey : Text, mapValue : Text } : Type
|
||||
|
||||
let requireToXML =
|
||||
λ(require : types.Runtime/Require)
|
||||
→ XML.leaf
|
||||
{ name =
|
||||
require.service
|
||||
, attributes =
|
||||
Optional/fold
|
||||
Text
|
||||
require.label
|
||||
(List Attribute)
|
||||
(λ(label : Text) → [ XML.attribute "label" label ])
|
||||
([] : List Attribute)
|
||||
}
|
||||
|
||||
let requiresToXML =
|
||||
λ(requires : List types.Runtime/Require)
|
||||
→ XML.element
|
||||
{ name =
|
||||
"requires"
|
||||
, attributes =
|
||||
XML.emptyAttributes
|
||||
, content =
|
||||
List/map types.Runtime/Require types.XML requireToXML requires
|
||||
}
|
||||
|
||||
let renderContentRom =
|
||||
λ(x : Text)
|
||||
→ XML.leaf { name = "rom", attributes = [ XML.attribute "label" x ] }
|
||||
|
||||
let renderContent =
|
||||
λ(content : List Text)
|
||||
→ XML.element
|
||||
{ name =
|
||||
"content"
|
||||
, attributes =
|
||||
XML.emptyAttributes
|
||||
, content =
|
||||
List/map Text types.XML renderContentRom content
|
||||
}
|
||||
|
||||
in λ(r : types.Runtime)
|
||||
→ XML.element
|
||||
{ name =
|
||||
"runtime"
|
||||
, attributes =
|
||||
[ XML.attribute "ram" (Natural/show r.ram)
|
||||
, XML.attribute "caps" (Natural/show r.caps)
|
||||
, XML.attribute "binary" r.binary
|
||||
]
|
||||
, content =
|
||||
[ requiresToXML r.requires, renderContent r.roms, r.config ]
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{ service =
|
||||
./service.dhall sha256:59dc16062a765a3b4b3ce9b4d3195c047abb84fcb7cbea54305a8105131e19fc
|
||||
? ./service.dhall
|
||||
./service sha256:59dc16062a765a3b4b3ce9b4d3195c047abb84fcb7cbea54305a8105131e19fc
|
||||
? ./service
|
||||
, toXML =
|
||||
./toXML.dhall sha256:a976836b7b75d20ba80d77afc21659790280e592f0b1fa63278ae0d8399eddab
|
||||
? ./toXML.dhall
|
||||
./toXML sha256:a976836b7b75d20ba80d77afc21659790280e592f0b1fa63278ae0d8399eddab
|
||||
? ./toXML
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{ parent =
|
||||
./parent.dhall sha256:40e4da263e73e11165b4d7ad54289a7622c29ee41fa48f051ec2d7a76023c3ea
|
||||
? ./parent.dhall
|
||||
./parent sha256:40e4da263e73e11165b4d7ad54289a7622c29ee41fa48f051ec2d7a76023c3ea
|
||||
? ./parent
|
||||
, toXML =
|
||||
./toXML.dhall sha256:3f4ac4d53f5cca4d226243f3115fe4170379734df41cb66367415da616d54b28
|
||||
? ./toXML.dhall
|
||||
./toXML sha256:3f4ac4d53f5cca4d226243f3115fe4170379734df41cb66367415da616d54b28
|
||||
? ./toXML
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ let ServiceRoute =
|
|||
let Attribute = { mapKey : Text, mapValue : Text } : Type
|
||||
|
||||
let routeToXML =
|
||||
./../Route/toXML.dhall sha256:fb8c9ce4e5fbd094485a502b9a43cbc8d16f5aab8214cb02f953e50809fed1ce
|
||||
? ./../Route/toXML.dhall
|
||||
./../Route/toXML sha256:fb8c9ce4e5fbd094485a502b9a43cbc8d16f5aab8214cb02f953e50809fed1ce
|
||||
? ./../Route/toXML
|
||||
|
||||
in λ(tuple : ServiceRoute)
|
||||
→ XML.element
|
|
@ -10,6 +10,9 @@
|
|||
, Route =
|
||||
./Route/package.dhall sha256:4af755588833937a6684d1cd4067fc411d0895a397fea735cb8c132f93a1cf59
|
||||
? ./Route/package.dhall
|
||||
, Runtime =
|
||||
./Runtime/package.dhall sha256:5c52b9caf647cc694ffbafaf3586c2f08254a111e7ae812754ea1683c548c98f
|
||||
? ./Runtime/package.dhall
|
||||
, Service =
|
||||
./Service/package.dhall sha256:e8ff53ec81c49b3af7aa6155f8c9e6e18ba38c9d77102d20bc2062daf8ebaa2e
|
||||
? ./Service/package.dhall
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
./Route/Type sha256:4e00e1b80d306011307682479a8dc90fef3b18b22f895cd0adfecf883fb6f952
|
||||
? ./Route/Type
|
||||
, Runtime =
|
||||
./types/Runtime.dhall sha256:9080b7ccb737158393fb93778c2c3f68c7b1003f2ee5cdf1a73046e3ee01c428
|
||||
? ./types/Runtime.dhall
|
||||
./Runtime/Type sha256:9080b7ccb737158393fb93778c2c3f68c7b1003f2ee5cdf1a73046e3ee01c428
|
||||
? ./Runtime/Type
|
||||
, Runtime/Require =
|
||||
./types/Runtime/Require.dhall sha256:f2db2f0c00df8aeb48ead61704edae325b0ee475c03b20a097a0c3afb1d13bd5
|
||||
? ./types/Runtime/Require.dhall
|
||||
./Runtime/Require/Type sha256:f2db2f0c00df8aeb48ead61704edae325b0ee475c03b20a097a0c3afb1d13bd5
|
||||
? ./Runtime/Require/Type
|
||||
, XML =
|
||||
./types/XML.dhall sha256:461930f3aab769ba537d1a4fd71f411504b0c8d1c1a78d65177be8ded0df8a5c
|
||||
? ./types/XML.dhall
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
let XML =
|
||||
./XML.dhall sha256:461930f3aab769ba537d1a4fd71f411504b0c8d1c1a78d65177be8ded0df8a5c
|
||||
? ./XML.dhall
|
||||
|
||||
let Require =
|
||||
./Runtime/Require.dhall sha256:f2db2f0c00df8aeb48ead61704edae325b0ee475c03b20a097a0c3afb1d13bd5
|
||||
? ./Runtime/Require.dhall
|
||||
|
||||
in { ram :
|
||||
Natural
|
||||
, caps :
|
||||
Natural
|
||||
, binary :
|
||||
Text
|
||||
, provides :
|
||||
List Text
|
||||
, requires :
|
||||
List Require
|
||||
, config :
|
||||
XML
|
||||
, roms :
|
||||
List Text
|
||||
}
|
Loading…
Reference in New Issue
Block a user