OAuth2 and OpenID Connect in #Haskell
https://broch.tech/posts/oauth2-openid-connect-haskell/
stumbled on it as I was struggling my way (bellow , auth my hakyll client from #mastodon)
let body =
reqBodyUrlEnc $
"client_id" =: (T.pack clientID)
<> "client_secret" =: (T.pack clientSecret)
<> "grant_type" =: ("client_credentials" :: T.Text)
url = https "mathstodon.xyz" /: "oauth" /: "token"
r <- req POST url body jsonResponse mempty
what am i doing wrong here
its mappend from #Monoid typeclass combining id and secret
as (I guess)
clientId and clientSecret are converted to Text (e.g., T.pack clientId)
Text is an instance of the Monoid typeclass
The <> operator concatenates multiple Text values together into one Text value, representing form data or URL-encoded parameters combined
//noob webdev
It was a missed sight on #ghc error message fixed now
// bad
Asking ChatGPT about coloring diagrams with truth values. When you write A -> B the arrow can be valid or invalid, but you still want to talk about it
Level 1: Morphisms = Proofs, Typed with Validity
You can think of these arrows as typed by a truth value — i.e., each morphism has a color: valid, invalid, plausible, context-sensitive, contradictory-but-derivable, etc.
In this sense, truth is not binary, but becomes a fiber over each morphism: a coloring or modality.
So your category becomes a fibration over a poset of truth values, or a category enriched in truth values — maybe in a Heyting algebra or relevance lattice.
I'm not sure I've ever heard it say "maybe" before, but
Random #math talk:
JRV: According to [source]* linear algebra is simply the study of factorization of matrices. Even finding the inverse of A is factoring the identity matrix with A as one of the factors.
Me: Oh. So a monoid is a group if every element is a factor of the identity element. In other words, every element "evenly divides" the identity.
#group #monoid #linear #algebra
* I forgot the exact source that was mentioned.
A presentation going around the basic concepts surrounding functors, monoids and monads. They are discussed in Haskell and Kotlin domains and the idea is to give an empirical and instinct feeling about what they are, so that we can process better our thoughts with higher level concepts to find solutions for our every day programming language challenges.
🚀 just uploaded to https://fpilluminated.com
Folding Cheat Sheet #8 - Folding with Monoids.
39 slides - Twelve examples.
Direct link: https://fpilluminated.com/deck/240
#haskell #scala #monoid #semigroup #fold #foldMap #combineAll #cats #fp #functional_programming