halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

Lift to let on lambdas should convert to normal functions #63

Open gampleman opened 7 years ago

gampleman commented 7 years ago

Given:

example xs =
    List.map (\a -> a * 2) xs

when doing a lift to let on the lambda this currently results in

example xs =
    let
        var =
            (\a -> a * 2)
    in
        List.map var xs

but this would be preferable:

example xs =
    let
        fn a =
            a * 2
    in
        List.map fn xs