elm-lang / elm-make

A build tool for Elm projects
BSD 3-Clause "New" or "Revised" License
175 stars 45 forks source link

Possible compiler error. #86

Closed camerow closed 8 years ago

camerow commented 8 years ago

Edit: Ok, I totally see that this is my mistake and I'm just a filthy noob. Maybe it's just the English major in me, but that error doesn't read like the other errors I've encountered. Nothing to see here, move along.

Just browsing a couple similar issues, I think my code may be hitting a bug. Granted I am very new to this and may just be ignorant of a mistake I'm making. Here's my code and the error thrown:

import Graphics.Element exposing (show)

add : Int Int -> Int
add a b=
  a +b

main =
  show (add 2 3)

Error:

-- TYPE MISMATCH -------------------------------------------------- practice.elm

The 1st argument to function `add` is causing a mismatch.

8│         add 2 3)
               ^
Function `add` is expecting the 1st argument to be:

    elm-make: type applications should start with a type atom

I just started learning this week, so the elem-make: type... may actually be the error I'm looking for (Jedi hand wave).

camerow commented 8 years ago

I do see that Int Int -> Int, specifically the Int Int is not a type atom, maybe I am just expecting this error to be a bit more "human readable" like so many of the other errors. Maybe less bug, more inconsistency in message delivery?