Re: [BFPG] Potential BFPG Topics: We need your help

From: Ben K.
Sent on: Wednesday, June 26, 2013 3:49 PM
Peter & Jed,

I was going to wait till I had a moment to write a proper answer to that question but I'll give you the quick hand wavy one:

In my experience, neither one of those are the best option if you are truly doing FP. If you are doing OO programming in scala then cake pattern has always been simpler for me as it feels nicer to have the injection actually in the type system & compiler rather than having to boot up a DI container and getting a silly error out of it if you've typoed something.

Both using DI containers (ala Spring,Guice) and the Cake Pattern limit your smallest unit of configurable thing to an object; which I'd argue is counterproductive if you want to write truly functional code. If you are functional programming, what you really want in your codebase are functions that can be injected rather than functions that are wrapped up in objects which carry some kind of state. Regardless of whether that state is mutable (as is with setter injection) or immutable (with constructor injection or cake), it makes FP a whole lot harder if you have to load the objects that your functions inhabit into your brain just so that you can reason about how your function behaves.

The reader monad is a way to have functions that are injectable and Tony's paper explains it way better than I can. :)

Cheers,
Ben



On Wednesday, 26 June 2013 at 3:23 PM, Jed Wesley-Smith wrote:

> Have a read up on the Reader monad as an alternative to DI or cake. For instance:
> 
> http://phillyemer...­
> 
> It describes the motivations and usage of it quiete well.
> 
> cheers,
> jed
> 
> 
> 
> On 25 June[masked]:57, Peter Leong <[address removed] (mailto:[address removed])> wrote:
> > Hey Ben,
> > 
> > How about a talk on when and when not use the 'cake pattern'. My co-worker loves it (I think because it is a language construct) but I much prefer dependency injection. Neither of us are terribly experienced in FP/Scala.
> > 
> > Maybe other common pitfalls for Scala newbies? Or is it all just too subjective?
> > 
> > Pete
> > 
> > 
> > On 25/06/13 22:47, Ben Kolera wrote:
> > > Heya Everyone,
> > > 
> > > As discussed at the meetup tonight, there are a lot of new faces popping up at BFPG lately and I'm keen to have some very beginner level talks to help include you all and get you started in the wonderful FP world. Talks like Tony's last talk on folds that explain a common stumbling FP block in a succinct and non-brain-melting way. ;)
> > > 
> > > Thing is that it is very hard to exactly what topics are tripping people up and need explaining, so it is difficult for us as organisers to pick topics out and confidently know it'll make a difference to the group. There are a few things that we can take educated guesses on, but we'd prefer to tailor things to specific needs if we can.
> > > 
> > > So if you have any topics from books, doco or posts that you feel need a bit of extra explaining or common problems you keep hitting in FP that feel unsolvable or ugly then please send them my way. Don't be afraid of the issue being 'too trivial' to ask help for. If you're hitting it, then chances are very high that someone else of our 425 members is having the same issue.
> > > 
> > > If we start getting some common themes we'll start working on talks to help clear them up or at least post some Q&A to the mailing list if we can't get a whole talk out of a topic.
> > > 
> > > 
> > > If you're completely new and don't even know where to start then there are two really good books on pure FP concepts:
> > > 
> > > Haskell: http://learnyouah...­
> > > Scala: http://www.mannin...­
> > > 
> > > If you dig into those you'll probably start having questions really quickly.
> > > 
> > > 
> > > Also, keep in mind that this mailing list and irc.freenode.net#{bf­pg,haskell,scala} (http://irc.freeno...­) are there and completely available to ask questions to if you're stuck on anything. We're here to help and grow pure FP, so don't be afraid to say hello and ask for assistance. :)
> > > 
> > > Cheers,
> > > Ben
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > --
> > > Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed] (mailto:[address removed]))
> > > http://www.meetup...­
> > > This message was sent by Ben Kolera ([address removed] (mailto:[address removed])) from Brisbane Functional Programming Group (BFPG).
> > > To learn more about Ben Kolera, visit his/her member profile: http://www.meetup...­
> > > Set my mailing list to email me
> > > 
> > > As they are sent
> > > http://www.meetup...­
> > > 
> > > In one daily email
> > > http://www.meetup...­
> > > 
> > > Don't send me mailing list messages
> > > http://www.meetup...­
> > > Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed] (mailto:[address removed])
> > 
> > 
> > 
> > 
> > 
> > --
> > Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed] (mailto:[address removed]))
> > http://www.meetup...­
> > This message was sent by Peter Leong ([address removed] (mailto:[address removed])) from Brisbane Functional Programming Group (BFPG).
> > To learn more about Peter Leong, visit his/her member profile: http://www.meetup...­
> > 
> > Set my mailing list to email me
> > 
> > As they are sent
> > http://www.meetup...­
> > 
> > In one daily email
> > http://www.meetup...­
> > 
> > Don't send me mailing list messages
> > http://www.meetup...­
> > Meetup, POB 4668 #37895 NY NY USA 10163 | [address removed] (mailto:[address removed])
> 
> 
> 
> 
> 
> 
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed] (mailto:[address removed]))
> This message was sent by Jed Wesley-Smith ([address removed] (mailto:[address removed])) from Brisbane Functional Programming Group (BFPG) (http://www.meetup...­).
> To learn more about Jed Wesley-Smith, visit his/her member profile (http://www.meetup...­)
> Set my mailing list to email me As they are sent (http://www.meetup...­) | In one daily email (http://www.meetup...­) | Don't send me mailing list messages (http://www.meetup...­) 
> 
> Meetup, POB 4668 #37895 NY NY USA 10163 (#) | [address removed] (mailto:[address removed]) 


Our Sponsors

  • iSeek Communications

    Coverage of the cost of pizza for attendees

  • NICTA

    Venue sponsor, and provides pizzas and drinks for Hack Nights

  • Red Hat

    Venue sponsor

  • Skedulo

    Coverage of the cost of pizza for attendees

People in this
Meetup are also in:

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