Maynard's Avatar

Maynard

@quelklef

Maynard

44
Followers
42
Following
336
Posts
09.12.2024
Joined
Posts Following

Latest posts by Maynard @quelklef

thank you!!!

and thanks for sharing :)

21.03.2025 16:54 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

aha! and this made you happy with closures b/c it ~gives an identification b/w closures and values?

18.03.2025 14:50 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

eilenberg-kelly says that if you have a currying adjunction then the product functor is monoidal iff the category is closed

ie, currying gives you internal homs

is that right?

18.03.2025 06:45 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

can i get a eli5 ๐Ÿ˜ฌ

18.03.2025 06:42 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

hmmmm

18.03.2025 06:42 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

ooh pfp

18.03.2025 06:41 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

this is ... an example of an isomorphism? dafuq?

25.02.2025 09:01 ๐Ÿ‘ 5 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

evidence suggests i cannot wind down at the end of the day unless i have done math or am being snuggled

25.02.2025 07:40 ๐Ÿ‘ 6 ๐Ÿ” 1 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

I was gonna say I'm still not convinced that there are no "bad" lenses

Then I remembered that `Lens' s a` is iso to `โˆƒb. Iso s (a, b)`, which obviously has no "bad" values

I love existential lenses

25.02.2025 03:17 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Screenshot of Haskell code reading as follows

-- Law: if 'value > 0' then 'hadPositive = True'
data Target = Target
  { value :: Int
  , hadPositive :: Bool
  }


get :: Target -> Int
get = value

set :: Int -> Target -> Target
set n (Target { value, hadPositive }) =
  Target { value = n
         , hadPositive = hadPositive || (n > 0)
         }

Screenshot of Haskell code reading as follows -- Law: if 'value > 0' then 'hadPositive = True' data Target = Target { value :: Int , hadPositive :: Bool } get :: Target -> Int get = value set :: Int -> Target -> Target set n (Target { value, hadPositive }) = Target { value = n , hadPositive = hadPositive || (n > 0) }

Here's an interesting (counter)example. The following (get, set) pair satisfies laws #1 and #2 of Data.Lens.Lens, and the WEAKENED form of #3, but not the strongest form.

As such, it provides an example of why the stronger form of law #3 is necessary

25.02.2025 03:13 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Screenshot reading as follows. The use of the phrase computation or computation result is not necessary, as any value can be though of as the trivial computation which produces itself.

Screenshot reading as follows. The use of the phrase computation or computation result is not necessary, as any value can be though of as the trivial computation which produces itself.

gotta make sure it's beginner-friendly

25.02.2025 02:34 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

writing about monads ๐Ÿ˜‰

25.02.2025 02:28 ๐Ÿ‘ 5 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

i think he's literally just saying that if foo is overloaded with implementations fooโ‚ and fooโ‚‚ then it's the tuple (fooโ‚, fooโ‚‚)

which is true, i guess

21.02.2025 22:36 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

anyone want to review a 1000-line durable execution engine i just wrote in a three-day fury

21.02.2025 00:44 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

i'm famous ^^

20.02.2025 22:33 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

aha :D

20.02.2025 22:33 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

why

20.02.2025 21:00 ๐Ÿ‘ 3 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

omg what

20.02.2025 21:00 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

what i am learning is that i literally cannot keep myself from writing libraries

20.02.2025 20:59 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

my kneejerk reaction is that it seems impossible because I cannot think of a type X for which 3 ร— X โ‰… 1

clearly I am missing the role of linearity ... hence the question! ^^

20.02.2025 11:50 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

what is the mult. inverse given by?

20.02.2025 11:48 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

ah, right!

20.02.2025 11:47 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

what def of e as a type do you take, to get this?

20.02.2025 06:21 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

t ร— t ร— t โ†’ (n โ†’ t)
(a, b, c) โ†ฆ (n โ†ฆ case n of { 0 โ†’ a; 1 โ†’ b; 2 โ†’ c; })
(f 0, f 1, f 2) โ†| f

20.02.2025 06:19 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

yes

20.02.2025 06:17 ๐Ÿ‘ 0 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

based

20.02.2025 06:16 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

map with a default value?

19.02.2025 22:45 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

what is a total map?

19.02.2025 22:45 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

it would be cool if the condition was evaluated when wrap() is called, and so the return wrapped() looks like

fn wrapped() { before(); f(); after(); }

or like

fn wrapped() { before(); g(); after(); }

with the condition already "collapsed"

19.02.2025 19:12 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0

for instance, with

fn wrap(bool) {
return fn wrapped() {
before();
(if bool then f else g)();
after();
}
}

with common closure semantics wrap(true) will evaluate the condition when the result wrapped() is called

19.02.2025 19:12 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0