On Tuesday, 12 April 2016 22:28:57 UTC+1, Lee Hambley wrote: > Hi Rick, > > Unfortunately I can't attend but I'm far from the only person in my own peer > group who's tried and failed to become interested in FP because of a lack of > focus in most textbooks on mundane things such as IO, text and string > manipulation and the likes.
Hi Lee, I'm not sure that's really true of FP. Firstly FP is far broader than just Haskell (and its children), for example Clojure, Lisp/Scheme/Racket, OCaml are almost universally considered functional languages - even though they don't force purity through the type system. These languages can all be picked up pretty quickly, and their communities don't avoid discussing how to do side effects. So if you're ready to try again, it might be worth considering a different language to Haskell. Lisp's for example have a rich tradition, and Clojure is a modern Lisp that favors a functional style: immutable values, lazy sequences, first class functions, and a disciplined but not enforced approach to side effects. You're right that Haskell tends to leave discussion of IO till later on; but that's because Monadic types require a good understanding of the fundamentals first. There is these days a lot of discussion about IO in Haskell, it's just hard to understand at first. If you're keen to try Haskell, then Real World Haskell introduces I/O pretty early in chapter 7, though Monads come 7 chapters after that. I'm not aware of any FP community avoiding text/string manipulation as a topic - but if they do - it'll likely be because they don't consider strings to be that special... They're just a value like anything else. In Haskell for example Strings are just lists of characters. Regarding how to do I/O in a functional style... it's easy, you basically try and avoid doing I/O in as much code as possible, and arrange things so that I/O mostly occurs at the bottom of the call stack. The majority of your code then becomes pure, perhaps returning sequences of values, which are only output at the last minute - at the outer most edge of your code. Why build things in this way? Well if state, side-effects and I/O are spread throughout your program things become less reusable because side-effects don't compose, have unstated implicit ordering dependencies, and typically belong to the application not reusable libraries. If you're used to something like Ruby it might be hard to see how this works; but things like lazy sequences (in languages like Clojure) really help, as you can efficiently return unrealised computations as values to the I/O function that sits at the bottom of your call stack. The I/O function then just forces the sequence for all its values which it outputs, to your I/O stream in a loop or reduction. > Will there be any recording facility to upload a video after the fact? Sorry, we don't yet record our talks. R. > > (sent from my phone, please excuse typos) > > On 12 Apr 2016 10:51 p.m., "Rick Moynihan" <[email protected]> wrote: > This Monday (18th April @7pm) the Lambda Lounge is meeting with a > > presentation by Hakim Cassimally on how Haskell is an acceptable Perl. > > > > http://www.lambdalounge.org.uk/ > > > > So, Haskell is "an advanced purely-functional programming language" which > > supports writing "declarative, statically typed code". It may be optimized for > > academic buzzwords you've never heard of but... is it any good for writing > code > > in the way that you'd write Perl, Python, or Ruby? > > > > What are strong types, and why are we so frightened of them anyway? Can you > > develop interactively in Haskell, the way you would in a dynamic language? > Does > > Haskell have "whipuptitude" (being able to get things done quickly) as well as > > "manipulexity" (being able to manipulate complex things)? And perhaps most > > importantly, can writing Haskell be *fun*? > > > > > > Rick. > > > > -- > > You received this message because you are subscribed to the Google Groups > "North West Ruby User Group (NWRUG)" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > > To post to this group, send an email to [email protected]. > > Visit this group at https://groups.google.com/group/nwrug-members. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "North West Ruby User Group (NWRUG)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send an email to [email protected]. Visit this group at https://groups.google.com/group/nwrug-members. For more options, visit https://groups.google.com/d/optout.
