I just made a little library for parsing bower.json files in Haskell. I'd appreciate any feedback:hdgarrood
[link] [5 comments]
Basically, I've written a small library mimicking the functionality of [Control.Concurrent.Async][http://hackage.haskell.org/package/async-2.0.2/docs/Control-Concurrent-Async.html], with a few notable differences.
I'm currently calling this library Control.Concurrent.FutureIO and this is currently how I plan to submit the package to Hackage. Currently, there are only two functions that exist as a part of the API, async :: IO a -> FutureIO a and await :: FutureIO a -> IO a, instead of Async' s functions async :: IO a -> IO (Async a) and wait :: IO (Async a) -> IO a.
The benefit of my implementation (in my eyes) is that FutureIO is an instance of the Functor/Applicative/Monad classes and it composes neatly. For instance, the following code will only take ~1s instead of 3s to complete.wait1s = threadDelay 1000000 slowMulti = async $ wait1s >> return (*) slowProd1 = async $ wait1s >> return 42 slowProd2 = async $ wait1s >> return 24 await $ slowMulti <*> slowProd1 <*> slowProd2
Ignoring this incredibly trivial example, in my eyes this has a pretty strong benefit over the Control.Concurrent.Async package. My question is "Is there a better way for me to submit this than just under the FutureIO moniker?"
*(note: As a Haskell newbie, I'm fully aware that this could be dumb, redundant, etc. and I would love it if you told me so I could learn)submitted by cghio
[link] [10 comments]
It's been a few weeks since the last news bulletin - your editor apologizes about that. It's actually been a relatively slow few weeks here too, and busy-ness outside of GHC has attracted some of my attention. Despite that, GHC 7.10.1 was released, a new HP alpha is out, and things are moving along smoothly. Now that the release is done, things are quitely moving along in HEAD - with people committing code with reckless abandon, of course.
This week, GHC HQ met up, but it's been very light since the 7.10.1 release. Currently there isn't anything pushing us to do a 7.10.2 release at least for a few more weeks it looks like - but see below.
- We puzzled a bit about the release status of 7.10.2, and thought: it's only holding up people who are depending on it. So, who's depending on it, and what do they need fixed? See below for more.
- We also talked a bit about performance - it seems the compiler has been getting much slower over time since the 7.8.x release series, and it's time to reign it in. Austin will be spending his week investigating a bit of this, and the causes.
So, you may be wondering when the 7.10.2 release is. The trick is it happens when you tell us it should happen!
So far, taking a look at milestone:7.10.2, we've fixed about half the bugs we currently have marked down to fix. But we're probably going to punt some of those - and we're not sure all the ones that are there should be.
So this is a call: If you need something to be fixed during 7.10.2, please file a ticket, set the milestone, and alert us. The sooner the better, because it'll inform us as to when we should release. Emailing firstname.lastname@example.org is also a sure-fire way to get our attention.
And remember: you can always find out the latest about the next release at the Status page (in this case, for 7.10.2) - https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-7.10.2Call for help: DocBook to AsciiDoc
The GHC team needs some help. A few months ago, we put out a poll to convert our DocBook-based manual to AsciiDoc.
The poll had a mostly lukewarm reception, with the idea that it will A) make life easier for people who frequently modify the users guide, and B) make life easier for people who add things irregularly, as a lower barrier to entry.
It looks like we still want to do this - but alas, many of us don't have time!
So, we're asking the public: Is anyone willing to step up and help here? For example, it may be possible to get a long ways with just pandoc, but we need someone to finish it - and in return, we'll help along the way!List chatter
- Austin Seipp announced GHC 7.10.1. https://mail.haskell.org/pipermail/ghc-devs/2015-March/008700.html
- Mark Lentczner announced an alpha Haskell Platform release. https://mail.haskell.org/pipermail/ghc-devs/2015-March/008724.html
- David Macek announced MSYS2 packages for GHC on Windows, and also asked for some help with continuous windows building - Windows hackers should help out! https://mail.haskell.org/pipermail/ghc-devs/2015-March/008735.html
- Jan Stolarek reports about increased memory usage with GHC 7.10.1. https://mail.haskell.org/pipermail/ghc-devs/2015-April/008751.html
- Thomas Miedema chimed into a thread started by Karel Gardas about better parallelizing the GHC build - and hopefully we can get something good out of it. https://mail.haskell.org/pipermail/ghc-devs/2015-April/008749.html
- Austin Seipp made a call for help on working on and improving the GHC homepage, and luckily Sergey Bushnyak answered the call and has helped out! https://mail.haskell.org/pipermail/ghc-devs/2015-April/008762.html
- Ozgun Ataman kicked off a thread about slower compilation times, with some nasty numbers. It's becoming more clear compiler performance should be a priority for 7.12, and we've let some things slip away from us: https://mail.haskell.org/pipermail/ghc-devs/2015-April/008766.html
- A GHC user, Dave, asked the list about some questions with Cross Compilation, as he's attempting to get GHC to work natively inside the Open Embedded build environment. Unfortunately, things haven't been going well so far, and any input from enterprising hackers is appreciated: https://mail.haskell.org/pipermail/ghc-devs/2015-April/008774.html
- Dan Aloni has started a discussion about improving GHC's error messages, spurred by a popular blog post he wrote and posted on Reddit about some Happy/GHC improvements he's made. This is a difficult area (error messages in general are hard) to work on, so thanks to Dan for helping! https://mail.haskell.org/pipermail/ghc-devs/2015-April/008778.html
- Simon Peyton Jones started a discussion about GeneralizedNewtypeDeriving and Safe Haskell, in particular, whatever the current status, our documentation doesn't accurately reflect it! Perhaps someone could help out writing the documentation based on the current status quo? https://mail.haskell.org/pipermail/ghc-devs/2015-April/008783.html
- Tamar Christina started a thread about replacing ghc-split, an old Perl script inside GHC, but he wanted to know: what do we do about a regex replacement? Mikhail Glushenkov spoke up about a similar decision the LLVM developers used: to use the OpenBSD regex implementation. https://mail.haskell.org/pipermail/ghc-devs/2015-April/008785.html
- Alan Zimmerman has posted several questions and threads about the parser and the status of API annotations, which he's been furiously working on now that GHC 7.10 is being used on Hackage. Interested onlookers could learn a thing or two! https://mail.haskell.org/pipermail/ghc-devs/2015-April/008782.html & https://mail.haskell.org/pipermail/ghc-devs/2015-April/008787.html & https://mail.haskell.org/pipermail/ghc-devs/2015-April/008794.html
- Gabor Greif has a question about some seemingly strange behavior regarding the interaction between poly-kinded data types and overlapping instances. Richard sez: this behavior is expected. https://mail.haskell.org/pipermail/ghc-devs/2015-April/008804.html
- Commit de1160be047790afde4ec76de0a81ba3be0c73fa - refactor the story around switch cases (with a code-size improvement)
- Commit 995e8c1c8692b60c907c7d2ccea179d52ca8e69e - drop old integer-gmp-0.5 source code.
- Commit 59f7a7b6091e9c0564f3f370d09398d8c9cd8ad5 - Restore unwind information generation (fixes DWARF generation)
- Commit 9f0f99fd41ff82cc223d3b682703e508efb564d2 - Fix an old bug in the demand analyzer (with some nice compiler performance boosts).
- Commit a7524eaed33324e2155c47d4a705bef1d70a2b5b - Support for multiple signature files in scope (Backpack).
#10222, #10219, #8057, #10226, #10220, #9723, #10230, #10208, #10236, #10213, #10231, #10240, #10243, #10237, #10224, #8811, #10197, #10252, #9958, #10253, #8248, #10207, #10214, #9964, #10194, #10251, #10188, #10257, #10247, #10247, #9160, #10259, #9965, #10265, #10264, #10286, #10282, #10290, #10291, #10300, #9929, #8276, #10218, #10148, #10232, #10274, #10275, #10195, and #10233.
I pushed a pull request to Edward Kmett’s either package to implement two functions some guys was complaining not to find: flipEither :: Either e a -> Either a e and flipEitherT :: EitherT e m a -> EitherT a m e.
When implementing the functions, I wondered: “Hey, flipping stuff is a pretty common operation. Don’t we have an abstraction for that yet?”. I haven’t found any.Meet Swap
I decided to make a little typeclass to see what it’d be.class Swap s where
swap :: s a b -> s b a
instance Swap (,) where
swap (a,b) = (b,a)
instance Swap Either where
swap = flipEither
-- let’s go wild and fooled
instance Swap Map where
swap = fromList . fmap swap . toList
If you think that’s handy, I’ll write a little package with default instances to make it live.
Happy hacking folks!
Like many of our tools, after some internal development, we're now releasing it open source here at: stackage-view.
It looks like this:
The README documents the features, but here's a quick rundown:
- Go to definition: You can double-click any identifier to jump straight to the definition.
- Type information of any expression or pattern binding. Just click any identifier to see its type. Alternatively, you can select an expression to see the type of that. Hitting the <-> expansion button will expand the selection to a parent node.
The first purpose behind the tool was to target general teams of people who may not all be using the same tooling (Haskellers are like cats, they prefer to do their own thing!), some users may be on Emacs, Vim, or Sublime, FP Eclipse, Leksah, etc. whereas this read-only tool serves as a way to inspect a codebase with handy information and jumping available.
The second purpose was to serve as a demonstration and acid test for our combination GHCJS and React library ghcjs-react. It makes for a nice simple-but-non-trivial demonstration of the library. There is real-world state handling going on, interacting with third-party APIs (aside from React itself, the Ace editor).
It also serves as a demonstration of using ide-backend programmatically. If you look in the source of stackage-view you'll see it's quite straight-forward to use. To build it, you will need the Git version of ide-backend found here. Currently it cannot be uploaded to Hackage due to an issue with the -dynamic flag.