O
Oliver Charles
ocharles.org.uk · Personal blog · on HN since 2012
Oliver Charles is a Haskell developer who writes about Haskell, GHC extensions, and development with Nix.
What HN saysHN commenters recommend his 24 Days of GHC Extensions series as great and link his Nix development guide, which one finds a nice explanation.
45HN people shared it
24linked it in comments
43stories submitted
578story points
7 years agolast shared
2012people per year2026
Most-shared posts
- 1How I develop with Nix7 people · 150 points · first shared 2014 · 55 comments on HN
- 224 Days of GHC Extensions6 people · 7 points · first shared 2014 · discussion on HN
- 3Realtime statistics of Haskell programs4 people · 60 points · first shared 2012 · 4 comments on HN
- 4Blog4 people · first shared 2013
- 5Asteroids & Netwire3 people · 3 points · first shared 2013 · discussion on HN
- 6Self-Memoizing HTML Rendering via Mutually Recursive Data Types2 people · 67 points · first shared 2014 · 3 comments on HN
- 7Tic-tac-toe in Haskell2 people · 3 points · first shared 2013 · discussion on HN
- 824 Days of GHC Extensions: View Patterns2 people · 2 points · first shared 2014 · discussion on HN
- 9Haskell: introducing the Contravariant and Profunctor type classes2 people · 2 points · first shared 2014 · discussion on HN
- 10Persistent & esqueleto — querying databases in Haskell2 people · 2 points · first shared 2013 · discussion on HN
- 11Who Authorized These Ghosts?2 people · 1 points · first shared 2019 · discussion on HN
- 122014 12 23 static pointers2 people · first shared 2015
- 13Monad transformers, free monads, mtl, laws and a new approach1 people · 95 points · first shared 2016 · 4 comments on HN
- 1424 Days of Hackage: pandoc1 people · 64 points · first shared 2013 · 11 comments on HN
- 15Solving Clasical AI Planning Problems with Fast Downward and Haskell1 people · 62 points · first shared 2018 · 2 comments on HN
What HN people wrote when they linked it
thinkpad20 · 2015-05-11
I don't use Nix with Haskell myself yet, because I haven't been doing much Haskelling recently. But I do use it with Python and it's really excellent to use once you start to "get it." Skimming this guide, it seems to do a nice job of explaining Nix as applied to Haskell development[0]. And I'm sure there are many other resources, since it seems to have some traction in that community. I don't know much about the other options you mentioned, but one of the really nice things about Nix is that it's language-independent, which makes it just as easy to express Haskell package dependencies as it is to express any arbitrary dependency (e.g. a foreign library you're linking against).
[0]: https://ocharles.org.uk/blog/posts/2014-02-04-how-i-develop-with-nixos…
draegtun · 2015-03-17
Nice. Here's one I always remember (written in Haskell) - https://ocharles.org.uk/
OCharles originally did it in Perl/Moose and with a module of mine (Acme::URL) which is how I stumbled across the CV in the first place - https://web.archive.org/web/20120119150530/http://ocharles.org.uk/
efnx · 2014-12-22
For folks looking to learn more about GHC's extensions, Ollie Charles is currently doing a great "24 Days of GHC Extensions" series. https://ocharles.org.uk/blog/pages/2014-12-01-24-days-of-ghc-extension…
progman · 2014-10-20
You have misunderstood me.
I know cabal - with and without sandbox. I said am amazed that sandboxes or nix tools are necessary in Haskell _at all_ while every other language which uses a package manager has one that works out of the box without any hassle and without any sandbox tricks.
> Nix and NixOS are two completely unrelated projects, that not even be recommendable in a development environment.
Other Haskell developers don't agree. They prefer nix even over cabal sandboxes. Quote: "Nix helps me avoid Cabal hell" and "Nix is much better than cabal sandbox".
https://ocharles.org.uk/blog/posts/2014-02-04-how-i-develop-with-nixos…
mutagen · 2014-03-17
I'm curious about this as well so I did some searching.
Fay[1], a subset of Haskell that compiles to JavaScript, seems to be the primary choice. There are DOM and jquery bindings for it and this blog post[2] looks like a great introduction.
There are other options, this [3] article outlines a number of them as a greater overview of both server and client side programming with Haskell. I also found an intriguing article [4] on the Haskell site but it appears to be out of date, referencing libraries that are no longer in development.
[1]https://github.com/faylang/fay/wiki
[2]http://ocharles.org.uk/blog/posts/2013-12-23-24-days-of-hackage-fay.ht…
[3]http://www.stephendiehl.com/posts/haskell_web.html
[4]http://www.haskell.org/haskellwiki/Haskell_in_web_browser
ocharles · 2013-12-13
I spent some time writing Asteroids in netwire - a functional reactive programming library in Haskell - in my free time over a few evenings. I blogged about this at http://ocharles.org.uk/blog/posts/2013-08-18-asteroids-in-netwire.html - and I don't think it pretends to be OO. It was a radically different style, and I left feeling fairly convinced that FRP is a fantastic model for realtime interactions
nlander · 2017-02-17
I strongly recommend that you learn Haskell.
I have some reasons to back up my endorsement of Haskell.
First and foremost, Haskell is the best language to learn if you want to learn about functional programming. Why? Because Haskell is the quintessential functional programming language. It is approaching 30 years of age and was originally developed back when functional programming was nowhere to be found in production settings. A bunch of academics who were all working on separate functional programming languages got together and said, “hey, how about we all work together and make the ultimate FP language rather than reinventing the wheel on our own?” And that’s exactly what they did. The result today is a very mature, feature rich and programmer-friendly language. If you really want to delve into the history of Haskell, check out this paper or watch the video based on it:
https://www.microsoft.com/en-us/research/publication/a-history-of-hask…
The second reason to learn Haskell is that it is a great language for doing the things you want to do. A prominent Haskeller, Gabriel Gonzalez, estimates that Haskell is mature in the domain of server-side web development. Check out his view on the state of the Haskell ecosystem:
https://github.com/Gabriel439/post-rfc/blob/master/sotu.md#server-side…
Writing CLI programs is also rated…
freshhawk · 2013-03-05
I love haskell but I wish there was less blogging about why everyone else should use it and more building things that will make people want to use it.
The community is extraordinarily friendly to beginners, as long as you only count how they interact with beginners. If you count having resources that allow beginners to figure something out without having to ask then they are extraordinarily unfriendly.
If I find a potentially interesting library on hackage I'm no longer surprised to find it has no documentation at all, certainly no usage documentation or explanation of what it actually does or what it should be used for. Just code and autogenerated API docs. I'm surprised if there is anything that would allow me to actually use it. I'm not often surprised this way.
That and the wild west, "not invented here", multiple incompatible implementations of new ideas used in different important libraries (iteratees at the moment).
Not trying to throw blame around of course, but people probably don't need your "I have a new metaphor for monads" blog post or an argument for why it's worth learning. People need more posts like the 24 Days of Hackage(http://ocharles.org.uk/blog/) series and the Real World Haskell book and they need some brave person to try and convince those amazing library developers to standardize on an imperfect solution a little sooner and for a little longer (only in public of course).
chrisdone · 2019-11-08
Ghost of Departed proofs provides a fairly trivial way to generate proofs from arbitrary code and track them in the type system. See this article for example: https://ocharles.org.uk/blog/posts/2019-08-09-who-authorized-these-gho…
This post shows a simple "positive" assertions, without any combinatorial logic associated with the proofs. But this is similar to programming by contracts.
codygman · 2017-11-02
> Static types are not powerful enough to cross remote boundaries.
?
Is this related:
https://ocharles.org.uk/blog/guest-posts/2014-12-23-static-pointers.ht…
todd8 · 2017-08-01
I'm sorry, I don't understand or maybe I wasn't clear. These extensions change the meanings (semantics and syntax) of Haskell programs accepted by the compiler. A program which would normally terminate using Haskell's ordinary lazy semantics might not terminate when using the Strict extension that changes the default semantics to less lazy.
As far as I can tell from blogs like [1], the other language extensions also change the language in ways that are not forward and backward compatible with out-of-the-box Haskell.
[1] https://ocharles.org.uk/blog/
rnhmjoj · 2016-09-16
The Nix manual is a good start: http://nixos.org/nix/manual/#chap-quick-start
Then there are a lot tutorial about setting up a development environment for a particular language. See:
go: http://lethalman.blogspot.it/2015/02/developing-in-golang-with-nix-pac…
haskell: https://ocharles.org.uk/blog/posts/2014-02-04-how-i-develop-with-nixos…
python: http://datakurre.pandala.org/2015/10/nix-for-python-developers.html
node.js: http://sandervanderburg.blogspot.it/2014/10/deploying-npm-packages-wit…
I recommend reading Luca Bruno's blog for learning Nix internals and more advanced topics.
avindroth · 2016-08-15
I hear NixOS (linux distro based on functional principles) solves the package management problem for Haskell.
* https://ocharles.org.uk/blog/posts/2014-02-04-how-i-develop-with-nixos…
* https://www.reddit.com/r/haskell/comments/1vghgw/nixos_a_gnulinux_dist…
* https://nixos.org/~eelco/pubs/nixos-jfp-final.pdf
* http://fuuzetsu.co.uk/blog/posts/2014-06-28-My-experience-with-NixOS.h…
chriswarbo · 2015-09-09
I've been teaching myself Template Haskell recently, and found https://ocharles.org.uk/blog/guest-posts/2014-12-22-template-haskell.h… to be a really understandable explanation. It specifically doesn't cover quasiquotation, but it has many links to things which do.
mintplant · 2015-01-19
Not to bombard you with too much at once, but one interesting CloudHaskell-related extension that's landing in GHC 7.10 is Static Pointers: safe references to "static" code (constant values, functions, etc.) that can be passed between running instances of a program.
https://ocharles.org.uk/blog/guest-posts/2014-12-23-static-pointers.ht…
tel · 2015-01-07
I thought Ollie had a blog post about this stuff somewhere, but I can't find it now. He does other things which involve fairly advanced GADT work, though
https://ocharles.org.uk/blog/posts/2014-06-10-reversible-serialization…
qubitcoder · 2014-12-11
The solution in Haskell is quite clean, I believe.
fizzBuzz n
| n `mod` 15 == 0 = "FizzBuzz"
| n `mod` 3 == 0 = "Fizz"
| n `mod` 5 == 0 = "Buzz"
| otherwise = show n
main = mapM_ (print . fizzBuzz) [1..100]
I agree with you about generalizing pattern matching for less simple cases. Your example brought to mind view patterns, about which Oliver O'Charles had a nice writeup recently [1]. Nifty little extension.
[1] https://ocharles.org.uk/blog/posts/2014-12-02-view-patterns.html
stusmith1977 · 2014-04-10
I've found the "24 Days of Hackage" series incredibly useful - each day is a brief introduction to a useful Haskell library, many of which show off features of Haskell that aren't available in 'standard' languages. Even better, each one comes with working example source on GitHub, so you've got a starting point if you do want to experiment.
http://ocharles.org.uk/blog/
(I'm a Haskell beginner, currently experimenting with using Scotty, Persistent and Esqueleto to make a web API - and these articles have been so useful to me - I'm finally getting my head around monad transformers, using them to extend the standard Scotty one. Proud moment for me.)
joehillen · 2014-03-26
Except in Haskell you can build ekg right into your server. http://ocharles.org.uk/blog/posts/2012-12-11-24-day-of-hackage-ekg.htm…
gnuvince · 2013-12-07
For those interested, ocharles is talking about Theorems for Free![1] by Phil Wadler. Also be sure to check out his 24 Days of Hackage 2013.
[1] http://ttic.uchicago.edu/~dreyer/course/papers/wadler.pdf
[2] http://ocharles.org.uk/blog/pages/2013-12-01-24-days-of-hackage.html
Peaker · 2013-01-22
Two years ago the situation was far worse, dependency-hell-wise.
About hooking up the process for some profiling information, take a look at:
http://ocharles.org.uk/blog/posts/2012-12-11-24-day-of-hackage-ekg.htm…
evincarofautumn · 2016-11-03
> Putting too many functions that are relatively complex in the where clause is a bad idea, because you lose the explicit type signature…
Note that it’s possible to give type signatures for definitions in “where” clauses:
twice :: Int -> Int
twice x = two * x
where
two :: Int
two = 2
However, you may need the ScopedTypeVariables extension[1] in order to be able to express the correct type signature. (This extension will probably be standardised at some point.)
The biggest real problem I’ve found with large “where” clauses is that they tend to have a lot of implicit dependencies on variables from the enclosing scope. Sometimes you want that for convenience, readability, or performance, but lifting local definitions out into top-level definitions can also help make them more explicit and reusable.
[1]: https://ocharles.org.uk/blog/guest-posts/2014-12-20-scoped-type-variab…
lukexi · 2013-08-29
Howdy!
I've been using https://github.com/jspahrsummers/ObjectiveHaskell/ as my bridge between the two worlds (with some modifications for iOS that I'll be posting soon). Haskell has a wonderful FFI that lets you easily call C/Objective-C from Haskell and vice versa.
There's also Manuel Chakravarty's extremely exciting "Inline Objective-C" project (coming soon) that allows you to embed Objective-C code directly into Haskell, which would make it nearly effortless to speak fluently with Apple's frameworks.
https://gist.github.com/mchakravarty/4632567
There are tons of awesome Haskell FRP implementations, from Netwire to Elerea to Reactive-Banana:
http://ocharles.org.uk/blog/posts/2013-08-18-asteroids-in-netwire.html
It would also be a lot of fun to get Helm running on iOS once they finish their OpenGL backend.
http://helm-engine.org
I definitely couldn't have pulled off my own project (SpaceTime, a multiplayer app engine for iOS; announcement soon) without Haskell. I've been using the development versions of GHC iOS to build it for over a year and it's been a joy.