Advertisement ยท 728 ร— 90

Posts by Maynard

thank you!!!

and thanks for sharing :)

1 year ago 1 0 0 0

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

1 year ago 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?

1 year ago 0 0 0 0

can i get a eli5 ๐Ÿ˜ฌ

1 year ago 1 0 2 0

hmmmm

1 year ago 0 0 1 0

ooh pfp

1 year ago 1 0 0 0

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

1 year ago 5 0 0 0
Advertisement

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

1 year ago 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

1 year ago 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

1 year ago 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

1 year ago 3 0 0 0

writing about monads ๐Ÿ˜‰

1 year ago 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

1 year ago 1 0 0 0

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

1 year ago 1 0 0 0

i'm famous ^^

1 year ago 2 0 0 0

aha :D

1 year ago 2 0 1 0

why

1 year ago 3 0 1 0
Advertisement

omg what

1 year ago 2 0 1 0

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

1 year ago 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! ^^

1 year ago 2 0 1 0

what is the mult. inverse given by?

1 year ago 2 0 2 0

ah, right!

1 year ago 2 0 1 0

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

1 year ago 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

1 year ago 0 0 0 0

yes

1 year ago 0 0 1 0
Advertisement

based

1 year ago 2 0 0 0

map with a default value?

1 year ago 2 0 1 0

what is a total map?

1 year ago 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"

1 year ago 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

1 year ago 2 0 1 0