miyamoen / bibliopola / Bibliopola.Story

This sub pacckage help to build Story.

build : String -> (a -> String) -> List a -> Bibliopola.Story a

Build Story.

|> addStory (Story.build "name" identity [ "spam", "egg", "ham" ])

First argument is label of story. Second is toString function that make label of option. Last is options of argument of view.

To build Story, use this or Story constructor directly.

addOption : String -> a -> Bibliopola.Story a -> Bibliopola.Story a

Add new option to a story.

Add head of options.

|> addStory
    (Story "label" labels
        |> Story.map Just
        |> Story.addOption "nothing" Nothing
    )

map : (a -> b) -> Bibliopola.Story a -> Bibliopola.Story b

Transform Story a to Story b.

Helper

bool : String -> Bibliopola.Story Basics.Bool

bool label =
    { label = label
    , options = [ ( "true", True ), ( "false", False ) ]
    }