Hello #fsharp Twitter!
Did learning F# or some other functional programming seem to “unlock” something for you?
If you have a story or comment about how it changed your trajectory or outlook, I’d love to hear from you.
Reply in the comments or send me a DM.
@stacey_large@Uus_it @BernieSpofforth Davos was between Mon Jan 20 - Fri Jan 24, which probably meant he was back in the office Mon Jan 27th. On that day, cases had averaged a ~50% compounded daily growth rate for 10 days.
I created a spreadsheet on Jan 27th to track the growth and I'm just a programmer.
@WillEhrendreich In my head, I think I’m working toward that goal but I’m spiking backwards to learn how the Fable compiler works by modifying a working transpiler.
But I would love to use the Roslyn SDK to translate C# to the Fable AST or to push it to something Fantomas.
What would you do?
@Thoriumi@sforkmann BTW, Thank you for pointing this out. I'm not a fan of mixing exceptions with Result types, let alone replacing exceptions with Result types. They're two different animals and both deserve thoughtful consideration.
@Thoriumi@sforkmann I assumed that was obvious.
The goal was to show you don't have to *always* return values in expressions, you can throw a runtime error.
Part 2 - Using Cantor's unpairing function to map integers to our calculator language. (A recursive type)
It's getting closer to being a total function. But what if we used unbounded bigints?
When two total functions (these should be uint, not int) map to each other in a special way, they can create a bijection.
For this demo, we uniquely map the set of integers to a pair of integers and back.
F# is a pretty good at working with generics. If you see 'a or 'b or 'c (etc) in your function signature, it means you're defining a generic function.
Maybe you did it on purpose, or maybe didn't give the F# compiler enough to infer the types you wanted.