Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Gabriel439
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
61.
▲
by
Gabriel439
9y ago
The key word in "automatic simplification" is "automatic". The feature loses value if a human has to intervene to specify which functions to inline or to continue inlining. Imagine how worthless `go fmt` would be if it
62.
▲
by
Gabriel439
9y ago
In a Turing complete language you can't safely inline all functions to completion without risking an infinite loop. In such a language there is no decidable way to know when to stop inlining things
63.
▲
by
Gabriel439
9y ago
Both. In a Turing complete language there are programs without normal forms. For example, in the untyped lambda calculus you will loop forever if you try to normalize the following expression: (\x -> x x) (\x -> x x)
64.
▲
by
Gabriel439
9y ago
Author here: you could in principle, but in practice neither the library nor the executable compiler provide out-of-the-box support for limiting the number of reductions Dhall's basic approach to safety is: * make it impossible to inte
65.
▲
by
Gabriel439
9y ago
Author here: there is a reason why "programmable configuration language" is a fairly new term. Most of the time, when people want a programmable configuration they use whatever language they are already programming in. So, for e
66.
▲
by
Gabriel439
9y ago
Here's a practical example of why it's beneficial to not be Turing complete. In Dhall, you can normalize programs, even if they are functions. For example, the interpreter can automatically simplify this Dhall function:
67.
▲
by
Gabriel439
9y ago
What is the reason that `peek` is inefficient? Is it just because it is a function call that is not inlined or is there another reason?
68.
▲
by
Gabriel439
9y ago
The trick is to use the `parsers` library, which lets you switch out parsing backends. You can prototype with the `trifecta` library (which has good error messages) and then switch to `attoparsec` when you're done For this specific po
69.
▲
by
Gabriel439
9y ago
Author here: yes, this bothers me, too (especially the horizontal scroll switching to another post). I'm not sure how to disable that since Blogger doesn't provide a way to disable this. However, I may be able to fix the zooming.
70.
▲
by
Gabriel439
10y ago
Author of Dhall here: while Dhall can't guarantee timely normalization Dhall can guarantee timely checking if a term is normalized and you can write a program using the Dhall library (or add a flag to the default Dhall compiler) that r
71.
▲
by
Gabriel439
11y ago
I like to think of Haskell's types as traffic lights. They might get in the way if you're the only driver on the road but the moment you have to deal with other people they are a life saver. That's why people favor Haskell i
72.
▲
by
Gabriel439
11y ago
The title should really be "Stuff that I wish I had quick reference material for when learning Haskell". You might need a few of those sections for specific application areas (and that's how they are organized), but you can
73.
▲
by
Gabriel439
11y ago
`trifecta` is basically produces `clang`-style error messages (i.e. they have the pretty colors, underlined text spans, cursor pointers into the text, and really good error messages indicating the real problem and not some unrelated problem
74.
▲
by
Gabriel439
11y ago
You can optimize in some cases, even when you don't know what the input would be. A great example is the one from the post where `morte` optimizes the function `#and #True` to the identity function on `#Bool`s even though it doesn'
75.
▲
by
Gabriel439
12y ago
Then you can do this: fmap (either id id) (both ...) ... which is equivalent to: x <- both ... return (case x of Left txt -> txt Right txt -> txt) That removes the `Either` tag and fuses them
76.
▲
by
Gabriel439
12y ago
There are two ways you can embed that within `turtle`. You can either embed each step as its own concurrent process, like this: -- Note, the flow is right-to-left, not left-to-right inshell "bar" (inshell "fgrep ..
77.
▲
by
Gabriel439
12y ago
You're welcome!
78.
▲
by
Gabriel439
12y ago
Actually, you can do `grep -r` by just combining `grep` and `lstree`. Here's an example: example = do file <- lstree "some/dir" True <- liftIO (testfile file) grep "Some pattern&
79.
▲
by
Gabriel439
12y ago
The target audience is non-Haskell programmers, and if you don't think the tutorial is good enough to onboard such a programmer then I consider that a bug against the library. I would actually appreciate if people submitted Github iss
80.
▲
by
Gabriel439
12y ago
> How do you easily fork to run a command in the background? `turtle` provides `fork` for running a command in the background. Example usage: example = do using (fork commandToForkInAnotherThread) theseCommandsStil
81.
▲
by
Gabriel439
12y ago
Note that you only need `/usr/bin/env runhaskell` if you want to interpret the script. You can also compile the script as a native binary, which is the recommended approach on Windows.
82.
▲
by
Gabriel439
12y ago
You use `inproc` and `inshell` for piping. For example, here's the type of `inshell`: inshell :: Text -- Shell command -> Shell Text -- Standard input to feed command -> Shell Text -- Stand
83.
▲
by
Gabriel439
12y ago
The only reason I chose `Table` was just not to reuse the word `Map`. I agree that there should be a separate abstraction for unindexed sets of tuples. I probably should have called it `IndexedTable` or something.
84.
▲
by
Gabriel439
12y ago
I work on an internal analytics framework at Twitter. Twitter doesn't use Haskell. The most Haskell I've done there is to write an internal tool in Haskell (A shell-based interface to HDFS). Everybody here knows that it's m
85.
▲
by
Gabriel439
12y ago
I agree. Planescape: Torment was the best RPG ever. I still get chills thinking about it.
86.
▲
by
Gabriel439
12y ago
I was a PhD student in biochemistry, but most of my PhD work was structural bioinformatics because I worked in a protein design research lab. Working on my PhD project is how I got exposed to (and addicted to) Haskell and programming in ge
87.
▲
by
Gabriel439
12y ago
How do I contact you? Can I find you on the #agda channel on IRC?
88.
▲
by
Gabriel439
12y ago
I do plan on writing up a longer example, but I wanted to get the basic idea out there first so that I could just link to it in the follow-up post. The example I'm building up to is quite long and would have easily tripled the size of
89.
▲
by
Gabriel439
12y ago
This is an excellent suggestion. I will take a stab at this, but probably in Idris first if you don't mind. If I succeed then I will write about what I learned.
90.
▲
by
Gabriel439
12y ago
Yeah, the domain name is misleading. It really should be called "Equational reasoning for all". I'm reluctant to change it at this point, but I think I should make more of an effort to clarify that the posts are advocacy fo
More ›