Atif Aziz (@raboof) profile picture
Joined September 2007
Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)Photo by Atif Aziz (@raboof)
That time when you give your project such a cute name, cleverly changing just one letter for uniqueness (Args → Arqs), that you can't remember & find it some 6 years later when you really need it. 🙄 But then remembered an old post! Right, time to raise the dead.
1/5 So here's strong-typed CLI parsing with help (example "git commit") succinctly expressed in LINQ as an applicative computation: github.com/atifaziz/Arqs/blo… Don't it just read pretty? Or as Belloq would've exclaimed, “It's beautiful!” just before…🤯
1
252
1/3 Earlier this year, I published BuildConstants. It solves a simple problem: define C# constant from MSBuild items. github.com/atifaziz/BuildCon…
1
1
85
2/3 You get the basic ones like AssemblyName, Version, Product, Copyright, etc., by default, but you can also define your own; including reading their content from a file:
1
55
It's just been crickets here since a minute! 💤 Time to try & change that (soon).
2
76
Just for fun & kicks, published an Interact Monad gist in C#, derived from fssnip.net/8ay in F# by @tomaspetricek and demonstrating an interactive computation that asks the user questions: gist.github.com/atifaziz/4a0…
210
1/5 Here's a (peculiar) idea…writing & combining C# functions (`Func<,>`) entirely with LINQ, as if you didn't have `=>` in the language. Introducing Finq: github.com/atifaziz/Finq or F(unq) + (L)inq
1
1
231
2/5 But wait, why would anyone in their right mind want to do that? Sometimes it can help when the compiler can't infer a type argument, like for a curried function:
1
25
Didn't know what to post so for whatever it's worth, this is my #GitHubUnwrapped! ¯\_(ツ)_/¯ Get your own: githubunwrapped.com
1
238
MoreLINQ 4.0 is out: github.com/morelinq/MoreLINQ… Adds pooling Batch & retires methods that are now part of .NET proper. 💯 Over 100 extensions to LINQ to Objects! 📈 50+ million downloads. 🍻 45 contributors ⚒️ Maintained over a decade (since 2009)
4
232
C# 10 added natural type for lambda expressions, making curried functions more readable & easier to express (almost like Hindley–Milner signatures) than the explicit typing and angle sandwiches needed previously with “Func<int, Func<int, …>>>”. 😅
3
381
My first SO answer in years showing how MoreLINQ's TraverseBreadthFirst can be used for JsonNode to get the same functionality as Json.NET's DescendantsAndSelf with a simple switch expression: stackoverflow.com/a/76757619…. There's more explored in the answer.
200
1/12 Just published Jacob, a succinct JSON combinator API over Utf8JsonReader for deserializing/reading JSON data. github.com/atifaziz/Jacob It provides most of the benefits of Utf8JsonReader, such as low-allocation, but without the ceremony & complexity of custom converters. 🧵
1
1
4
2/12 Starting simple, here's how to read a JSON number as a 32-bit integer and a JSON string as, well, a .NET string:
1
1
What do you think is the difference between these two? If you thought none then why does the second one always print “False”? This answers: sharplab.io/#gist:15ec654a08… but that smells like a bug in the C# compiler?
1
2
Hey there, I scored 6/6 on type-signature.com. Give it a shot! #Haskell via @_andys8
1
1/4 Just shipped a C# source generator in docopt.net 0.8.0 that generates efficient & reflection-free code to parse CLI args into a strong-typed args class at compile-time. nuget.org/packages/docopt.ne… It's been a labour of love for a year!
2
13
1
73
2/4 Basically you write your CLI help in “plain text”, based on the awesome POSIX-y docopt conventions formalized by @keleshev, and docopt.net will take care of writing out the code for you at build-time: gist.github.com/atifaziz/153…
1
1
6
One of those days ¯\_(ツ)_/¯
Sometimes you should just because you can. 🤡
2
Missed a small misc/footprint about target-typed new added in C# 9: “throw new() is allowed (the target type is System.Exception)”