Skip to content

Working code examples required #1

@peterrenshaw

Description

@peterrenshaw

Working code examples required

Fistly this is a great read and "Thinking Algebraiclly WIth Elm" only decent text I've found on GraphicSVG and Elm .

I have found a problem with the code examples, (no import statements) I understand why, page space is limited. This does nothing for the reader. Do you think a future link to working code will be included?

What I found
Going through the examples in Ch5 and even the simplest of examples at P31 require you to understand and dig through the APIs to work out the import statements.

So instead of:

 -- CH5, P30 
 main = graphicsApp { view = view }
 view = collage 300 300 []

readers need the following:

-- CH5, P30 working example
module Main exposing (main)

import GraphicSVG exposing (circle, collage, filled, red, scale)
import GraphicSVG.App exposing (graphicsApp)



-- MAIN


main =
    graphicsApp { view = view }



-- VIEW


view =
    collage 300
        300
        [ circle 25
            |> filled red
        ]

I've left the spacing in using elm-format to give you an idea of how the formatter displays the code. Working code examples help. Code comprehension and presentation go hand in hand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions