
Quickly demonstrating the F# language and tools.
Northern Virginia
Joined February 2017
- Tweets87
- Following637
- Followers685
- Likes113
Spent this afternoon making basic F# classes and record types transpile to C# classes and record types.
1
2
396
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.
3
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?
Generate: Int → Lang ????
Can we define a small recursive language and then map the set of integers to example instances of our language?
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.
I'm making my Swifty fan page with a tiny home-grown DSL.
Read more here: gist.github.com/sgoguen/9120…
Cyclomatic complexity can make software hard to grok+maintain. Enforced layering helps prevent accidental cycles. share.linqpad.net/8tcadj.lin…
Web libraries like Redux and Flux fold input into state and notify views with events when they've been updated: share.linqpad.net/apnlt2.lin…
Nothing more exhilarating than juggling 1000 chainsaws of mutable state! What could possibly go wrong? share.linqpad.net/iuvnc9.lin…
You should be able to write any program if you're allowed *one* mutable variable and an infinite sequence of inputs: share.linqpad.net/q87jwf.lin…
Some ideas are timeless and take on a minimal form. What minimal and timeless idea might you express as an #fsharp operator? #myfsoperator
