write is buggy Errors are rather logged than handled Similar patterns of code are written over and over again Existing code is not easily adapted We use frameworks with tons of xml conguration and go insane Are you fed up? Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
program, the formula it proves is a type for the program. Notes Applies for subprograms (functions) too. Informally means if the code compiles, it is proved that from the input types the output type can be produced. Average response: So what? Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
they encounter are usually shallow in information. primitives, string (no semantic) void (can't do anything with it) Object (not too informative) MemberProcessorStrategy (name doesn't tell us anything) There are some refreshing exceptions. Collection types (clear concept + expectable operations) Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
detail about data or the underlying computation, so we resort to the Apidoc, if any. Apidoc throws if id is invalid syntactically returns null if no such id normally returns either Foo or Bar type by performing IO request and blocking the thread until the request is complete Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
Any Note In Functional Programming, functions are also rst-class values and have a type signature. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically getItem: String => Any Note In Functional Programming, functions are also rst-class values and have a type signature. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically String => Validation[E, Any] Note Validation holds a successful result or a description of the errors encountered during execution of the computation. While throw/try/catch is hard to compose, functions returning a Validation compose easily. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically returns null if no such id String => Validation[E, Any] Note Validation holds a successful result or a description of the errors encountered during execution of the computation. While throw/try/catch is hard to compose, functions returning a Validation compose easily. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically returns null if no such id String => Validation[E, Option[Any]] Note Option is either None or Some(value), marking nullness explicitly (no more NPE). Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically returns null if no such id normally returns either Foo or Bar type String => Validation[E, Option[Any]] Note Option is either None or Some(value), marking nullness explicitly (no more NPE). Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically returns null if no such id normally returns either Foo or Bar type String => Validation[E, Option[Either[Foo, Bar]]] Note Either carries one of two alternatives. If more alternatives are needed, it is common to use a custom Algebraic Data Type. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically returns null if no such id normally returns either Foo or Bar type by performing IO request String => Validation[E, Option[Either[Foo, Bar]]] Note Either carries one of two alternatives. If more alternatives are needed, it is common to use a custom Algebraic Data Type. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically returns null if no such id normally returns either Foo or Bar type by performing IO request String => Validation[E, IO[Option[Either[Foo, Bar]]]] Note IO holds the execution plan of an I/O action, making it possible to defer IO actions until necessary. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically returns null if no such id normally returns either Foo or Bar type by performing IO request and blocking the thread until the request is complete String => Validation[E, IO[Option[Either[Foo, Bar]]]] Note IO holds the execution plan of an I/O action, making it possible to defer IO actions until necessary. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
is invalid syntactically returns null if no such id normally returns either Foo or Bar type by performing IO request and blocking the thread until the request is complete String => Validation[E, Future[IO[Option[Either[Foo, Bar]]]]] Note Future (alias Promise) describes a computation that is running concurrently. With it blocking threads can be avoided. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
and tools to dene, use and compose types capturing both the description of data and context of computation, resulting in correct and reusable software. Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming
a new API to skim overnight, but a new concept that will change the way you interpret and create software. Start now. Haskell Learn You a Haskell: http://learnyouahaskell.com Real World Haskell: http://book.realworldhaskell.org Scala Functional Programming in Scala: http://www.manning.com/bjarnason Scalaz 7: https://github.com/scalaz/scalaz/tree/scalaz-seven Robin Palotai@bootcodehttp://ron.shoutboot.com A subjective on Functional Programming