Paul Louth(@paullouth) 's Twitter Profile Photo

Part 7 of my Higher Kinds in C# series is up now. And it's finally time for MONADS! 🥳

Yet Another Monad Tutorial to add to the sea of Yet Another Monad Tutorials, yay!

paullouth.com/higher-kinds-i…

account_circle
Paul Louth(@paullouth) 's Twitter Profile Photo

After getting some push-back on the approach to higher-kinded types in C#, I decided to put together a proof that the approach I've taken in language-ext isomorphic to lambda-abstractions in FP languages.

paullouth.com/are-higher-kin…

account_circle
borar(@Savlambda) 's Twitter Profile Photo

Paul Louth chris rollings This is not sufficient, because it works only with interfaces, where type classes/instances are simulated by the library. With real HKTs we want (and have) type checking also for data types, even if there are no type classes instances involved, like this:

@paullouth @4Rollings This is not sufficient, because it works only with interfaces, where type classes/instances are simulated by the library. With real HKTs we want (and have) type checking also for data types, even if there are no type classes instances involved, like this:
account_circle
Paul Louth(@paullouth) 's Twitter Profile Photo

borar (Rob Ashton) Mark Rendle 🇺🇦 Explain to me why the ergonomics are horrible. If you put the same implementation of an IO monad in C# (with language-ext) and Haskell side-by-side (other than C#'s syntactic bulk) it's essentially the same.

Having an opinion is fine, passing it off as fact isn't.

@Savlambda @RobAshton @markrendle Explain to me why the ergonomics are horrible. If you put the same implementation of an IO monad in C# (with language-ext) and Haskell side-by-side (other than C#'s syntactic bulk) it's essentially the same.

Having an opinion is fine, passing it off as fact isn't.
account_circle
Paul Louth(@paullouth) 's Twitter Profile Photo

borar (Rob Ashton) Mark Rendle 🇺🇦 5/ The one limitation to this approach is that it's not ad-hoc, unlike Haskell, it requires the IO<A> type to derive from K<IO, A> - that's a limitation which requires writing wrapper types to apply ad-hoc trait implementaions (like PureScript).

@Savlambda @RobAshton @markrendle 5/ The one limitation to this approach is that it's not ad-hoc, unlike Haskell, it requires the IO<A> type to derive from K<IO, A> - that's a limitation which requires writing wrapper types to apply ad-hoc trait implementaions (like PureScript).
account_circle
Paul Louth(@paullouth) 's Twitter Profile Photo

(Rob Ashton) Mark Rendle 🇺🇦 You might need to update your position. Static interface methods allows for traits that enable higher-kinds (transformers, monads, applicatives, etc). True it’s not quite as powerful as Haskell/PureScript, but it’s not far off.

paullouth.com/higher-kinds-i…

account_circle
Erik Meijer(@headinthebox) 's Twitter Profile Photo

Paul Louth Super cool hack, really; but an encoding does not imply it is usable. More importantly

> Don't we deserve higher-kinds? Aren't we allowed to follow the pure functional programming paradigm?

Higher kinds does not give you pure functions

queue.acm.org/detail.cfm?id=…

If you are using

account_circle
borar(@Savlambda) 's Twitter Profile Photo

Paul Louth Can one program with such a library in C#? Of course, no denying that. The second part of the discussion was specifically about the ergonomics, not about the possibility.

account_circle
borar(@Savlambda) 's Twitter Profile Photo

Paul Louth As for your proof, here is a simple counter-example. In C# the following instantiation of type variables is legal: K<String, Int>. In Haskell 'String Int' fails to type check (exactly because there is simply no notion of kinds in C#). So they cannot be equal.

account_circle
borar(@Savlambda) 's Twitter Profile Photo

Paul Louth (Rob Ashton) Mark Rendle 🇺🇦 I just took a look at the library repository. It is impressive and is the result of big effort, no doubt. But I can't bring myself to thinking that it is comparable to Haskell or PureScript in any way other than the concepts in general.

account_circle
John Pavlick(@lambdapriest) 's Twitter Profile Photo

borar Paul Louth (Rob Ashton) Mark Rendle 🇺🇦 $0.02 - Paul Louth is on another level and you should sample what he's cooking, borar

you need to check out language-ext if you haven't yet - it's very, very good

account_circle
borar(@Savlambda) 's Twitter Profile Photo

Paul Louth You make quite strong claims about a supposed *proof* of equality of two constructs, I point out an obvious difference. Then you conveniently call my argument 'academic'. 'Proof' is an academic word that normally carries serious meaning and intention.

account_circle
Remigiusz Samosiuk(@seermindflow) 's Twitter Profile Photo

Erik Meijer Paul Louth Here is wizard code I've wrote some time ago:

from _ in Start(Welcome)
from c in GetCredentials()
from crt in GetCert(c)
select SetupSignProcess(crt)

Without LINQ it was a mess of nested while-s that can break when user clicks Back and move to next while when Next.

Mistake🤣

account_circle
Alexey Raga(@alexeyraga) 's Twitter Profile Photo

Paul Louth borar (Rob Ashton) Mark Rendle 🇺🇦 In Haskell code I see classification: MIO is a functor, and here is how, MIO is an applicative and here is how.
'addM' reads simple: 'given that M is a monad, follows ...'

C# code looks like dancing around and can only be comprehended by translating it into Haskell mentally.

account_circle