A common pattern i often come across is Some/NoneWithError. I think as Option is so deeply nested in f#, a better way to handle this is to log/handle error details immediately and pass None back up the call stack. Anyone got a better process?
I recommend you take a look at the Railway Oriented Programming it's a design to handle error cases in functional languages Scott Wlaschin has a great talk about it and a post showing a F# implementation
João Vítor Costa thanks. I found this shortly after writing the comment, really useful approach to controlling flow and adapting output of a function to fit other, non-fitting functions... I’m a fan!! :)
I believe there is a built in Error type: from a starting type 'T, type Error 'T = | Ok of 'T | Error of String (It's not really a String but you get the idea). You then use Map to turn 'T -> 'U functions into 'T Error -> 'U Error functions that do the right thing when no error, or propagate the error if any; and Bind to turn 'T -> 'U Error functions into 'T Error -> 'U Error ones that either do the right thing when no error and if able, propagate the error, or add their own error.
This is the only presentation I've seen showing a real world problem solved using functional programming.
Good talk, nice to see Tomas talk about something else other than Type Providers.
Always see him in the F# stackoverflow, first time hear his voice, very interesting :)
Really great talk I'm always amazed by the review/line counting part and how Tomas thought are transpiled to code so easily
**types 15 lines of code** "Now I feel tired..."
That is exactly how I feel =)
awesome! this actually helped my Elm and my FP in general
But what would be happen when you'll turn back to cell that already was in set, but will reference itself?
This is something
A common pattern i often come across is Some/NoneWithError. I think as Option is so deeply nested in f#, a better way to handle this is to log/handle error details immediately and pass None back up the call stack. Anyone got a better process?
I recommend you take a look at the Railway Oriented Programming
it's a design to handle error cases in functional languages
Scott Wlaschin has a great talk about it and a post showing a F# implementation
João Vítor Costa thanks. I found this shortly after writing the comment, really useful approach to controlling flow and adapting output of a function to fit other, non-fitting functions... I’m a fan!! :)
Either
I believe there is a built in Error type: from a starting type 'T,
type Error 'T =
| Ok of 'T
| Error of String
(It's not really a String but you get the idea).
You then use Map to turn 'T -> 'U functions into 'T Error -> 'U Error functions that do the right thing when no error, or propagate the error if any; and Bind to turn 'T -> 'U Error functions into 'T Error -> 'U Error ones that either do the right thing when no error and if able, propagate the error, or add their own error.
a lot of traps in using options though...and AwaitObservable is still flaky