-
Notifications
You must be signed in to change notification settings - Fork 669
Closed
Description
Doing the following produce an infinite type error.
I think we could have a much better type error for this case
import Maybe
import List
type alias Tile = { value: Int }
addTileToList: Tile -> Maybe (List Tile) -> Maybe (List Tile)
addTileToList tile value =
case value of
Nothing -> Just [tile]
Just a -> Just (a ++ tile)To solve this, the second advice the the infinite type wiki page help.
We just need to change this
elm
Just a -> Just (a ++ tile)
For this
Just a -> Just (tile::a)Still it could be possible to give better help for this kind of cases.
Hope this help
Metadata
Metadata
Assignees
Labels
No labels