Search Haskell Channel Logs

Wednesday, March 8, 2017

#haskell channel featuring drostie, twopoint718, kadoban, lambdabot, shapr, geekosaur, and 7 others.

nilof 2017-03-08 04:48:15
If I define a typeclass that extends another, how do I declare default implementations of the second in terms of the first?
lyxia 2017-03-08 04:49:07
nilof: DefaultSignatures
nilof 2017-03-08 04:49:10
Like say fmap from return & bind, or in my case, foldl in terms of heap pop
nilof 2017-03-08 04:49:12
ah
lyxia 2017-03-08 04:51:02
it's cleaner to define your default implementation separately and let users use it explicitly, like with Functor/Applicative/Monad in base.
zipper 2017-03-08 04:53:36
In https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md#data-types the writer says "Additionally, unpacking simple fields often improves performance and reduces memory usage"
zipper 2017-03-08 04:53:42
What does that even mean?
zipper 2017-03-08 04:53:49
What does unpacking mean?
zipper 2017-03-08 04:55:21
LOL tibbe is in this chan, what did you mean?
lyxia 2017-03-08 04:55:31
zipper: The record "Point Double Double" is represented as a struct with two pointers to Double
lyxia 2017-03-08 04:56:02
unpacking avoids the indirection and directly puts the doubles in the fields of the struct
zipper 2017-03-08 04:57:16
hmmm been so long since I looked at C++
zipper 2017-03-08 04:57:28
Can't remember structs clearly
lyxia 2017-03-08 05:01:57
zipper: in memory this is the difference between two pointers and two actual values.
max3 2017-03-08 05:39:55
shapr, if i rerun eventually it all builds
shapr 2017-03-08 05:40:03
max3: that sounds like it could be memory errors or possible disk corruption
max3 2017-03-08 05:40:09
it's in a docker
drostie 2017-03-08 05:40:40
sounds like a fun new feature, ghc --give-up-after=3
max3 2017-03-08 05:40:50
lol
drostie 2017-03-08 05:41:22
"ok fine you WANT that binary, you GOT that binary, don't say I didn't warn you!"
MarcelineVQ 2017-03-08 05:41:41
max3: the issue where you have to build multiple times to get the dependencies built was resolved for me by upgrading stack to 1.4.* stack upgrade --git --source-only
shapr 2017-03-08 05:41:59
MarcelineVQ: what was that issue?
MarcelineVQ 2017-03-08 05:43:32
I'm not sure it was reported directly, but the newer stack handles custom build options better so it seemed to have fixed it by proxy
MarcelineVQ 2017-03-08 05:43:34
most commonly when it happened was with cairo and gtk2hs
nilof 2017-03-08 05:43:59
Ah, another question: I'm trying to specialize a method using (buildheap xs) :: Ord a => ImplHeap a, but I get a type error where the compiler doesn't want to match t a1 with t a
shapr 2017-03-08 05:43:59
I sort of want to see the results of "stack dot --depth 2 --external" for databrary, but I'm afraid
max3 2017-03-08 05:43:59
MarcelineVQ, what does the --source-only flag do?
geekosaur 2017-03-08 05:45:45
nilof, lpaste the full code and full error message?
geekosaur 2017-03-08 05:47:55
@paste
lambdabot 2017-03-08 05:47:55
Haskell pastebin: http://lpaste.net/
nilof 2017-03-08 05:47:55
http://lpaste.net/353317
MarcelineVQ 2017-03-08 05:47:55
It's builds things locally instead of grabbing pre-built stack binaries, probably not neccesary here since --git should have a newer version number but if it didn't it may just grab binaries instead of actually fetching from git iirc
max3 2017-03-08 05:47:55
MarcelineVQ, this doesn't upgrade to nightly but the latest release right?
MarcelineVQ 2017-03-08 05:47:55
it upgrades to the current master branch of the stack git repo https://github.com/commercialhaskell/stack
nshepperd 2017-03-08 05:47:55
nilof: you may need ScopedTypeVariables there
MarcelineVQ 2017-03-08 05:51:56
max3: not sure, I don't upgrade often unless I have issues, it has been stable for me in usage. nominally there is a branch called stable that I imagine is for releases, it won't have the update that fixed the depdendency issue for me
lyxia 2017-03-08 05:52:40
unclechu: it seems you're missing the equivalent of this line https://github.com/haskell-suite/haskell-src-exts/blob/master/.travis.yml#L35
geekosaur 2017-03-08 05:52:59
basically "strange closure type" means one of: (a) you're using a buggy ghc prerelease (b) you have FFI and some *really* wild pointers (c) you have general memory corruption
kadoban 2017-03-08 05:54:02
max3: Can you run memtest86 or something like that without much trouble? That's usually where I start when impossible things are happening that suggest hardware failure.
unclechu 2017-03-08 05:54:37
lyxia: thanks again
max3 2017-03-08 05:55:35
kadoban, lemme see if reinstall docker helps
nshepperd 2017-03-08 05:56:21
if you suspect your machine might have faulty ram, you should reboot into memtest86+ and test it asap, because faulty ram tends to stomp all over your hard disk and destroy your data
twopoint718 2017-03-08 06:23:29
I'm attempting to use `runResourceT` (`resourcet` pkg) in combination with `createPool` (`resource-pool` pkg) and things are starting to feel a little funky. Am I duplicating behavior here? Should I be using one or the other? In particular, I'm planning on setting up a connection to Neo4J using `haskell-neo4j-client`'s `newConnection` function which just returns an `IO Connection`. My idea was to get the connection with that function,
twopoint718 2017-03-08 06:23:29
then use `createPool` to manage the opening/closing for me. The issue arises when I want to close the connection. https://www.stackage.org/haddock/lts-6.11/haskell-neo4j-client-0.3.2.2/Database-Neo4j.html#v:newAuthConnection suggests that I use `runResourceT` to manually close the connection, but it would seem that I need a "primitive" close function to be able to `allocate` a ResourceT. I feel a little like I'm going in circles, any
twopoint718 2017-03-08 06:23:29
ideas?
twopoint718 2017-03-08 06:24:13
(sorry for the long question. tl;dr has anyone used ResourceT in combination with resource-pool?)