Functional Programming in js

Hey JSler! I'm currently felt in love with functional programming. I'm working a bit with logprog and haskell and thinking on how to add their strength to js. So I'm wondering how much of your function do have no side effects? I'm currently seeing some strength in pattern matching, lazy evaluation and generic type safety. Implementing lazy evaluation is simple, pattern matching is mostly a question of how to make the code still remain beautiful. So what's really left is type safety. Strict type safety like in java is diving me crazy. But what's about optional generic type-safety. So you can define like "type myFn :: a -> Number -> a" which forces the myFn to get two inputs, the second has to be an number and the return value has to have the type of the first param. I'd like that. Would you like to have a library which would provide optional generic type safety to your code? Would you use it often? Looking forward to your ideas, comments and everything else ;) regards Roland

Join or login to comment.

  • Roland

    @Raphael

    The whole thing was never planed as a meetup. It started as a forum topic, and due to some internal changes on meetup.com it somehow became a meetup.

    May 22, 2013

  • Franz E.

    @Raphael sorry, this special meetup was on the pipe since "November 2010", so the RSVPed piped up over the years. meetups are crowed organized, so well the experience oscillates based on the intersection of "crowed" and "organized".

    (that's by the way one of the reasons if go for a less hippy and more "lets do this, and it's going to happen like this" style for the "last wednesday of every month" viennajs meetups)

    learnings: from now on, if anyone suggest a special meetup under the viennajs-banner they have to guarantee at least one JS talk, need to show some code and any meetup needs to have a date max 2 month in the future)

    1 · May 22, 2013

  • Raphael S.

    was sadly very disappointing for me ... no js talk at all:( ... one haskell talk but nothing related to js in any kind - was expecting a tasty hamburger and got a tofuburger instead ... and the predicted rush wasn't there, 35 RSVPed and just 7 js guys showed up ... strange meetup

    May 22, 2013

  • Alex R.

    It was suddenly replaced with a Haskell talk by Martin.
    The original speaker didn't come ?

    May 21, 2013

  • Clemens H.

    Sorry, I've got to cancel last minute. Hope to make it next time!

    May 21, 2013

  • citykid

    force majeur, still looking for a boat to come over.

    May 21, 2013

  • Franz E.

    hi ho, can't attend this special functional meetup, but hey, check out the may 29th "regular" js meetup at clusterhaus. have fun tonight

    May 21, 2013

  • Robert B.

    will try to pop in

    May 20, 2013

  • Adrian B.

    finally!

    May 15, 2013

  • Lars D

    Hello JS functional programmers, I added a date and venue to the top of this page so that this topic need not languish any longer. Please come next week to the Lambdaheads meeting and bring your talks.

    1 · May 14, 2013

  • Lars D changed the date and time to Tuesday, May 21, 2013 at 8:00 PM

    May 14, 2013

  • Lars D changed the location to Metalab

    May 14, 2013

  • Axel K.

    I'm very interested in this, I've been simulating some functional coding styles in javascript, namely working a lot with immutable objects.

    About type safety, IMHO this isnt a particular trait of functional programming, LISP is dynamically typed like javascript for example. What you are suggesting is contracting, a useful addition if you can turn it off for releases for speed.

    September 11, 2012

    • Michael C.

      ECMA Script 1.8.5 has an Object.create() function which lets you define immutable fields in objects.

      April 21, 2013

  • Roland

    We had a talk about this last time ;-)

    April 14, 2013

  • A former member
    A former member

    Anybody looked into http://www.typescriptlang.org/ interesting idea

    April 14, 2013

  • Harry

    sehr geil! :)

    June 12, 2012

  • Jürgen C.

    Interesting notion, as I am very fond of Haskell as well. I'd suggest to first look what is already out there.
    A quick search revealed: http://www.haskell.org/haskellwiki/The_JavaScript_Problem

    May 25, 2012

  • Roland

    Googles stuff is great, still this is a precompiler. It doesn't give you typesafety, it only goes a bit in that direction and it totally misses generic arguments!

    November 30, 2010

  • Martin S.

    Yeah, go ahead and implement something ;)

    Google has already put a lot of thought into that: http://code.google.com/closure/compiler/docs/js-for-compiler.html

    November 29, 2010

Our Sponsors

  • JetBrains

    2 free WebStorm licenses for two speakers at every monthly meetup

  • karriere.at

    Sponsoring drinks, giveaways and prizes

People in this
Meetup are also in:

Imagine having a community behind you

Get started Learn more
Rafaël

We just grab a coffee and speak French. Some people have been coming every week for months... it creates a kind of warmth to the group.

Rafaël, started French Conversation Group

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy