Disclaimer: We're all learning here, even me! So there may be concepts, terminology, etc I don't know!
- Refactor away from nulls
- Refactor away from throwing exceptions
- Making failures explicit
- Improving the readability of code
- Having fun!
Although not a goal specifically, refactoring to functions as the unit of programming versus classes is a natural consequence of the above goals in FP (although C# fights this).
- Introduce Vladimir Khorikov, DDD, TDD, and Unit Testing expert
- Vladimir Khorikov Pluralsight
- Unit Testing Book
- It's a library similar to Ardalis.Result but expanded for a wider variety of use cases and FP support
- A structure for representing a value or operation that can be combined with functional operations without breaking the contract of the monad itself
- wiki
- Result (compare to Ardalis.Result)
- Maybe
- Other C# Monads we already use
- Result<T, E> T value, E error
- Projects.GetById for a simple introduction, Maybe and Result
- Project.Update endpoint
- My favorite feature of this library
- Enables developers to define recipes and tell stories using concise method chaining operations
- Focus on making failures explicit, avoiding exceptions, and staying inside the higher-order function mindset
- Are we using pure functions? Does Dependency injection break this?
- Show simple example with Project.GetById, no currying/partial application needed
- partial application/currying in update name
- How to deal with Domain events?
- Project.CreateToDoItem example
- This style produces a lot of methods which at first seems bad but really isn't ... because functions are first-class citizens in this paradigm
- How to deal with them? organize in static classes similar to extensions, group by feature, use generics, etc, nothing has to change there
- Lots of noise with type parameters, due to many overloads and well.... the C# type system not being as strong at inference as say, F#
- Any others??
- Absolutely abusing exceptions, better practice would be to model failures just like successful outcomes using something like a SmartEnum
- In OOP/FP hybrid architectures, not everything has to be immutable, support for encapsulation even with immutability
- In C#, classes are the unit for grouping data and behavior, whether in separate or single classes
- Newer C# features allow for friendlier functional expressions
- Pattern matching with switches, example of generic error handler
- Other examples we'd like to see?
- Functional Architecture demo? CQRS?
- F# lunch-n-learn?
- opinions?
F# goodness Currying and Uncurrying Principles of Functional Programming Functional programming principles