4 ms·
Are there any examples of Haskell being used to do anything really cool and useful to the average programmer. To me it seems as an esoteric language that I woul
by x5n1 11y ago
Are there any examples of Haskell being used to do anything really cool and useful to the average programmer. To me it seems as an esoteric language that I would simply not bother using because no one uses it and deploying it would be a headache.
- tdees40 11y agoYes. https://wiki.haskell.org/Haskell_in_industry https://wiki.haskell.org/Haskell_in_industry
- merijnv 11y agoEh...xmonad and pandoc are pretty popular projects, both written in haskell
- fho 11y agoTo be honest: not everybody is into tiling window managers (xmonad). But I use pandoc regularly ... as in almost every day.
- platz 11y agoThis was in the "news" just today: Haskell-based Bicycle Parking Guidance System in Utrecht: http://www.reddit.com/r/haskell/comments/3959r0/haskellbased_bicycle_parking_guidance_system_in/ http://www.reddit.com/r/haskell/comments/3959r0/haskellbased...
- psibi 11y agoNote that you can translate the skills you learn from Haskell to other languages. The way I write code in Python and Javascript for my day job has drastically changed after I have learned Haskell.
- icebraining 11y agoDo you have any good examples (yours or otherwise) of Haskell-inspired Python code?
- psibi 11y agoThe major change which I see is how the Python code becomes more pure. Using code which are side effect free gives me the ability to easily reason about them. I can jump in the code even after many months and easily understand them without trying hard. Using function composition to glue things makes complex system very simple.
- danidiaz 11y agoI occasionally use the "diagrams" library to, well, draw diagrams: http://projects.haskell.org/diagrams/gallery.html http://projects.haskell.org/diagrams/gallery.html https://www.youtube.com/watch?v=5_fCUSOn7m0 https://www.youtube.com/watch?v=5_fCUSOn7m0
- Dewie3 11y agoIt seems like you already know the answer to your question. There are plenty of other programming-related things to learn besides programming languages, if you don't want to learn (esoteric?) programming languages. Enough to keep you busy for a lifetime.
- akurilin 11y agoWe use Haskell for most of our backend (and hopefully frontend soon) work at Front Row: http://www.kurilin.net/post/117369543198/haskell-at-front-row http://www.kurilin.net/post/117369543198/haskell-at-front-ro...
- qbit 11y agoIf you don't mind answering, which Haskell frontend are you planning to use?
- akurilin 11y agoI'm hoping that we can find a GHCJS-based FRP solution at some point soon. I've seen Elm in action, and it's pretty neat, same with Purescript, but I'd rather stay within legitimate Haskell for the time being.
- codygman 11y ago> I'm hoping that we can find a GHCJS-based FRP solution at some point soon. Have you tried Reflex (also there is a try-reflex[1])? Purescript generates really concise javascript code, have you checked out Thermite[2]? 0: https://github.com/ryantrinkle/reflex https://github.com/ryantrinkle/reflex 1: https://github.com/ryantrinkle/try-reflex https://github.com/ryantrinkle/try-reflex 2: https://github.com/paf31/purescript-thermite https://github.com/paf31/purescript-thermite
- codygman 11y ago> Are there any examples of Haskell being used to do anything really cool and useful to the average programmer. https://code.facebook.com/posts/302060973291128/open-sourcing-haxl-a-library-for-haskell/ https://code.facebook.com/posts/302060973291128/open-sourcin... More here: https://www.fpcomplete.com/business/haskell-industry/ https://www.fpcomplete.com/business/haskell-industry/ https://medium.com/@folsen/haskell-in-production-bdellium-1df48de40e19 https://medium.com/@folsen/haskell-in-production-bdellium-1d... > I would simply not bother using because no one uses it and deploying it would be a headache. It's just a binary you can run on a server? There is also Halcyon: https://halcyon.sh/tutorial/ https://halcyon.sh/tutorial/
- mightybyte 11y ago"really cool and useful to the average programmer" is pretty vague and hard to answer. But I'd say that it absolutely does. Namely the ability to build things with less code and have them be MUCH more maintainable in the long run because of strong static types and purity. Case in point: one company ported a 43k line Groovy app to 8200 lines of Haskell [1]. The resulting Haskell app also was at least 64x faster and eliminated a number of major bugs with the Groovy system. If that's not "really cool and useful to the average programmer", then I don't know what is. But this is just the tip of the iceberg. Haskell has an awesome library called diagrams [2] for the construction of declarative graphics. It can construct some impressively complex images with a remarkably small amount of code [3]. The pandoc universal document converter [4] is written in Haskell. There's also the classic paper comparing Haskell, Ada, C++, and Awk [5]. I'm sure there are other really cool and useful things that I'm forgetting. [1] https://www.youtube.com/watch?v=BveDrw9CwEg#t=1207 https://www.youtube.com/watch?v=BveDrw9CwEg#t=1207 [2] https://www.youtube.com/watch?v=5_fCUSOn7m0 https://www.youtube.com/watch?v=5_fCUSOn7m0 [3] http://projects.haskell.org/diagrams/gallery.html http://projects.haskell.org/diagrams/gallery.html [4] http://pandoc.org/ http://pandoc.org/ [5] http://haskell.cs.yale.edu/wp-content/uploads/2011/03/HaskellVsAda-NSWC.pdf http://haskell.cs.yale.edu/wp-content/uploads/2011/03/Haskel...
- Peaker 11y agoTo add a couple of fun points about Haskell: * QuickCheck! Imagine you implement some function. As a trivial example, let's say you wrote a plus operator (spelled as (+) when not being applied). One of the properties it should have is associativity. To check whether it is associative, you can write (in the GHCI repl): > import Test.QuickCheck > let associative op x y z = (x `op` y) `op` z == x `op` (y `op` z) > quickCheck $ associative (+) +++ OK, passed 100 tests. QuickCheck just applied our "associative" function with 100 various random triplets and made sure that (+) behaved associatively in all the examples. Now, the (-) operator is of course not associative, so let's see what QuickCheck says about that: > quickCheck $ associative (-) *** Failed! Falsifiable (after 2 tests and 1 shrink): 0 0 1 QuickCheck now spells out a simple example triplet (x,y,z = 0,0,1) which breaks the associativity claim. This kind of testing is called "property testing" and is an awesome way to test pure functions that finds bugs far more easily (and more thoroughly) than traditional UTs. For more "real-worldy" examples, consider QuickChecking that your URL parse function is reversible (build back a URL from the parsed components). Ditto with any kind of parser/builder or [de-]serializer. Most pure functions are expected to obey various laws, and QuickCheck is a great way to verify they do. * Parallelism annotations! Sprinkling `par` annotations on your code (or replacing `map` with `parMap`) is guaranteed not to change the semantics of your program. It may speed up (due to extra parallelism) or slow down (due to extra overhead), but it is safe to throw it around. * Type safety No null dereference errors (though this is finally getting to some mainstream language). Exhaustive handling of all inputs can easily be verified by the compiler. Data types that describe your data precisely and yet more concisely declared than imprecise data types in other languages. Advanced features allowing to use the type checker to get more compile-time assurances (e.g: Red Black Tree respects all the RB invariants). * Expressiveness The kind of abstraction power Haskell gives you is quite unique. A nice example of this is shown in: http://www.haskellforall.com/2013/05/program-imperatively-using-haskell.html http://www.haskellforall.com/2013/05/program-imperatively-us... fireBreath target = do lift $ putStrLn "*rawr*" units.traversed.(around target 1.0).health -= 3 This updates the game state by traversing all the units whose distance from target <= 1.0, and subtracts 3 from their health. This kind of expressive power is based on library-level abstractions (here, the lens library) with no language support or even macros.
- 11y ago
- codygman 11y agoYou would probably also be interested in my answer to another Haskell skeptic: https://news.ycombinator.com/item?id=9686845 https://news.ycombinator.com/item?id=9686845