Search Haskell Channel Logs

Tuesday, March 7, 2017

#haskell channel featuring tabaqui1, glguy, EvanR, bennofs1, merijn, cocreature, and 13 others.

kuribas 2017-03-07 04:55:23
eacameron: yeah, the order matters.
napping 2017-03-07 04:55:42
eacameron: Sort of - it's not full ordering, just that definitions before a top-level splice don't see definitions after
eacameron 2017-03-07 04:55:45
kuribas: Is that for all declarations or just ones involving TH somehow?
shapr 2017-03-07 04:56:02
srk: oh that's cool!
jchia_ 2017-03-07 04:56:24
lyxia: Thanks!
kuribas 2017-03-07 04:56:29
eacameron: I defined some lenses, and I got a strange error message because of the order.
kuribas 2017-03-07 04:56:53
eacameron: only the ones involving TH, or depending on them.
lyxia 2017-03-07 04:56:53
eacameron: toplevel invocations of TH separate definitions, so that those before the invocation don't see those after.
eacameron 2017-03-07 04:57:55
kuribas: lyxia: I.e. *not* using TemplateHaskell extension directly
kuribas 2017-03-07 04:58:29
eacameron: Then it doesn't matter I think...
napping 2017-03-07 04:59:37
eacameron: "Unlike normal declaration splices of the form $(...), declaration quasi-quotes do not cause a declaration group break."
napping 2017-03-07 04:59:42
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#ghc-flag--XQuasiQuotes
eacameron 2017-03-07 05:00:00
napping: Aha! That's the documentation I was looking for!
Mugwump_ 2017-03-07 05:20:00
hi everyone :)
Mugwump_ 2017-03-07 05:20:47
I wanted to ask something, I heard that Real World Haskell is outdated. Does learn you a haskell is the way to go for learning haskell ?
Theophane 2017-03-07 05:22:31
Mugwump_: they don't server the same purpose
Theophane 2017-03-07 05:23:13
let me find which book I started with
byorgey 2017-03-07 05:24:18
Mugwump_: you might be interested in https://github.com/bitemyapp/learnhaskell/blob/master/README.md
Theophane 2017-03-07 05:24:18
yeah, good link byorgey :)
Theophane 2017-03-07 05:24:18
I think I started with the wikibook
Theophane 2017-03-07 05:24:18
then the Moronuki
Theophane 2017-03-07 05:24:21
and I'm looking forward her 2nd co-book
Mugwump_ 2017-03-07 05:24:38
Ok !
Mugwump_ 2017-03-07 05:24:46
Thanks you a lot !
lyxia 2017-03-07 05:25:11
napping: it sees the bindings above itself
cocreature 2017-03-07 05:25:21
real world haskell is still a useful book despite being outdated. but I wouldn't recommend it as the first book you read
teto 2017-03-07 05:27:51
beginner here, why wouldn't this work lookForFirstOption :: [String] -> [String]
teto 2017-03-07 05:28:40
lookForFirstOption rlines = return rlines
merijn 2017-03-07 05:29:19
teto: return does NOT do what you think :)
mbw 2017-03-07 05:36:57
I have written a little project, which 1. Probably contains a lot of dead code, and 2. is unnecessarily distributed over 5 modules, where maybe 1-2 would have sufficed. So I want to really shrink it down. What is the most practical way of getting rid of dead code? Explicit module import lists, or do I need explicit export lists as well?
mbw 2017-03-07 05:36:57
Or is there some convenience option for ghc/stack?
bennofs1 2017-03-07 05:36:57
mbw: i think explicit export lists would be enough, no need for explict import lists
bennofs1 2017-03-07 05:36:57
mbw: then ghc's warnings should tell you which functions are unused
mbw 2017-03-07 05:37:41
Ok, I'll try that.
merijn 2017-03-07 05:37:47
mbw: If you compile with -Wall and use explicit export lists for modules you should get warnings
Mugwump_ 2017-03-07 05:40:20
So if I'm installing stack, I can't use the cabal packages ?
mbw 2017-03-07 05:40:20
Also, I have some expressions which look like "reduceTerm (TermPD g p d) = TermPD g <$> reduceElement p <*> reduceDiracDelta d", all of which are of type a -> Maybe a. While I could introduce a Reducible class or something, I feel like such a simple pattern should already exists, no?
mbw 2017-03-07 05:40:20
*exist
mbw 2017-03-07 05:50:25
I'll just go with the most obvious solution, without trying to be fancy.
lyxia 2017-03-07 05:55:54
https://github.com/haskell-infra/hl/issues/204
bobsonu 2017-03-07 05:57:46
lyxia: Thanks.
lyxia 2017-03-07 05:59:01
yw
tabaqui1 2017-03-07 06:00:08
is there any lib provided low-level select/poll functions
tabaqui1 2017-03-07 06:00:08
except of epoll and async
tabaqui1 2017-03-07 06:00:08
async based on threaded and gain no additional speed
tabaqui1 2017-03-07 06:00:24
epoll looks suspicios because of short history
tabaqui1 2017-03-07 06:00:31
*suspicious
mbw 2017-03-07 06:13:57
oh man
mbw 2017-03-07 06:14:31
Than it would be more sensible to start with an empty import list, fill it as required and make an export list out of it...
mbw 2017-03-07 06:14:38
This should be automated.
glguy 2017-03-07 06:23:51
Squarism: class Eq (SomeType a) => MyClass a
Squarism 2017-03-07 06:24:40
glguy, oh ok thanks
EvanR 2017-03-07 06:25:52
mbw: there are some IDE plugins that manage that stuff for you
napping 2017-03-07 06:26:53
mbw: there's -ddump-minimal-imports
mbw 2017-03-07 06:31:57
That seems helpful. Manually managing import/export lists seems like a n^2 problem.