... This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
... If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.

(.require
 [library
  [lux (.except with)
   [data
    [text
     ["%" \\injection]]
    [collection
     ["[0]" list (.use "[1]#[0]" mix)]]]
   [meta
    [type
     ["[0]" nominal]]]]]
 ["[0]" //
  ["[1][0]" value (.only Value)]
  ["[1][0]" property (.only Property)]])

(nominal.every .public Style
  Text

  (the .public empty
    Style
    (nominal.abstraction ""))

  (the .public (with [property value])
    (for_any (_ brand)
      (-> [(Property brand) (Value brand)]
          (-> Style Style)))
    (|>> nominal.representation
         (%.message (//property.name property) ": " (//value.value value) ";")
         nominal.abstraction))

  (the .public inline
    (-> Style Text)
    (|>> nominal.representation))

  (the .public (style config)
    (-> (List (for_some (_ brand) [(Property brand) (Value brand)]))
        Style)
    (list#mix ..with ..empty config))
  )
