# How to conditonally include elements in a list?

**URL:** <https://discourse.elm-lang.org/t/how-to-conditonally-include-elements-in-a-list/6254>\
**Category:** Learn\
**Created:** [September 5, 2020, 4:11am UTC](https://discourse.elm-lang.org/t/how-to-conditonally-include-elements-in-a-list/6254 "2020-09-05T04:11:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![hans-helmut](https://avatars.discourse-cdn.com/v4/letter/h/d9b06d/32.png) [@hans-helmut](https://discourse.elm-lang.org/u/hans-helmut)\
**Post date:** [September 5, 2020, 10:41am UTC](https://discourse.elm-lang.org/t/how-to-conditonally-include-elements-in-a-list/6254/2 "2020-09-05T10:41:10Z")

</div>

By conditional adding empty lists:

```auto
    Canvas.shapes
        [ -- Settings
          Canvas.Settings.Line.lineWidth 5
        , Canvas.Settings.Line.lineCap Canvas.Settings.Line.RoundCap
        , Canvas.Settings.stroke Color.black
        ]
       ( [ -- Shapes
          path ( 2, 297 )
      ]
     ++ 
     if (model.turns > 10 )then
            -- Draw the stand.
            [ lineTo ( 297, 297 )
            , moveTo ( 13, 297 )
            , lineTo ( 13, 3 )
            , lineTo ( 150, 3 )
            , lineTo ( 150, 25 )
            ]
     else
         []
    ++ ...

```

---

_[View the full topic](https://discourse.elm-lang.org/t/how-to-conditonally-include-elements-in-a-list/6254)._
