-----------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Miso.Mathml.Element
-- Copyright   :  (C) 2016-2026 David M. Johnson
-- License     :  BSD3-style (see the file LICENSE)
-- Maintainer  :  David M. Johnson <code@dmj.io>
-- Stability   :  experimental
-- Portability :  non-portable
--
-- = Overview
--
-- "Miso.Mathml.Element" provides smart constructors for every element in the
-- <https://developer.mozilla.org/en-US/docs/Web/MathML MathML Core>
-- vocabulary. Each constructor produces a 'Miso.Types.View' node in the
-- @MATHML@ namespace:
--
-- @
-- tagName_ :: ['Miso.Types.Attribute' action] -> ['Miso.Types.View' model action] -> 'Miso.Types.View' model action
-- @
--
-- All names are suffixed with @_@. The module is re-exported by "Miso.Mathml".
--
-- = Quick start
--
-- Embed a fraction inside a paragraph using 'Miso.Html.Element.p_' and 'math_':
--
-- @
-- import "Miso"
-- import "Miso.Mathml.Element"
-- import "Miso.Mathml.Property" ('display_')
--
-- formula :: 'Miso.Types.View' model action
-- formula =
--   'Miso.Html.Element.p_' []
--     [ 'math_' [ 'display_' \"block\" ]
--         [ 'mfrac_' []
--             [ 'mn_' [] [ 'Miso.text' \"1\" ]
--             , 'msqrt_' [] [ 'mn_' [] [ 'Miso.text' \"2\" ] ]
--             ]
--         ]
--     ]
-- @
--
-- = Element groups
--
-- * __Top-level__: 'math_'
-- * __Token elements__ (leaves): 'mi_' (identifier), 'mn_' (number),
--   'mo_' (operator), 'ms_' (string literal), 'mtext_', 'mspace_'
-- * __General layout__: 'mrow_', 'mfrac_', 'msqrt_', 'mroot_',
--   'mpadded_', 'mphantom_', 'merror_', 'mstyle_', 'mfenced_'
-- * __Script \& limit__: 'msub_', 'msup_', 'msubsup_',
--   'mover_', 'munder_', 'munderover_', 'mmultiscripts_', 'mprescripts_'
-- * __Tabular__: 'mtable_', 'mtr_', 'mtd_'
-- * __Semantics__: 'semantics_', 'annotation_', 'annotationXml_'
-- * __Custom__: 'nodeMathml' for any MathML tag not listed above
--
-- = See also
--
-- * "Miso.Mathml.Property" — MathML attribute combinators
-- * "Miso.Mathml" — re-export hub for the full MathML DSL
-- * "Miso.Html.Element" — HTML element constructors
-- * "Miso.Svg.Element" — SVG element constructors
-----------------------------------------------------------------------------
module Miso.Mathml.Element
  ( -- ** Combinator
    nodeMathml
   -- ** Elements
  , math_
  , annotationXml_
  , annotation_
  , merror_
  , mfrac_
  , mi_
  , mmultiscripts_
  , mn_
  , mo_
  , mover_
  , mpadded_
  , mphantom_
  , mprescripts_
  , mroot_
  , mrow_
  , ms_
  , mspace_
  , msqrt_
  , mstyle_
  , msub_
  , msubsup_
  , msup_
  , mtable_
  , mtd_
  , mtext_
  , mtr_
  , munder_
  , munderover_
  , semantics_
  , mfenced_
  ) where
-----------------------------------------------------------------------------
import           Miso.Types
-----------------------------------------------------------------------------
-- | Low-level helper used to construct 'MATHML' 'node' in 'Miso.Types.View'.
-- Most View helpers in this module are defined in terms of it.
nodeMathml :: MisoString -> [Attribute action] -> [View model action] -> View model action
nodeMathml :: forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
nodeName = Namespace
-> MisoString
-> [Attribute action]
-> [View model action]
-> View model action
forall action model.
Namespace
-> MisoString
-> [Attribute action]
-> [View model action]
-> View model action
node Namespace
MATHML MisoString
nodeName
-----------------------------------------------------------------------------
-- | [\<annotation-xml\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/annotation-xml)
--
-- @since 1.9.0.0
annotationXml_ :: [Attribute action] -> [View model action] -> View model action
annotationXml_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
annotationXml_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"annotation-xml"
-----------------------------------------------------------------------------
-- | [\<annotation\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/annotation)
--
-- @since 1.9.0.0
annotation_ :: [Attribute action] -> [View model action] -> View model action
annotation_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
annotation_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"annotation"
-----------------------------------------------------------------------------
-- | [\<math\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/math)
--
-- @since 1.9.0.0
math_ :: [Attribute action] -> [View model action] -> View model action
math_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
math_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"math"
-----------------------------------------------------------------------------
-- | [\<merror\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/merror)
--
-- @since 1.9.0.0
merror_ :: [Attribute action] -> [View model action] -> View model action
merror_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
merror_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"merror"
-----------------------------------------------------------------------------
-- | [\<mfrac\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mfrac)
--
-- @since 1.9.0.0
mfrac_ :: [Attribute action] -> [View model action] -> View model action
mfrac_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mfrac_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mfrac"
-----------------------------------------------------------------------------
-- | [\<mi\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mi)
--
-- @since 1.9.0.0
mi_ :: [Attribute action] -> [View model action] -> View model action
mi_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mi_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mi"
-----------------------------------------------------------------------------
-- | [\<mmultiscripts\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mmultiscripts)
--
-- @since 1.9.0.0
mmultiscripts_ :: [Attribute action] -> [View model action] -> View model action
mmultiscripts_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mmultiscripts_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mmultiscripts"
-----------------------------------------------------------------------------
-- | [\<mn\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mn)
--
-- @since 1.9.0.0
mn_ :: [Attribute action] -> [View model action] -> View model action
mn_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mn_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mn"
-----------------------------------------------------------------------------
-- | [\<mo\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mo)
--
-- @since 1.9.0.0
mo_ :: [Attribute action] -> [View model action] -> View model action
mo_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mo_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mo"
-----------------------------------------------------------------------------
-- | [\<mover\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mover)
--
-- @since 1.9.0.0
mover_ :: [Attribute action] -> [View model action] -> View model action
mover_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mover_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mover"
-----------------------------------------------------------------------------
-- | [\<mpadded\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mpadded)
--
-- @since 1.9.0.0
mpadded_ :: [Attribute action] -> [View model action] -> View model action
mpadded_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mpadded_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mpadded"
-----------------------------------------------------------------------------
-- | [\<mphantom\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mphantom)
--
-- @since 1.9.0.0
mphantom_ :: [Attribute action] -> [View model action] -> View model action
mphantom_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mphantom_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mphantom"
-----------------------------------------------------------------------------
-- | [\<mprescripts\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mprescripts)
--
-- @since 1.9.0.0
mprescripts_ :: [Attribute action] -> [View model action] -> View model action
mprescripts_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mprescripts_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mprescripts"
-----------------------------------------------------------------------------
-- | [\<mroot\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mroot)
--
-- @since 1.9.0.0
mroot_ :: [Attribute action] -> [View model action] -> View model action
mroot_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mroot_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mroot"
-----------------------------------------------------------------------------
-- | [\<mrow\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mrow)
--
-- @since 1.9.0.0
mrow_ :: [Attribute action] -> [View model action] -> View model action
mrow_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mrow_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mrow"
-----------------------------------------------------------------------------
-- | [\<ms\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/ms)
--
-- @since 1.9.0.0
ms_ :: [Attribute action] -> [View model action] -> View model action
ms_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
ms_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"ms"
-----------------------------------------------------------------------------
-- | [\<mspace\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mspace)
--
-- @since 1.9.0.0
mspace_ :: [Attribute action] -> [View model action] -> View model action
mspace_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mspace_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mspace"
-----------------------------------------------------------------------------
-- | [\<msqrt\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/msqrt)
--
-- @since 1.9.0.0
msqrt_ :: [Attribute action] -> [View model action] -> View model action
msqrt_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
msqrt_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"msqrt"
-----------------------------------------------------------------------------
-- | [\<mstyle\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mstyle)
--
-- @since 1.9.0.0
mstyle_ :: [Attribute action] -> [View model action] -> View model action
mstyle_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mstyle_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mstyle"
-----------------------------------------------------------------------------
-- | [\<msub\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/msub)
--
-- @since 1.9.0.0
msub_ :: [Attribute action] -> [View model action] -> View model action
msub_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
msub_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"msub"
-----------------------------------------------------------------------------
-- | [\<msubsup\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/msubsup)
--
-- @since 1.9.0.0
msubsup_ :: [Attribute action] -> [View model action] -> View model action
msubsup_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
msubsup_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"msubsup"
-----------------------------------------------------------------------------
-- | [\<msup\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/msup)
--
-- @since 1.9.0.0
msup_ :: [Attribute action] -> [View model action] -> View model action
msup_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
msup_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"msup"
-----------------------------------------------------------------------------
-- | [\<mtable\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mtable)
--
-- @since 1.9.0.0
mtable_ :: [Attribute action] -> [View model action] -> View model action
mtable_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mtable_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mtable"
-----------------------------------------------------------------------------
-- | [\<mtd\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mtd)
--
-- @since 1.9.0.0
mtd_ :: [Attribute action] -> [View model action] -> View model action
mtd_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mtd_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mtd"
-----------------------------------------------------------------------------
-- | [\<mtext\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mtext)
--
-- @since 1.9.0.0
mtext_ :: [Attribute action] -> [View model action] -> View model action
mtext_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mtext_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mtext"
-----------------------------------------------------------------------------
-- | [\<mtr\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mtr)
--
-- @since 1.9.0.0
mtr_ :: [Attribute action] -> [View model action] -> View model action
mtr_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mtr_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mtr"
-----------------------------------------------------------------------------
-- | [\<munder\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/munder)
--
-- @since 1.9.0.0
munder_ :: [Attribute action] -> [View model action] -> View model action
munder_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
munder_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"munder"
-----------------------------------------------------------------------------
-- | [\<munderover\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/munderover)
--
-- @since 1.9.0.0
munderover_ :: [Attribute action] -> [View model action] -> View model action
munderover_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
munderover_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"munderover"
-----------------------------------------------------------------------------
-- | [\<semantics\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/semantics)
--
-- @since 1.9.0.0
semantics_ :: [Attribute action] -> [View model action] -> View model action
semantics_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
semantics_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"semantics"
-----------------------------------------------------------------------------
-- | [\<semantics\>](https://developer.mozilla.org/en-US/docs/Web/MathML/Reference/Element/mfenced)
--
-- @since 1.9.0.0
mfenced_ :: [Attribute action] -> [View model action] -> View model action
mfenced_ :: forall action model.
[Attribute action] -> [View model action] -> View model action
mfenced_ = MisoString
-> [Attribute action] -> [View model action] -> View model action
forall action model.
MisoString
-> [Attribute action] -> [View model action] -> View model action
nodeMathml MisoString
"mfenced"
-----------------------------------------------------------------------------