kraklin / elm-debug-parser / DebugParser.ElmValue


type ElmValue
    = Plain PlainValue
    | Expandable Basics.Bool ExpandableValue

Elm values that are parsed can be either plain values like Strings and Bools, or they can be expandable values like Records, Dicts etc.

Expandable values has bool as their first parameter, which is used to indicate whether they are expanded or collapsed. This is used in UI to show either the short version of the expandable value or the full, expanded one. It is part of the parsed type because performance of adding it later on large models is really costly. This might change in the upcoming versions of this parser.


type ExpandableValue
    = ElmSequence SequenceType (List ElmValue)
    | ElmType String (List ElmValue)
    | ElmRecord (List ( String, ElmValue ))
    | ElmDict (List ( ElmValue, ElmValue ))

Expandable values


type PlainValue
    = ElmString String
    | ElmChar Char
    | ElmNumber Basics.Float
    | ElmBool Basics.Bool
    | ElmFunction
    | ElmInternals
    | ElmUnit
    | ElmFile String
    | ElmBytes Basics.Int

Plain values


type SequenceType
    = SeqSet
    | SeqList
    | SeqArray
    | SeqTuple

Sequence type

All List-like structures are the same, so we parsed them into ElmSequence type. However we would like to keep the information about which type the sequence was.

toggle : ElmValue -> ElmValue

Toggle isExpanded flag for ExpandableValue

hasNestedValues : ElmValue -> Basics.Bool

Determines whether value has any nested childrens.