timjs / elm-collage

Create interactive vector graphics and position them relative to each other
BSD 3-Clause "New" or "Revised" License
58 stars 19 forks source link

Point not exposed by Collage #2

Closed gitLabor8 closed 6 years ago

gitLabor8 commented 6 years ago

I'm getting below error. In your source file you claim to not include constructors, but I do need Point to create Paths.

import Collage exposing (..)

Cannot find variable `Collage.Point`.

102|          (Collage.Point (0, 0))
                 ^^^^^^^^^^^^^
`Collage` does not expose `Point`. 
timjs commented 6 years ago

Point is a type alias, it doesn't need a constructor to be created. Just use (0,0).

The error points out Point is not a variable, that is true. Because it is a type alias you can only use it on the type level, so when giving a type to a function. I.e.:

f : Float → Collage.Point
f x = ( x, x )

Please familiarise yourself with basic Elm language features before opening issues for this repository. Consult the examples and the tutorial on the Elm homepage.