miscyb 2017-02-22 12:49:10
is there a good way to organize imports?
miscyb 2017-02-22 12:49:27
looking at my import list makes me cry and i don't want to go through manually
miscyb 2017-02-22 12:50:01
i'd honestly like to explicitly declare every imported function in parens
MarcelineVQ 2017-02-22 12:52:34
don't cry dear, let ghc help you -ddump-minimal-imports
jle` 2017-02-22 12:55:31
i just sort alphabetically >_>
MarcelineVQ 2017-02-22 12:57:42
the main benefit of that dump is "the "minimal" imports (a) import everything explicitly, by name, and (b) import nothing that is not required."
lyxia 2017-02-22 13:04:18
what happens when you want to import something new?
lyxia 2017-02-22 13:04:46
Do you just add it by hand
ertes 2017-02-22 13:06:17
miscyb: if you use -W, GHC will warn you about unnecessary imports
ertes 2017-02-22 13:06:27
as a middle ground
xcmw_ 2017-02-22 13:07:17
Which is better to store small amounts of simple data (records, maps, lists) readMaybe and show, JSON with Aeson, or something else?
miscyb 2017-02-22 13:07:48
ertes: that's useful, but i want something more automatic
johnw 2017-02-22 13:07:50
xcmw_: do you want to be able to edit the data outside of your program?
ertes 2017-02-22 13:07:52
xcmw_: "store"? on disk? human-readable? …?
ertes 2017-02-22 13:08:23
miscyb: emacs with haskell-mode has a function to remove unnecessary imports automatically, which probably uses -ddump-minimal-imports internally
miscyb 2017-02-22 13:08:34
MarcelineVQ: i'll want to try this but i'll have to read about how to pass those args to stack
xcmw_ 2017-02-22 13:08:45
human-readable and editable would be nice
miscyb 2017-02-22 13:08:52
ertes: thinking about emacs gives me carpal tunnel syndrome haha
ertes 2017-02-22 13:08:57
xcmw_: then aeson sounds reasonable
xcmw_ 2017-02-22 13:09:49
ertes: Ok, Thanks
ertes 2017-02-22 13:10:02
xcmw_: YAML might be a better option for humans
ertes 2017-02-22 13:10:27
@package yaml
lambdabot 2017-02-22 13:10:27
http://hackage.haskell.org/package/yaml
xcmw_ 2017-02-22 13:10:50
ertes: I would only need to read it for debugging purposes
ertes 2017-02-22 13:11:43
xcmw_: yeah, it's just that the JSON that aeson produces is minified, so it's hardly human-readable =)
miscyb 2017-02-22 13:11:43
xcmw_: would it make sense to use something like cereal or store?
miscyb 2017-02-22 13:12:06
should be easy to write a printer for it
MarcelineVQ 2017-02-22 13:13:09
lyxia: the dump makes a seperate file, what you do with it after is up to you :>
xcmw_ 2017-02-22 13:15:52
miscyb: I think I will use json since I am more familier with it
dmwit 2017-02-22 13:27:49
MarcelineVQ: Obviously the correct solution is to #include it
Wizek 2017-02-22 13:28:54
Can I search for the instances of a particular class with hoogle or hayoo?
MarcelineVQ 2017-02-22 13:29:10
dmwit: it's obvious to everyone :>
dmwit 2017-02-22 13:29:37
Wizek: The haddocks for the class will list instances. Though due to a bug not all of them.
Wizek 2017-02-22 13:35:22
dmwit, Do you mean locally, or on hackage somehow?
dmwit 2017-02-22 13:36:40
On Hackage.
lpaste_ 2017-02-22 13:37:28
xcmw revised "Is this supposed to happen?": "Is this supposed to happen?" at http://lpaste.net/352894
Welkin 2017-02-22 13:37:52
xcmw_: is this real life?
xcmw_ 2017-02-22 13:38:04
Welkin: No
Welkin 2017-02-22 13:38:37
xcmw_: one piece of advice: stop using & when you really mean $
Welkin 2017-02-22 13:39:03
no one writes like that because it's painful to read
Wizek 2017-02-22 13:39:38
I do!
Welkin 2017-02-22 13:39:39
& is an abomination that was invented to be used only with lens
MarcelineVQ 2017-02-22 13:40:02
Welkin: I'm not confident about where you're sourcing your info :X
Welkin 2017-02-22 13:40:32
lol
dibblego 2017-02-22 13:40:34
Welkin does not speak for me.
Welkin 2017-02-22 13:40:48
I don't see ap lace for it outside of lens
Wizek 2017-02-22 13:40:59
Speak up, People of `flip ($)`!
Koterpillar 2017-02-22 13:41:02
it's fine, it's `>>>` in a lot of languages
Welkin 2017-02-22 13:41:17
Koterpillar: >>> in haskell is forward compose
Koterpillar 2017-02-22 13:41:28
(where I mean "a lot" in the mathematical sense of "more than one")
Axman6 2017-02-22 13:42:14
I think & (and <&>) are an excellent compliment to $ and <$>
Welkin 2017-02-22 13:42:35
Axman6: but used in place of them? not at all
Axman6 2017-02-22 13:42:39
reads quite nicely too, I have this, and do this and do this and do this...
Axman6 2017-02-22 13:42:53
Welkin: absolutely, it leads to much cleaner code in many cases
Wizek 2017-02-22 13:43:43
Exactly, for people with LTR writing systems I'd propose it's in general easier to read LTR function composition as well. An example: https://github.com/Wizek/dump/blob/48443d5/src/Debug/Dump.hs#L77
Welkin 2017-02-22 13:44:15
this isn't composition
Welkin 2017-02-22 13:44:19
it's application
Wizek 2017-02-22 13:44:38
Welkin, (.>) = flip (.)
Welkin 2017-02-22 13:44:53
never heard of it
Welkin 2017-02-22 13:45:00
I think you mean >>>
Koterpillar 2017-02-22 13:45:09
both are useful