Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
uryga
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
uryga
6y ago
same! apparently i tricked myself into caring about my finances in this exact way
62.
▲
by
uryga
6y ago
pedantically, talking to the database will involve sending a request or some kind of IPC, all of which are usually considered side effects. [handwavy analogy alert] people often call it "side-effects" as a shorthand. in reality an
63.
▲
by
uryga
6y ago
> You'd write code pretending it's pure while it really isn't. in a way, it's the opposite! the point is you can't pretend, you have to make impurity painfully explicit: getTradeTax :: CountryId -> Country
64.
▲
by
uryga
6y ago
> In the case above, I'd pass a function which maps a (pure) date and string into a (pure) bool, to test for EU membership. i doubt you could make (or really, even want to make) `checkEUMembership` pure, I'm guessing it'd
65.
▲
by
uryga
6y ago
if it has side-effects, it has to be something like Int -> Int -> IO Bool otherwise the type checker won't let you perform any side-effecting operations (btw Haskell's `IO Bool` would be spelled `IO<Bool>` in C+
66.
▲
by
uryga
6y ago
yeah, and as others pointed out it fails right-identity as well. had a brain fart recapping the laws, though i think i got associativity right at least!
67.
▲
by
uryga
6y ago
ahh right! serves me right, i should've spent more than 10 secs checking
68.
▲
by
uryga
6y ago
> Propagating "Nothing" is not inherent to the Maybe data type, it's just a convenient behavior to have. nitpick about this particular example: is there another lawful implementation of Monad for Maybe? i can't th
69.
▲
by
uryga
6y ago
[caveat emptor: my knowledge of WASM stuff is mostly based on blog posts and HN comments, and may be outdated. corrections welcome] in general transpiling to JS lets you reuse the JS runtime (if your language is similar enough), e.g. the ga
70.
▲
by
uryga
6y ago
> and you make it a heading by typing (part of) "/heading" or markdown-style hashes! (+ a space after)
71.
▲
by
uryga
6y ago
WizTree work alright, it generates a nice colourful tile plot
72.
▲
by
uryga
6y ago
@jorkadeen since you're here: the landing page's two-column layout doesn't work great on mobile, you get two columns that are like 2-words wide: Recent | Bread- News | and Butter | Funct
73.
▲
by
uryga
6y ago
didn't mean to argue, just providing context for people scrolling through the comments :) i agree that it's a bit nitpicky. (but "depends only on libc" would probably be a better phrasing)
74.
▲
by
uryga
6y ago
> without any dependencies on an interpreter/environment/libs etc. no stake on either side, but the post specifically mentions this (though that was on vlang 0.1) > I claim that the V compiler has dependencies because it req
75.
▲
by
uryga
6y ago
not really sure what you mean by 2D/3D. if you mean "whitespace sensitive" (≈ effectively laid out in 2D), what about YAML? pretty sure you could just add dashes and get valid YAML representing the same tree: - A - B
76.
▲
by
uryga
6y ago
ah sorry, i thought your OP was talking about a more graph-theory-ish thing, some fun bijection between trees and graphs or something, serialization isn't really what i had in mind re: TN stuff. don't take this the wrong way, but
77.
▲
by
uryga
6y ago
sorry, can't really find anything about graphs in there. how would use TN to represent a graph like this? A --> B --> C ^ | | | +-----------+
78.
▲
by
uryga
6y ago
> Every graph can be represented by a 2-dimensional tree. do you have a good reference for this encoding? i vaguely recall seeing something like this in a paper, but can't remember any specifics
79.
▲
by
uryga
6y ago
> This reminds me, does anyone here know how to get PGP paper keys that use only english words e.g. "brunch pineapple house crow ..."? maybe BIP39? (afaik it's used for paper keys in bitcoin-adjacent things) https:/
80.
▲
by
uryga
6y ago
one example is `namedtuple`'s `._replace`: >>> x = Foo(a=1, b=2, c=3) >>> x._replace(a=1000, c=3000) Foo(a=1000, b=2, c=3000) in this case, you really need to know if the user passed a replacement or not.
81.
▲
by
uryga
6y ago
> language defines the way we think about reality citation needed :)
82.
▲
by
uryga
6y ago
have you worked with GUIs much? complex interactive UIs take a surprising amount of code, doubly so if what you're doing isn't covered well by your platform/toolkit's native inputs. i'm working on a webapp with a sc
83.
▲
by
uryga
6y ago
> What if it were to fail? isn't that the price you pay for using any online sharing thingy? you gain easy sharing+access (because it's "on someone else's computer"), but lose control. if it makes information eas
84.
▲
by
uryga
6y ago
google keyword: "exponential object" ("exponential function" clashes pretty badly ;) )
85.
▲
by
uryga
6y ago
found something! kinda: https://developer.apple.com/documentation/swiftui/previewpro... an example for `PreviewProvider#previews` uses `.previewDevice("iPhone X")`, and i'm guessing that that string
86.
▲
by
uryga
6y ago
excel is like pure FP in that - everything you write is an expression that yields a value - those expressions are "pure"/"referentially transparent" bc there's no way to do side effects (like writing to anothe
87.
▲
by
uryga
6y ago
i always thought "tail call" means a function call that can be optimized in this way (located in a tail position), not the act of call-by-jumping itself. both uses make sense though re: C--, i think it's mostly used as a comp
88.
▲
by
uryga
6y ago
i think GP means that conceptually, you could imagine goto-ing to a function's code - they do compile to labels after all. fun note: C-- has something like that! iirc it's like calling a function, but reusing the current stackfram
89.
▲
by
uryga
6y ago
you're right! but i think under normal circumstances it's fair to assume that the function actually uses all of its arguments. and i mean "uses" in a general handwavy sense, e.g. that it doesn't do `any f xs = len
90.
▲
by
uryga
6y ago
as a counterpoint, genericness can actually serve as a form of documentation. you can often infer a lot from just a signature, e.g: any :: (Functor f, Foldable f) => (a -> Bool) -> f a -> Bool tells me that `any` has to w
More ›