amenzwa / pfd

This project reimplements in Elm the data structures presented in the book "Purely Functional Data Structures" by Professor Okasaki (1999). Okasaki first published this material in 1996 in his PhD dissertation at CMU. The book provides Standard ML and Haskell implementations.
MIT License
38 stars 1 forks source link

Inner functions support #1

Closed eniac314 closed 1 year ago

eniac314 commented 1 year ago

You said in the readme than elm does not support nested inner functions.

Is this not what you are talking about?

outerfunction : Int -> Int
outerfunction a =
    let
        innerFunction : Int -> Int
        innerFunction b =
            a + b
    in
    innerFunction 3

This is valid elm.

amenzwa commented 1 year ago

This is what I am talking about. I will fix my readme and my PFD code, immediately. I'll notify you once I've completed my mistakes.

Thank you very much for pointing out my mistake. Saying a wrong thing about Elm is the last thing I want to do when I'm trying to promote Elm.

On Tue, 22 Aug 2023 at 11:48, eniac314 @.***> wrote:

You said in the readme than elm does not support nested inner functions.

Is this not what you are talking about?

outerfunction : Int -> Int outerfunction a = let innerFunction : Int -> Int innerFunction b = a + b in innerFunction 3

This is valid elm.

— Reply to this email directly, view it on GitHub https://github.com/amenzwa/pfd/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN2PCZEL6NT2YY7FEZVP63XWTIFRANCNFSM6AAAAAA32EHYJ4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

amenzwa commented 1 year ago

I've removed my mistaken gripe in the README about Elm's lack of inner functions. I'm updating my code, too. Again, thank you.

On Tue, 22 Aug 2023 at 11:48, eniac314 @.***> wrote:

You said in the readme than elm does not support nested inner functions.

Is this not what you are talking about?

outerfunction : Int -> Int outerfunction a = let innerFunction : Int -> Int innerFunction b = a + b in innerFunction 3

This is valid elm.

— Reply to this email directly, view it on GitHub https://github.com/amenzwa/pfd/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN2PCZEL6NT2YY7FEZVP63XWTIFRANCNFSM6AAAAAA32EHYJ4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

eniac314 commented 1 year ago

Great! :)