1,024 karma · joined Feb 10, 2017 (9y ago) · 394 submissions
Bootstrapping a micro-SaaS business.
Twitter: @tobebuilds Blog: https://tobebuilds.com
comment 3y ago · link · parent
That's something I'm looking into doing myself. It would be great to help improve tools like cabal and the haskell-language-server.
I think that will go a long way towards making Haskell more beginner-friendly, and easier to use in production.
comment 3y ago · link · parent
This isn't a problem if you're the one writing the function, but if you're using a 3rd party library that doesn't know about your monad, then fmap can be very useful.
comment 3y ago · link · parent
1. Being within the same monad. For example, you can `bind` a `Parser a` to a function only if it returns `Parser b`.
2. Performing an actual action and breaking it out of its monad.
For example, if you're using the Parsec library, and you have a `Parser Int`, you can't get to that int without using a function like `parse`, performs the actual action of parsing input text.
With a functor, you can compose a `Parser a` within an `a -> b` function, instead of having to return `Parser b` in your function.
So if you have a `Parser Int`, and you want to turn it into a parser that multiplies its parsed input by 2, you can write `fmap (*2) myParser`, instead of having to write `myParser >>= \a -> return (a * 2)`.
Parsers being functors means it's easier to compose them with other things, without having to actually perform the parse until you need to.
comment 3y ago · link · parent
After reading this article, the conclusion I drew was, "Cool, so I can `fmap` over my parser now and transform what I parse using functions."
To answer your other questions: I'm not sure it means much for the code that does the actual parsing, nor how you specify the grammar's rules, it's more about being able to transform the output using functions.
If your static analyzer is a function, you could now write `fmap staticAnalyzer myParser`.
comment 4y ago · link · parent
I love functional programming, but I doubt most companies that sell CRUD apps care about it.
9.
Ask HN: Which tech newsletters are you reading?
3 points · by thosakwe · 4y ago · 4 comments
comment 5y ago · link · parent
I could be misunderstanding something.
comment 5y ago · link · parent
comment 5y ago · link · parent
As for the second part: someone simply choosing to be a police officer doesn't mean they should be demonized. Complying with the "blue wall of silence" by refusing to take an active stand against police misconduct, however, I believe warrants public backlash. The thing is, far too many officers are content to not say anything. And that is a large part of why they have seen more backlash recently.
comment 5y ago · link · parent
Anyways:
The fact that most modern countries have police is not evidence that police departments are necessary.
In addition, the article is about the American police, which are notorious for their history of racial profiling, cover-ups, and numbers of civilian shooting deaths every year. Does most modern countries having police mean this is justified behavior?
If you could, please provide a link to a survey or study indicating that people who live in "high-crime" areas want more police.
And even if they did, that doesn't change the reason for the widespread backlash against police in the United States. It's not simply people "demonizing" a profession (which again, people choose to work in).
comment 5y ago · link · parent
Are you sure? Lots of causes for crime (i.e. poverty) can't be solved by arresting or shooting people. I am convinced that part of the reason police reform is so difficult in the United States is that most people have never questioned neither the history of American policing (which started as slave patrols in many states), nor the necessity for heavily-armed police at all.
> If they have no repercussions for bad actions, then implement them.
This is not so easy, when both of the parties with political control in the U.S. receive donations from the prison industry...
EDIT: Lastly, in reference to your original point, the argument that police officers are being simply "demonized" is missing the bigger picture. Police aren't individual actors - they protect each other, even when they have crossed a line. And it's all by choice.
comment 6y ago · link · parent
As for the goal, I just want to finish it for now. I don't intend to publish packages in Bullseye, rather just to use it in projects to consume existing Dart libraries.
comment 6y ago · link · parent