This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0
Dump data structures easily in Elm!
version 1.1.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.1.0
Committed At 2017-07-28 08:57:45 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

Modules

README

Elm Data Dumper

This package provides facilities to dump data structures in HTML. Contrary to Debug.log, which dump everything to the console, Data.Dumper give colors to the output, and format to be easier to read. You just have to code the dumper when making your structure, and yay! You can dump freely data structures in HTML!

An Example?

import Html exposing (Html)

type alias Location =
  { host : String
  , hostname : String
  , protocol : String
  }

type Locations
  = Nowhere
  | Loc Location

dumpLocation : Location -> Html msg
dumpLocation =
  dumpRecord "Location"
    [ ("host", .host >> dumpString)
    , ("hostname", .hostname >> dumpString)
    , ("protocol", .protocol >> dumpString)
    ]

dumpNestedLocation : Location -> Html msg
dumpNestedLocation =
  dumpNestedRecord 1
    [ ("host", .host >> dumpString)
    , ("hostname", .hostname >> dumpString)
    , ("protocol", .protocol >> dumpString)
    ]

dumpLocations : Locations -> Html msg
dumpLocations locations =
  dumpUnion "Locations" <|
    case locations of
      Nowhere ->
        ("Nowhere", Html.text "")
      Loc location ->
        ("Loc", dumpNestedLocation location)

main : Html msg
main =
  let example = Location "host_" "hostname_" "protocol_" in
  Html.div []
    [ dumpLocation example
    , dumpLocations Nowhere
    , dumpLocations <| Loc example
    ]

Turn into this:

Formatted text in HTML