thank you!!!
and thanks for sharing :)
thank you!!!
and thanks for sharing :)
aha! and this made you happy with closures b/c it ~gives an identification b/w closures and values?
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?
can i get a eli5 ๐ฌ
hmmmm
ooh pfp
this is ... an example of an isomorphism? dafuq?
evidence suggests i cannot wind down at the end of the day unless i have done math or am being snuggled
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
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
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
writing about monads ๐
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
anyone want to review a 1000-line durable execution engine i just wrote in a three-day fury
i'm famous ^^
aha :D
why
omg what
what i am learning is that i literally cannot keep myself from writing libraries
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! ^^
what is the mult. inverse given by?
ah, right!
what def of e as a type do you take, to get this?
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
yes
based
map with a default value?
what is a total map?
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"
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