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:
YetAnotherMinion 2021-12-29 14:57:35 +00:00 committed by nobody
commit 2e78b33524
Signed by: GrocerPublishAgent
GPG key ID: D460CD54A9E3AB86
4 changed files with 223 additions and 31 deletions

View file

@ -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