markasoftware 2017-01-27 16:47:07
generally speaking should i use my distrobution's haskell packages or stack/cabal?
glguy 2017-01-27 16:47:47
markasoftware: You should pick one of the two and stick with it
kadoban 2017-01-27 16:47:54
markasoftware: stack/cabal
geekosaur 2017-01-27 16:47:55
unless you are building something for your distribution, avoid using its packages; they will usually be out of date, and upgrading any libraries installed as part of it will cause major pain
kadoban 2017-01-27 16:48:35
The GHC that comes in OS package managers tends to be horribly out of date as well, though some aren't so bad.
markasoftware 2017-01-27 16:48:54
is ghc 8.0.1 outdated?
markasoftware 2017-01-27 16:49:01
that's what arch has right now (and what im running)
geekosaur 2017-01-27 16:49:05
yes, actually :) 8.0.2 is out
markasoftware 2017-01-27 16:49:33
why do distrobutions recommend to use their packages?
glguy 2017-01-27 16:50:15
Do they? Maybe it says way underneath
geekosaur 2017-01-27 16:50:16
arch is better than most but that has its own sting in the tail: you build something with arch's library packages, then they upgrade them to a newer version and suddenly your stuff is breaking for no obvious reason
markasoftware 2017-01-27 16:50:58
from gentoo docs:
markasoftware 2017-01-27 16:51:04
" Warning
markasoftware 2017-01-27 16:51:06
The Gentoo Haskell team does not recommend the use of dev-haskell/cabal-install to install Haskell packages. Instead, emerge should be used. If you need a package that isn't in the main Gentoo tree, it may be present in the Haskell overlay. If not, please file a bug/issue, or ask us in #gentoo-haskell on IRC!"
geekosaur 2017-01-27 16:51:15
(this actually happened to xmonad, they decided to rev the X11 bindings to 1.7 --> KABOOM arch xmonad users started crashing all over the place. granted they did override xmonad's dependency spec which was there specifically to avoid this outcome...)
glguy 2017-01-27 16:51:32
markasoftware: Sounds like you could ask them why they recommend that in #gentoo-haskell
isd 2017-01-27 16:52:26
Hey. Are there monad transformer variants of the Get/Put types in Data.Binary somewhere?
glguy 2017-01-27 16:52:29
But if you're using Arch, then the answer might not apply
kadoban 2017-01-27 16:52:31
That sounds quite limiting, as soon as you want to use something that's not in their package manager, which is going to be not very long ... I don't know how you'd even proceed without just switching to using cabal/stack.
geekosaur 2017-01-27 16:52:42
markasoftware, the general rule is if you use the distro's compiler package then use its libraries and not externally installed ones
markasoftware 2017-01-27 16:53:05
geekosaur: why is that?
geekosaur 2017-01-27 16:53:08
but this will limit you to what versions your distro offers, and trying to upgrade those will be painful
Axman6 2017-01-27 16:53:33
isd: i dont believe so
isd 2017-01-27 16:53:54
(came into the conversation in the middle, so maybe I'm missing important context, but: I'm on Arch and basically use the distro packages for ghc and cabal, and cabal for everything else).
geekosaur 2017-01-27 16:54:18
(this isn't even specific to Haskell; Perl, Python, Ruby, etc. will also tell you this. because the distro package manager only understands *its* packages, and mising and matching versions installed from different places always causes confusion at best and bizarre errors or crashes at worst)
isd 2017-01-27 16:54:21
Axman6: that's what I was afraid of. Do you know if there's a specific reason for that, or just "it wasn't written that way"
markasoftware 2017-01-27 16:54:41
i don't understand, why do the distros even provide these packages then?
isd 2017-01-27 16:55:02
markasoftware: they're useful if some application they want to package depends on them
geekosaur 2017-01-27 16:55:07
because they have packages that may require them, at least for building. (pandoc is widely packaged, for example)
Axman6 2017-01-27 16:56:55
isd: what need do you have for Get/Put as a transformer?
geekosaur 2017-01-27 16:56:58
you dont need ghc to use pandoc, but if they want to build a pandoc package they need ghc --- and it's far easier for the distribution maintainer if the build dependencies are already packaged
geekosaur 2017-01-27 16:58:21
another issue, relevant for gentoo (and other "ports" style distributions): if you install their ghc and then install libraries using cabal, then emerge-ing something else that uses ghc may potentially build with your library instead of gentoo's (*) and then they have a support nightmare on their hands if that breaks it
markasoftware 2017-01-27 16:58:25
well i guess ill take your advices and install with stack
markasoftware 2017-01-27 16:58:30
that's preferred over cabal now right?
geekosaur 2017-01-27 16:58:40
(*) granted, we strongly discourage global library installs so this shouldn't normally happen
geekosaur 2017-01-27 16:58:45
somtimes
isd 2017-01-27 16:59:01
Axman6: I went and wrote something with a type like (MonadGet m, MonadThrow m, ...) => m ..., then went looking for something I had expected to exist... so I can't figure out how to actually instantiate that type (if it's even possible).
kadoban 2017-01-27 16:59:06
markasoftware: By some, myself included. Others disagree.
geekosaur 2017-01-27 16:59:07
cabal new-install is even better than stack but still has some weak spots
isd 2017-01-27 16:59:27
(there is a third constraint there that's another MTL-style class of my own construction)
Axman6 2017-01-27 16:59:36
isd: can you use something like ttoparsec?
Axman6 2017-01-27 16:59:44
attoparsec*
isd 2017-01-27 17:00:52
I'm not wedded to the Get/Put monads; open to changing my strategy. I need to look at attoparsec a bit closer to see if it meets my needs.
isd 2017-01-27 17:01:10
Also, having a symmetric problem with Put.
Axman6 2017-01-27 17:01:37
get/put have quite specific uses, they're not designed as generalised encoding and decoding monads (though are sometimes used as such)
isd 2017-01-27 17:02:00
Oh?
Axman6 2017-01-27 17:02:04
basically it's used for serialising and deserialising haskell values
Cale 2017-01-27 17:02:16
markasoftware: They're both pretty good. Stack does a bit more in the form of managing project-specific GHC installs for example, but there are reasons to still prefer using the cabal-install tool. It's worth pointing out that both of them use Cabal (as a library).
markasoftware 2017-01-27 17:03:02
does it work to have system ghc and also per-project ghc?
Axman6 2017-01-27 17:03:15
markasoftware: if you're just starting out with haskell, you may find stack easier to get started with (it optimises for the common cases being easy), later when you need it, using Cabal alone will give you more power
geekosaur 2017-01-27 17:03:23
it works but may be confusing to you
Cale 2017-01-27 17:03:23
You can have as many ghcs as you'd like to spend the disk space on
markasoftware 2017-01-27 17:03:29
yeah i will start with stack for now
geekosaur 2017-01-27 17:03:42
especially if you try to run ghc or ghci yourself instead of using the appropriate wrapped stack/cabal command
geekosaur 2017-01-27 17:03:58
because you will get the wrong version with the wrong libraries visible
markasoftware 2017-01-27 17:04:13
well ill just use the stack command then
Cale 2017-01-27 17:05:09
For me, stack ends up kind of in an awkward place where it's a bit better suited to larger projects, but then we're using nix to manage our larger projects. :)
Fylwind 2017-01-27 17:05:34
what exactly is *cunning* newtype deriving?
Fylwind 2017-01-27 17:06:06
like, what is the adjective "cunning" supposed to mean? o.o
markasoftware 2017-01-27 17:06:40
"Marked by or given to artful subtlety and deceptiveness"
Cale 2017-01-27 17:07:20
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generalised-derived-instances-for-newtypes
Cale 2017-01-27 17:08:16
I'm not sure the word "cunning" means anything technical on its own, it's just sometimes GHC's error messages can be a bit colourful :)
Fylwind 2017-01-27 17:09:54
Cale: Reminds me of the "My brain just exploded" message
buglebudabey 2017-01-27 17:10:23
would anyone be able to tell me why my hakyll site isn't properly showing LaTeX based on my configurations? site:https://aneksteind.github.io/posts/2015-08-12-spqr.html setup: http://lpaste.net/3272286813468753920
geekosaur 2017-01-27 17:10:30
it's not clearly stated in the documentation but there is a hint that the current deriving mechanism is smarter than the original one ("not through this new mechanism")
geekosaur 2017-01-27 17:11:19
I therefore presume "cunning" refers to the fact that the current mechanism is smarter than the original (which iirc was a simple-minded wrap/unwrap)
Cale 2017-01-27 17:12:44
I think the original original didn't consider very well the structure of anything, and simply allowed you to use the instance dictionaries without checking that you could actually write an instance.
geekosaur 2017-01-27 17:12:52
...another hint is at the end where it talks about Read/Show/Typeable/Data; original newtype deriving was just a generalization of the standard-specified derivation used for those 4, iirc)
geekosaur 2017-01-27 17:13:40
also I think that because we have type roles, it more or less knows when it can cheat and unsafeCoerce >.>
glguy 2017-01-27 17:13:57
the current implementation doesn't attempt to write the instance either, but relies on the theory around type roles being sound, afaik
Cale 2017-01-27 17:16:57
glguy: yeah
athan 2017-01-27 17:37:41
What is the abstract difference between `Prism` and `APrism`?
athan 2017-01-27 17:38:10
I see `Market` and `Choice` thrown in there, but I don't quite have the chops to understand their respective utilities
glguy 2017-01-27 17:38:37
Prism requires the RankNTypes extension to take one as an argument to a function
glguy 2017-01-27 17:39:09
APrism is a rank-1 type (no quantifiers hidden away inside like Prism)
athan 2017-01-27 17:39:50
ahh! that's right, sorry glguy, thank you
glguy 2017-01-27 17:40:18
apology accepted