Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 743 Bytes

FP.md

File metadata and controls

31 lines (24 loc) · 743 Bytes

title: Functional Programming toc: no ...

Functional Programming

I (/who/astynax) like FP: /Haskell, /Elm, /Clojure, /Racket, maybe some /Elixir. That's why our Wiki is running on /gitit!

It can be a piece of math

-- | An infinite sequence of Fibonacci numbers
fibs = 1 : 1 : zipWith (+) fibs (tail fibs)

Or a Web App

main = Browser.sandbox
    { init = 0
    , update = always
    , view = \v -> Html.div []
        [ Html.button [ onClick <| v + 1 ] [ text "+" ]
        , text <| String.fromInt v
        , Html.button [ onClick <| v - 1 ] [ text "-" ]
        ]
    }

But it always fun! Functional Programing forever!