feat: figured out starmelon needs expr types
To generate partial application boxed closures I need to know the arity of the expression to tell if more args will remain after the given args. Right now I think I can recalculate the types if I have a symbol table where I can look up every variable. I think this will be a lot of work because I have to reimplement most of unification to deal with collections, patterns, and type variables. And I currently don't know how unification works.
This commit is contained in:
parent
2f335b02ae
commit
2e78b33524
4 changed files with 223 additions and 31 deletions
|
|
@ -1,4 +1,4 @@
|
|||
module Main exposing (view, view2, view3, view4, view5, badReturnType, true)
|
||||
module Main exposing (view, view2, view3, view4, view5, view6, view7, view8, badReturnType, true)
|
||||
|
||||
import Html exposing (Html, div, text)
|
||||
import Svg exposing (Svg, svg)
|
||||
|
|
@ -50,10 +50,27 @@ view5 { x } =
|
|||
div []
|
||||
[ text x ]
|
||||
|
||||
view6 : String -> Html msg
|
||||
view6 model =
|
||||
let
|
||||
f = div []
|
||||
in
|
||||
f [ text model ]
|
||||
|
||||
view7 : String -> Html msg
|
||||
view7 model =
|
||||
(if True then div [] else div []) [ text model ]
|
||||
|
||||
view8 : String -> Html msg
|
||||
view8 model =
|
||||
privateFunction [] []
|
||||
|
||||
badReturnType : String -> Int
|
||||
badReturnType _ =
|
||||
42
|
||||
|
||||
privateFunction = div
|
||||
|
||||
true : Bool
|
||||
true =
|
||||
True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue