You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fanOut model =let
step :(a,Int)
step =( model ,3)in5
Deleting the let type annotation, or adding one to the function causes it to work. (In the latter case, it works whether or not the let has a type annotation.
Error text:
elm-make IVFlat/Generic/TEA.elm
[ ] - 0 / 1elm-make: It looks like something went wrong with the type inference algorithm.
Unable to generalize a type variable. It is not unranked.
Elm 0.18, Mac OSX 10.11.6
For reference, the above code was binary-chopped down from this:
importTupletype alias Return msg model =(model,Cmd msg)type alias Unbatched msg model =(model,List(Cmd msg))type alias FieldUpdater msg field = msg -> field ->Return msg field
type alias Lens field model =( model -> field, field -> model -> model )-- fanOut : msg -> model -> FieldUpdater msg field -> List (Lens field model)-- -> Return msg modelfanOut msg originalModel update accessors =let
step :Lens field model ->Unbatched msg model ->Unbatched msg model
step (getter, setter)(changingModel, cmdList)=let (newPart, newCmd)= update msg (getter originalModel)in( setter newPart changingModel
, newCmd :: cmdList
)in
accessors
|>List.foldl step (originalModel,[])|>Tuple.mapSecond Cmd.batch
The text was updated successfully, but these errors were encountered:
evancz
changed the title
"Unable to generalize a type error" example : involving tuples, let type annotation
crash when unannotated definition has type variable in sub-annotation
Mar 6, 2018
Here is an example:
Deleting the
let
type annotation, or adding one to the function causes it to work. (In the latter case, it works whether or not thelet
has a type annotation.Error text:
Elm 0.18, Mac OSX 10.11.6
For reference, the above code was binary-chopped down from this:
The text was updated successfully, but these errors were encountered: