It's time for the GHC weekly news. We've had an absence of the last one, mostly due to a lot of hustle to try and get 7.10 out the door (more on that shortly throughout this post). But now we're back and everything seems to be taken care of.
This week, in the wake of the GHC 7.10 release (which is occuring EOD, hopefully), GHC HQ met up for a brief chat and caught up:
- This week GHC HQ met for only a very short time to discuss the pending release - it looks like all the blocking bugs have been fixed, and we've got everything triaged appropriately. You'll hopefully see the 7.10 announcement shortly after reading this.
We've also had small amounts of list activity (the past 6-8 weeks have been very, very quiet it seems):
- Your editor sent out a call for developers to fill information in on the Status page about what they plan to do. If you're working on something, please add it there! https://mail.haskell.org/pipermail/ghc-devs/2015-March/008661.html
- Herbert Valerio Riedel asked about a possible regression regarding identifiers containing unicode subscripts - but nobody has replied! https://mail.haskell.org/pipermail/ghc-devs/2015-March/008503.html
- Doug Burke chimed in as a new contributor and wrote down some notes on what it took to write his first patch and submit it to us - and we really appreciate the feedback, Doug! https://mail.haskell.org/pipermail/ghc-devs/2015-March/008526.html
- Yitzchak Gale revived a thread he started a while back, which puttered out: bootstrapping GHC 7.8 with GHC 7.10. The long and short of it is, it should just about work - although we still haven't committed to this policy, it looks like Yitz and some others are quite adamant about it. https://mail.haskell.org/pipermail/ghc-devs/2015-March/008531.html
- Neil Mitchell uncovered a nasty bug in GHC 7.10.1 RC3, submitted it to us. He also wrote a fantastic blog post explaining the issue. And it was promply diagnosed, fixed, and taken care of by our own Joachim Breitner. Thank you for the fast response Joachim and Neil! https://mail.haskell.org/pipermail/ghc-devs/2015-March/008532.html
- Mark Lentczner has announced Alpha releases of the Haskell Platform 2015.2.0.0, containing GHC 7.10.1 RC3: https://mail.haskell.org/pipermail/ghc-devs/2015-March/008597.html
- Simon Peyton Jones asks: what's the current state about having simultaneous installations of a package? Simon is a bit confused as to why this is still a problem when we have all the tools to solve it, it looks like! (But read on for more): https://mail.haskell.org/pipermail/ghc-devs/2015-March/008602.html
- Michael Snoyman asks: can we get a new feature patch in GHC 7.10.2? The answer seems to be an unfortunate 'no', but with some tips, Michael may end up backporting the changes from HEAD to GHC 7.10 himself. https://mail.haskell.org/pipermail/ghc-devs/2015-March/008612.html
Some noteworthy commits that went into ghc.git in the past two weeks include:
- Commit 71fcc4c096ec0b575522e4c2d0104ef7a71a13c5 - GHC defaults to using the gold linker on ARM/Android and ARM/Linux targets.
- Commit 9dfdd16a61e79cb03c633d442190a81fe5c0b6b8 - Bump ghc-prim to version 0.4.0.0.
- Commit 42448e3757f25735a0a5b5e2b7ee456b5e8b0039 - GHC HEAD now always looks for LLVM 3.6 specifically.
Closed tickets this past week include: #9122, #10099, #10081, #9886, #9722, #9619, #9920, #9691, #8976, #9873, #9541, #9619, #9799, #9823, #10156, #1820, #6079, #9056, #9963, #10164, #10138, #10166, #10115, #9921, #9873, #9956, #9609, #7191, #10165, #10011, #8379, #10177, #9261, #10176, #10151, #9839, #8078, #8727, #9849, #10146, #9194, #10158, #7788, #9554, #8550, #10079, #10139, #10180, #10181, #10170, #10186, #10038, #10164, and #8976.
Hi, so I'm a little embarrassed to say this, but I'm stuck on a problem that none of the books or video tutorials that I've seen has considered important enough to explain. So I should preface by saying that this is my first programming language. I thought I could hop in by reading some research along with the documentation and wrapping my head around some of the underlying math, but the biggest challenge has been implementation. Since most haskell programmers come from imperative backgrounds, I think they get the bulk of what they need to do on the command line and in the program files. I don't. I have an abstract understanding of the language, which I'm seeing has very little practical value with getting started.
So, here it goes:
I downloaded ghci, and I load it by going to my program files, and double clicking the ghci 7.8.3 application. It loads, and I'm on the command prompt. My problem is that though I can add numbers and things like that, I can't seem how to load 'scripts' or how to save them or where to save them to. My guess so far is that I save them into 'bin'. I'm not sure how I would have to preface these files. Do I put 'main' in a text file and save it as .hs into the bin folder?
To compound my confusion, I downloaded the Eclipse IDE (eclipseFP), and so far have everything other than hoogle, though I'm still trying to figure out how eclipse 'connects' with ghc. I did this because I could not figure out how to install cabal or hoogle just from the command line. I read that this was one of the things I needed to do in order to start. Can anyone clarify these super basic things for me?
The loading of files, the idea of a 'script', these are the things racking my brain. Please help!submitted by onenode
[link] [13 comments]
I understand that you shouldn't use tab because of how the compiler and text editor defines what a tab is, but I've not used tab, I've used ten spaces. What gives?submitted by KatanaMaster
[link] [8 comments]
So here's the commonest way to represent the western chromatic scale: data Note = A | As | B | C | Cs | D | Ds | E | F | Fs | G | Gs deriving (whatever you like)
This is the approach used here.
However, this means that I'm going to have things like this:
majorScale F -- returns F G A A' C D E
For anyone who knows at least the little music theory that I do, you know that this is a misspelling of F major.
I need show (or some other function I write) to return different things depending on the context, i.e. f Gs needs to say either G# or Ab.
How do I go about "structuring" the whole thing? I don't even want my data Note declaration to use either the sharp or flat representation - no "bias", as it were. Any ideas?submitted by octatoan
[link] [20 comments]
I've been struggling with this for a couple weeks. The lam2db function works fine. It can be called as follows: lam2db (Lam 0 (Lam 1 (Var 0)))
I'm trying to get the db2lam and isClosed functions working, but I've hit a brick wall. In its current state, it's complaining about a naked expression.data Term = Var Int | Lam Int Term | App Term Term deriving (Eq, Show, Read) data BTerm = BVar Int | BLam BTerm | BApp BTerm BTerm deriving (Eq, Show, Read) lam2db :: Term -> BTerm lam2db x = f x  where f :: Term -> [Int] -> BTerm f (Var x) vs = BVar (1 + vs !! (fromIntegral x)) f (App x y) vs = BApp (f x vs) (f y vs) f (Lam v y) vs = BLam a where a = f y (v : vs) --Example Test Data -- lam2db (Lam 0 (Lam 1 (Var 0))) db2lam :: BTerm -> Term db2lam x = f x 0  where -- or, instead of , list of free vars f :: BTerm -> Int -> [Int] -> Term f (BVar i) _ vs = Var (at i vs) f (BApp a b) v vs = App x y where x = f a v vs y = f b v vs f (BLam a) v vs = Lam v y where y = f a (v+1) (v:vs) at (x:_) 0 x at i (_:xs) = at (i-1) xs isClosedB :: BTerm -> Bool isClosedB t = f t 0 where f (BVar n) d = n < d f (BLam a) d = f a (d + 1) f (BApp x y) d = f x d && f y d isClosedS :: Term -> Bool isClosedS = isClosedB . lam2db
Note: commenting out the line at (x:_) 0 x allows the program to compile and you can run the lam2db function.submitted by Shoggoth269