Search Haskell Channel Logs

Thursday, February 2, 2017

#haskell channel featuring c_wraith, mniip, Koterpillar, ph88, halogenandtoast, ertes,

mniip 2017-02-02 13:45:10
it's the initial object in the hackage category
Koterpillar 2017-02-02 13:45:26
is Prelude final then?
c_wraith 2017-02-02 13:45:55
base depends on things like ghc-prim
dmwit 2017-02-02 13:47:02
I wonder if there's any package on Hackage that neither depends on base nor is depended on by base.
c_wraith 2017-02-02 13:47:42
there is at least one package that consists only of macros for use with hsc
c_wraith 2017-02-02 13:48:06
no haskell code in that package!
dmwit 2017-02-02 13:48:36
hah! what cheaters
ph88 2017-02-02 13:48:58
when i load code in ghci it's near instantanious compilation (lets say 30 seconds) now with a ton of optimizations turned on its taking already 25 minutes .. this is also normal ?
dmwit 2017-02-02 13:51:02
25 minutes is a very long compilation time.
ph88 2017-02-02 13:51:29
you think there might be a problem and ghc got stuck ?
erisco 2017-02-02 13:51:46
just enough time for a sword fight
geekosaur 2017-02-02 13:53:39
with the amount of information you've provided (none) all you're likely to get is wild guesses
erisco 2017-02-02 13:53:57
dmwit, min of the tail
erisco 2017-02-02 13:54:11
dmwit, I'll have to review this several times so I can intuit the pattern next time
erisco 2017-02-02 13:54:31
many surprises packed in there!
dmwit 2017-02-02 13:57:39
It's not the min of the tail either.
dmwit 2017-02-02 13:58:08
I mean, it's not actually the minimal value in the tail.
erisco 2017-02-02 13:58:30
well, yes, I suppose I meant the head of the tail
erisco 2017-02-02 13:58:42
if it were monotonic then it would be the minimal
dmwit 2017-02-02 13:58:53
right
erisco 2017-02-02 13:59:20
there are wonderful subtle parts like the operand ordering over &&
dmwit 2017-02-02 13:59:53
I admit that was a bit more tricky than I would like in production code. =)
erisco 2017-02-02 14:00:46
not that you would write such a thing in production code
erisco 2017-02-02 14:00:55
a function which only terminates on False? I don't think so :P
halogenandtoast 2017-02-02 14:09:54
I wrote some code that I'd love to make better, but I think I need some help. If anyone is feeling generous today, I have two small functions (in a yesod app) that I'd like to make better: https://github.com/halogenandtoast/nhk-reader-haskell/blob/master/Handler/Story.hs and https://github.com/halogenandtoast/nhk-reader-haskell/blob/master/Util/Nhk.hs
ertes 2017-02-02 14:23:43
halogenandtoast: (case b of True -> x; False -> y) = (if b then x else y)
ertes 2017-02-02 14:24:10
for the most part i also prefer 'maybe' over explicit pattern-matching
ertes 2017-02-02 14:24:12
:t maybe
lambdabot 2017-02-02 14:24:13
b -> (a -> b) -> Maybe a -> b
halogenandtoast 2017-02-02 14:25:15
ertes: Good call on the `if`
mniip 2017-02-02 14:25:32
ski, you around?
ertes 2017-02-02 14:26:17
halogenandtoast: i'm not entirely sure, because i don't know the business logic going on, but it could also be that your code is currently boolean-blind
halogenandtoast 2017-02-02 14:27:05
ertes: Googling this term
ertes 2017-02-02 14:27:24
halogenandtoast: here is the theory: https://existentialtype.wordpress.com/2011/03/15/boolean-blindness/
ertes 2017-02-02 14:27:44
halogenandtoast: here is a more practical example-based explanation: http://ertes.eu/tutorial/foldr.html#heads-tails-and-a-digression
halogenandtoast 2017-02-02 14:29:10
ertes: thanks will read
halogenandtoast 2017-02-02 14:35:25
ertes: I tried something like this with `maybe` but it doesn't work out, it it obvious what I'm doing wrong `maybe (return story) (\a -> updateGet storyId [NewsStoryBody =. a, NewsStoryFetched =. True]) fetched` the compiler is telling me `Couldn't match type 'Text' with 'Maybe Text'`
halogenandtoast 2017-02-02 14:36:09
and fetched shoud be a Maybe Text
halogenandtoast 2017-02-02 14:36:49
nevermind I figured it out
halogenandtoast 2017-02-02 14:37:10
I changed `NewsStoryBody` to a Maybe type so I need to rewrap it