Skip to content

Use OverloadedLists instead of do notation to concatenate Html #33

Description

@meiersi-da

I removed the Monad instance for the variant of Html which is serializable with embedded event-handler annotations. This currently means that one has to write things like

H.div $ mconcat
  [ H.p $ mconcat ["one", "two", "three"]
  , H.p "another paragraph"
  , H.p "perhaps a footer"
  ]

to concatenate Html. I think it would be worth a try to use OverloadedLists to simplify it to

H.div
  [ H.p ["one", "two", "three"]
  , H.p "another paragraph"
  , H.p "perhaps a footer"
  ]

one possible problem is that this would not play very well with Lucid's Term overloading trick. Moreover, we might be better off anyways by using lucids approach to a HTML EDSL in Haskell; i.e., just use a WriterT Html and overload the different application forms using the Term typeclass.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions