lpaste_ 2017-02-07 12:52:05
qmm pasted "is this an acceptable style?" at http://lpaste.net/352194
jle` 2017-02-07 12:53:03
lol
kadoban 2017-02-07 12:53:24
Looks kind of whitespacey to me.
jle` 2017-02-07 12:53:40
usually people put the first field on the same line as the constructor, but
qmm 2017-02-07 12:53:41
kadoban: same
jle` 2017-02-07 12:53:43
i mean, who's going to judge
Koterpillar 2017-02-07 12:54:30
hindent is going to judge
lpaste_ 2017-02-07 12:54:35
jle` annotated "is this an acceptable style?" with "is this an acceptable style? (annotation)" at http://lpaste.net/352194#a352195
jle` 2017-02-07 12:54:49
posted an example of how the official jle` style guide would recommend
jle` 2017-02-07 12:54:56
(the official jle` style guide is me)
lpaste_ 2017-02-07 12:55:04
qmm pasted "is this better?" at http://lpaste.net/352196
qmm 2017-02-07 12:55:05
ah :)
lpaste_ 2017-02-07 12:55:09
Axman6 annotated "is this an acceptable style?" with "is this an acceptable style? (annotation)" at http://lpaste.net/352194#a352197
qmm 2017-02-07 12:55:29
i didn't realize lpaste had annotations!
qmm 2017-02-07 12:55:40
i'll add the latest paste as an annotation
lpaste_ 2017-02-07 12:56:13
qmm annotated "is this an acceptable style?" with "is this an acceptable style? (annotation)" at http://lpaste.net/352194#a352198
lpaste_ 2017-02-07 12:56:18
Axman6 revised "is this an acceptable style? (annotation)": "is this an acceptable style? (annotation)" at http://lpaste.net/352197
lpaste_ 2017-02-07 12:57:05
qmm revised "is this an acceptable style? (annotation)": "is this an acceptable style? (annotation)" at http://lpaste.net/352198
jle` 2017-02-07 12:58:10
i don't prefer that one becuase it's not extendable
jle` 2017-02-07 12:58:19
if you decide to add or subtract fields
qmm 2017-02-07 12:58:20
jle`: yeah
jle` 2017-02-07 12:58:47
the thing with both Axman6's and my formatting is that adding/removing fields is easy, with only adding/removing individual lines
Axman6 2017-02-07 12:59:14
yeah, the only difficult one is the first line
Axman6 2017-02-07 12:59:21
"difficult"
lpaste_ 2017-02-07 13:00:30
Axman6 revised "is this an acceptable style? (annotation)": "is this an acceptable style? (annotation)" at http://lpaste.net/352197
Axman6 2017-02-07 13:00:52
bleh, meant to turn that announcement off before submitting >_<
qmm 2017-02-07 13:01:53
Axman6: how do you do that? i don't want to spam the room with annotations either :)
Axman6 2017-02-07 13:01:57
I hate code that gets too wide, the style I use means you only indent once per record. preferably I'd use Lens for everything though
Axman6 2017-02-07 13:02:20
qmm: see my annotation on your original paste
qmm 2017-02-07 13:02:33
Axman6: i'm with you. i'm not a fan of weird spacing as in the original post :)
jle` 2017-02-07 13:02:45
i admit that i often get wasteful with horizontal space
lpaste_ 2017-02-07 13:02:50
qmm revised "is this an acceptable style? (annotation)": "is this an acceptable style? (annotation)" at http://lpaste.net/352198
johnw 2017-02-07 13:03:01
jle`: me too!!!
lpaste_ 2017-02-07 13:03:22
qmm revised "is this an acceptable style? (annotation)": "is this an acceptable style? (annotation)" at http://lpaste.net/352198
Axman6 2017-02-07 13:03:24
_Foo # (_Bar # (qux 1, Zoo Zebra 2)) >_>
qmm 2017-02-07 13:03:44
Axman6: how do you turn off announcements?
Axman6 2017-02-07 13:04:00
up the top it says which channel it'll be announced to
qmm 2017-02-07 13:06:34
i see, thank you
qmm 2017-02-07 13:07:39
while a few of you are nice enough to chime in on style, will i cause haskellers to grab pitchforks if i don't inlcude the space indicating "qualified" wasn't used? :)
qmm 2017-02-07 13:07:55
i see this often: import Foo
Axman6 2017-02-07 13:08:18
some tools do that automatically, like stylish-haskell
qmm 2017-02-07 13:10:50
thanks!
qmm 2017-02-07 13:11:08
it would be nice to have the editor automatically do the indenting for me
Koterpillar 2017-02-07 13:12:24
I am almost there with hindent, spacemacs and comma-f
dmwit 2017-02-07 13:15:28
qmm: What editor?
qmm 2017-02-07 13:15:43
i'm all over the place
qmm 2017-02-07 13:15:58
i've been slowly getting myself back into emacs
dmwit 2017-02-07 13:16:19
qmm: For vim, I use tabular, which would let you do e.g. `:Tab /^import\s+\ze[A-Z]` or similar.
qmm 2017-02-07 13:16:19
i really like spacemacs, but i ran into issues where intero wasn't working on it and it's a known issue on github
nak 2017-02-07 13:20:08
does the following function have a commonly known name: a -> (a -> b) -> b
dmwit 2017-02-07 13:20:21
:t flip id
lambdabot 2017-02-07 13:20:22
b -> (b -> c) -> c
dmwit 2017-02-07 13:20:27
:t (&)
lambdabot 2017-02-07 13:20:28
a -> (a -> b) -> b
Axman6 2017-02-07 13:20:29
:t (&)
lambdabot 2017-02-07 13:20:31
a -> (a -> b) -> b
nak 2017-02-07 13:20:45
does "&" have a name ?
Rembane 2017-02-07 13:20:52
flip $
dmwit 2017-02-07 13:21:03
Is `&` not a good enough name for `&`?
Tuplanolla 2017-02-07 13:21:05
Flipped function application, nak.
nak 2017-02-07 13:21:54
dmwit, it's not a good name like "apply", "map" or "fold"
nak 2017-02-07 13:22:13
knowing names of things makes it easier to communicate about them
Koterpillar 2017-02-07 13:22:29
:t (>>>)
lambdabot 2017-02-07 13:22:30
forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
Koterpillar 2017-02-07 13:22:38
no, not that.
Tuplanolla 2017-02-07 13:22:48
Yes, that.
nak 2017-02-07 13:22:49
ok so "flipped function application" Tuplanolla
Koterpillar 2017-02-07 13:23:02
> 2 & negate
lambdabot 2017-02-07 13:23:04
-2
dmwit 2017-02-07 13:23:04
No, not that.
Koterpillar 2017-02-07 13:23:08
> 2 >>> negate
lambdabot 2017-02-07 13:23:10
error:
lambdabot 2017-02-07 13:23:10
• No instance for (Typeable a0)
lambdabot 2017-02-07 13:23:10
arising from a use of 'show_M693013032023542532621022'
dmwit 2017-02-07 13:23:16
That is `flip (.)`, not `flip ($)`.
Tuplanolla 2017-02-07 13:23:19
Right, composition.
Tuplanolla 2017-02-07 13:23:48
It's a really nice type signature too.
nak 2017-02-07 13:24:08
Tuplanolla: (&) you mean ?
nak 2017-02-07 13:24:15
(re: nice type signature)
Axman6 2017-02-07 13:24:19
I would usually read it as just "and"
Tuplanolla 2017-02-07 13:24:30
I meant stuff from `Control.Category`, nak.
nak 2017-02-07 13:24:38
Tuplanolla: ok
Axman6 2017-02-07 13:25:08
it's often used with Lens: foo & bar.baz .~ 2 & lol.yum *~ 20 -> "foo and set foo.baz to 2 and multiply lol.yum by 10"
Axman6 2017-02-07 13:25:11
20*
nak 2017-02-07 13:28:12
Axman6: thanks :)
ertes 2017-02-07 13:28:39
are there any clear figures about the memory and indirection costs of the various variable types that exist? particularly IORef, MVar, TVar and MutVar#
ertes 2017-02-07 13:29:06
memory: "how many extra bytes does it use apart from the actual value it stores?"
ertes 2017-02-07 13:29:27
indirection: "how many pointers need to be chased until you get to the value?"
dmwit 2017-02-07 13:30:28
IORef has one extra pointer (and one extra indirection) compared to MutVar#.
dmwit 2017-02-07 13:30:58
data STRef s a = STRef (MutVar# s a); newtype IORef a = IORef (STRef RealWorld a)
dmwit 2017-02-07 13:32:09
I don't know how MVar and TVar compare, though. Apparently MVar#, TVar#, and MutVar# are all pretty primitive.
ertes 2017-02-07 13:33:51
is a MutVar# itself an indirection compared to the actual value thunk?
dfeuer 2017-02-07 13:38:04
glguy?
Welkin 2017-02-07 13:38:54
graphics library guy
c_wraith 2017-02-07 13:39:09
ertes, I think it has to be, since IORef supports reference equality
Welkin 2017-02-07 13:39:19
EvanR_: no no cox?
c_wraith 2017-02-07 13:40:15
ertes, that is, (==) on IORef is "are these the same reference? " rather than "do these refer to the same thing?"
ertes 2017-02-07 13:41:43
thanks dmwit and c_wraith… looks like it's benchmark time =)
dfeuer 2017-02-07 13:42:28
Welkin: I wanted to know whether glguy (Eric Mertens) was actually here; what his nick stands for is somewhat less interesting.
glguy 2017-02-07 13:43:02
hi
dfeuer 2017-02-07 13:44:37
glguy: as far as I can tell (famous last words), your tries library doesn't try to do any path compression (including shortening long tails). Is that true?