Mostrando entradas con la etiqueta functional programming. Mostrar todas las entradas
Mostrando entradas con la etiqueta functional programming. Mostrar todas las entradas

martes, 19 de febrero de 2019

FP vs OO talk

Here's a quite balanced talk about FP and OO that fits my view of the two paradigms. Give it a shot if you have 40mins on your commute or something.
 
https://www.reddit.com/r/programming/comments/as6epa/fp_vs_oo_choose_two_by_brian_goetz/

domingo, 6 de mayo de 2018

TIL elisp has iterators

So I was reading the Gnu/Emacs mail list and saw this thread where there's some good discussion about destructively modifying a recursive structure (as every structure, right?) in elisp.

All proposed solutions have something worth reading and understanding, but there's one that caught my attention. It uses cl-loop and generators. Yep, like python's ones, but in elisp.

I didn't even know that elisp had this magic in loop (as CL doesn't have it, and you have to make iterators yourself as closures called in `for' clauses.

So yep, the code is (as usual) only elisp and ready to be explored (and be enlightened with).  pcase and CPS used in real world. Also, nice to see in the end of the file where it wrestles itself into elisp itself and into emacs (even it adds syntax highlight for it).

Very good Sunday afternoon read (I just don't understand everything on it yet...)

Thanks to Daniel Colascione again for providing inspiring gems one more time :)

miércoles, 19 de abril de 2017

k/Apl info

  • APL self hosted compiler https://news.ycombinator.com/item?id=13797797
  • APL self hosted compiler screencast https://www.youtube.com/watch?v=gcUWTa16Jc0 
  • q manual http://code.kx.com/q4m3/
  • ok manual https://github.com/JohnEarnest/ok/blob/gh-pages/docs/Manual.md
  • k main page http://kparc.com/
  • kona https://github.com/kevinlawler/kona

martes, 20 de diciembre de 2016

How to replace procrastination by a list of parsing techniques

Here's a very nice Wadler's paper with quite simple ideas to get you through a way of parsing which I guess predates monads, and monadic parser combinators.

How to replace failure by a list of successes.

Seeing it after playing with SMUG (Common Lisp Monadic parser combinator lib), watching MJD's Higher Order Parsing techniques with perl, and re-reading his parsing chapter definitely helped a lot to make all that fuzzy knowledge settle a bit.

Unfortunatelly, I'm not using any parsing technique very often, but I like to read about all those crazy parsing techniques. (See META: Pragmatic parsing in Common Lisp for another one (inspired by Val Schorre's no-words-to-describe-how-enlightening-is-it META-II)).

Joining the monad party



Ok, so I won't try to explain what is a monad, or where is it used, mainly because I'm not sure I know the answers to these questions, but I'm just going to list some links that seemed to make sense (more or less) at some point. I think 'programmable semicolons' is a very nice way to put it.

- http://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf
- http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html
- https://codon.com/refactoring-ruby-with-monads
- http://stackoverflow.com/questions/28139259/why-do-we-need-monads
- https://www.stephanboyer.com/post/9/monads-part-1-a-design-pattern
- http://blog.reverberate.org/2015/08/monads-demystified.html
- https://www.schoolofhaskell.com/school/advanced-haskell/functors-applicative-functors-and-monads
- http://stackoverflow.com/questions/44965/what-is-a-monad

Monads in CL/scheme
- https://www.lrde.epita.fr/dload/papers/newton.16.monad.report.pdf
- http://www.kylheku.com/cgit/lisp-snippets/tree/monads.lisp
- https://common-lisp.net/project/cl-monad-macros/monad-macros.htm
- http://www.ccs.neu.edu/home/dherman/browse/shared/notes/monads/monads-for-schemers.txt

Monads in Clojure
- https://github.com/clojure/algo.monads

Others
- http://fsharpforfunandprofit.com/rop/
- https://www.schoolofhaskell.com/school/advanced-haskell/functors-applicative-functors-and-monads
- http://www.valuedlessons.com/2008/01/monads-in-python-with-nice-syntax.html

Seem cool, but couldn't grasp it:
- http://www.eliza.ch/doc/wadler92essence_of_FP.pdf
- https://ncatlab.org/nlab/files/WadlerMonads.pdf

Meta, why there are sooo many monad tutorials:
- https://byorgey.wordpress.com/2009/01/12/abstraction-intuition-and-the-monad-tutorial-fallacy/

domingo, 26 de junio de 2016

Functional programming in small pieces

I've been articles on reading functional programming for some time, and little by little, I think I get a bit more of the whole stuff.

I found some nice articles/tutorials, and I understood most of them (yay!)
Although I'm still fighting with some other articles like this functional pearl about using foldr to make a function to give combinations of elements. It's been too long since I started looking at it, and I still don't get it.... :/

Well, have fun, and happy hacking.