merijn 2017-03-02 03:45:12
oh, dunno about platform
merijn 2017-03-02 03:45:23
I just install GHC + cabal
c_wraith 2017-03-02 03:45:26
if you're doing your own setup, why care about the platform?
c_wraith 2017-03-02 03:45:33
Just install what's actually needed
iainhallam 2017-03-02 03:46:34
Because we have a bunch of lecturers who know that their teaching works with platform, and otherwise we'd have to maintain a separate list of requirements for teaching every course, which will cause a lot more work in testing each time.
iainhallam 2017-03-02 03:47:11
Given that I don't use Haskell myself, and they are hard pushed for time as it is, I'd prefer to avoid asking them all to maintain such a list of requirements
c_wraith 2017-03-02 03:48:15
the problem is that the number of people who care about the platform is very small in comparison to the number of people who use haskell.
iainhallam 2017-03-02 03:48:34
Ah, right.
iainhallam 2017-03-02 03:48:46
Am I approaching this wrong, then?
iainhallam 2017-03-02 03:49:04
What's the best way to get a modern GHC and a bunch of modules to each PC?
merijn 2017-03-02 03:49:05
Also, the number of people who care about both CentOS and platform is probably epsilon :p
iainhallam 2017-03-02 03:49:45
Platform seemed like a nice easy way forward, but then it turns into a quagmire of problems to get running in our setup.
c_wraith 2017-03-02 03:50:01
What problems do you actually encounter?
iainhallam 2017-03-02 03:50:50
For starters, the README in the distributions suggests that I need a working ghc, cabal and stack to do the install, but then says that if I check out the GitHub repo, I only need a bindist.
ertes 2017-03-02 03:50:51
doesn't CentOS provide packages for GHC and cabal-install by itself?
iainhallam 2017-03-02 03:51:03
CentOS provides GHC 7.6
c_wraith 2017-03-02 03:51:07
Ouch
ertes 2017-03-02 03:51:07
ouch
iainhallam 2017-03-02 03:51:07
Somewhat old.
iainhallam 2017-03-02 03:52:03
Then the README suggests that to install I should run platform.sh with arguments for a bindist tarball, path to cabal and path to stack, even when I have the repo version.
iainhallam 2017-03-02 03:52:24
It's a little confusing - I'm used to running configure/make to get stuff built.
c_wraith 2017-03-02 03:52:24
if you install a recent ghc bindist, does that work by itself?
ertes 2017-03-02 03:52:48
yeah, i'd go for binaries, too
brynser 2017-03-02 03:53:22
There's a generic linux download here https://www.haskell.org/platform/linux.html#linux-generic
iainhallam 2017-03-02 03:54:08
brynser: That's what I'd been hoping to use
iainhallam 2017-03-02 03:54:30
But if you try to tell it a new prefix, it fails silently, because the scripts redirect errors to /dev/null
c_wraith 2017-03-02 03:54:47
odd, I've used that installer with alternate prefixes all the time
brynser 2017-03-02 03:54:47
Oh :(
iainhallam 2017-03-02 03:54:57
It only supports /usr/local/ghc-n.n.n, which is off limits in our setup.
iainhallam 2017-03-02 03:55:29
c_wraith: where does it put the symlinks in that case?
c_wraith 2017-03-02 03:55:50
It doesn't.. I've always created them myself.
iainhallam 2017-03-02 03:56:02
https://github.com/haskell/haskell-platform/issues/234 is open for supporting non-/usr/local installs.
iainhallam 2017-03-02 03:56:56
And the scripts that would get linked into /usr/local/bin contain the hardcoded path to /usr/local as well.
c_wraith 2017-03-02 03:57:25
This is bizarre, because I build it with a prefix $HOME/ghc-n.n.n all the time
iainhallam 2017-03-02 03:57:51
What command line do you use?
c_wraith 2017-03-02 03:58:11
./configure --prefix=$HOME/ghc-whateverversion ; make install
iainhallam 2017-03-02 03:58:50
Ah, I'm talking about the platform binary distribution.
iainhallam 2017-03-02 03:59:07
Which has install-haskell-platform.sh as its installer.
c_wraith 2017-03-02 03:59:23
Oh. Yeah, I'm saying to skip that. Just install ghc, cabal, and then do global installs on the packages included in the platform.
c_wraith 2017-03-02 04:00:07
It seems easier than fighting with the platform's installer
iainhallam 2017-03-02 04:00:07
This is going to be fun to automate!
c_wraith 2017-03-02 04:00:24
It's not actually that bad.
iainhallam 2017-03-02 04:00:29
:)
c_wraith 2017-03-02 04:01:02
you can pass cabal a list of simultaneous targets, so it's really just one command. With a very long command line
iainhallam 2017-03-02 04:01:32
At least I can get a script to build that.
c_wraith 2017-03-02 04:02:10
You might be able to make a binary .rpm out of it so that you don't need to run the build on every machine, too
iainhallam 2017-03-02 04:03:03
I've done that with quite a few other packages using an automated packaging system we've written.
c_wraith 2017-03-02 04:03:23
There are some things to watch out for, though. For this use case, you want to install packages into the global package directory, not your user-local one.
iainhallam 2017-03-02 04:04:30
So the configure shipped with GHC 8.0.2 seems to be using something linked to libgmp.so.3
c_wraith 2017-03-02 04:04:43
ah, there is the libgmp problem. :(
iainhallam 2017-03-02 04:04:44
On CentOS 7 I have only libgmp.so.10!
iainhallam 2017-03-02 04:05:19
You say that like it's a known thing :o)
c_wraith 2017-03-02 04:05:55
libgmp is a source of problems, yeah
c_wraith 2017-03-02 04:07:04
Interesting. Are you not on Centos 6.7?
iainhallam 2017-03-02 04:07:17
No - CentOS 7.3
iainhallam 2017-03-02 04:07:38
D'oh!
iainhallam 2017-03-02 04:07:45
Just seen the filename I downloaded.
c_wraith 2017-03-02 04:08:00
Well then. Stupid as it sounds, try the debian 7 version.
dabd 2017-03-02 04:08:53
I installed the haskell layer for spacemacs but I can't figure how to start ghci. Can someone please give me a help?
iainhallam 2017-03-02 04:19:06
Amazingly that Debian 7 version is configured!
iainhallam 2017-03-02 04:19:26
That seems like it needs documentation updates at the very least :o)
c_wraith 2017-03-02 04:19:26
I thought there was a good chance it would work. Kind of dumb, but the main difference between the different versions is what libgmp and libc they are built against.
c_wraith 2017-03-02 04:20:44
iainhallam: I've got to run, but I expect lots of others will help out
iainhallam 2017-03-02 04:21:01
Thanks!
iainhallam 2017-03-02 04:21:13
If this works, I'm just figuring out the cabal commands to get a full install.
c_wraith 2017-03-02 04:21:51
oh, I was going to warn you - when doing a global install, don't sudo cabal. It tends to make libraries unusable to non-root users
kubunto 2017-03-02 04:22:07
if i have a datatype of Digit a, how would i write an fmap function to transform it?
c_wraith 2017-03-02 04:22:16
Instead, tell cabal to use sudo as the root command when installing. There's a command-line flag for that, which I don't recall offhand
iainhallam 2017-03-02 04:22:33
Good to know.
Tuplanolla 2017-03-02 04:23:06
Is there an easy solution to moving and renaming modules?
merijn 2017-03-02 04:23:36
Tuplanolla: Just move them and wait for compiler errors?
Tuplanolla 2017-03-02 04:23:57
Then I need to go through all the other files that depend on them.
Tuplanolla 2017-03-02 04:24:30
I fondly remember Eclipse doing this automatically for Java.
Tuplanolla 2017-03-02 04:26:31
I'll have to pitch this next time someone asks for a learning project idea.
nitrix 2017-03-02 04:34:54
kubunto: How is your data type declared?
cocreature 2017-03-02 04:35:25
Tuplanolla: I've done module renaming using sed :)
Tuplanolla 2017-03-02 04:36:02
I just did the equivalent, but shuffling the buffers in Vim is also annoying, cocreature.
nitrix 2017-03-02 04:36:05
kubunto: I have trouble imaginating a parametric `Digit a` type when its goal is to represent a digit. What would be the meaning of `Digit String` or `Digit Bool` ?
Tuplanolla 2017-03-02 04:36:10
I lose all marks etc.
cocreature 2017-03-02 04:36:23
Tuplanolla: yeah I wasn't suggesting this is a good solution
kubunto 2017-03-02 04:37:35
nitrix: digit wraps int
nitrix 2017-03-02 04:37:54
kubunto: Maybe data Digit = D Int, would make more sense?
Tuplanolla 2017-03-02 04:37:59
Should just stop coming up with bad names in the first place.
c_wraith 2017-03-02 04:38:05
it's funny how the super-static nature of haskell makes it conceptually straight-forward to write all kinds of refactoring tools - and at the same time provides a relatively low incentive to do so because doing it wrong by hand usually results in compiler errors that tell you what to fix.
nitrix 2017-03-02 04:41:45
kubunto: If it isn't algebraic, you might as well use newtype. newtype Digit a = D Int. You could automatically let GHC derive the Functor instance for you with `deriving Functor`, but it wont make much sense since it's the type of that `a` that's varying. You have a phantom type.
nitrix 2017-03-02 04:42:19
kubunto: I do not recognise this as a useful functor, but I could be mistaken.
c_wraith 2017-03-02 04:43:56
nitrix: it comes up sometimes.
nitrix 2017-03-02 04:44:10
kubunto: fmap for `Digit Bool` would infer as fmap :: (Bool -> b) -> f Bool -> f b
nitrix 2017-03-02 04:44:15
kubunto: Is this what you're after?
c_wraith 2017-03-02 04:44:15
nitrix: it's isomorphic to Const Int a
nitrix 2017-03-02 04:44:32
c_wraith: Yeah.
c_wraith 2017-03-02 04:44:40
nitrix: and we know Const is useful in the lensoverse :)
nitrix 2017-03-02 04:45:01
c_wraith: Just a tingly feeling from the level of the question that this might not be what they want.
kubunto 2017-03-02 04:45:01
nitrix: what i want is a way to transform the number within the digit struct using fmap