Tuplanolla 2017-02-03 11:45:46
> Nothing {}
lambdabot 2017-02-03 11:45:48
Nothing
mniip 2017-02-03 11:45:59
> (){}
lambdabot 2017-02-03 11:46:01
()
Gurkenglas 2017-02-03 11:46:07
erisco, what's the difference between implicit type parameters in Haskell and coeffects?
merijn 2017-02-03 11:46:08
Tuplanolla: For a cool trick:
mniip 2017-02-03 11:46:08
ok that's one I did not know
monochrom 2017-02-03 11:46:22
erisco: When writing in BASIC, I used to use that idiom "formal_param = actual param; gosub 450"
merijn 2017-02-03 11:46:55
> [x | x@Left{} <- [Left 'c', Right True, Left 'b', Right False]] -- <- future proof should the number of fields of 'Left' change
lambdabot 2017-02-03 11:46:57
[Left 'c',Left 'b']
mniip 2017-02-03 11:47:35
"should the number of fields of 'Left' change"
merijn 2017-02-03 11:47:57
mniip: Unlikely for Left, but not for other constructors
merijn 2017-02-03 11:48:15
mniip: You can future proof parts of your code that way if you don't care about fields
erisco 2017-02-03 11:48:29
Gurkenglas, they are similar and I am not sure where the differences lie
reactormonk 2017-02-03 11:50:24
I want to lift https://downloads.haskell.org/~ghc/8.0.1/docs/html/libraries/Cabal-1.24.0.0/Distribution-PackageDescription-Parse.html#v:parsePackageDescription such that I have the exact string position of every element that's parsed? Would it be easier to write a new one?
Tuplanolla 2017-02-03 11:50:30
:t has _Left
lambdabot 2017-02-03 11:50:32
Either b c -> Bool
reactormonk 2017-02-03 11:52:34
... probably too nasty.
dedgrant 2017-02-03 11:55:26
Can [https://wiki.haskell.org/Foldl_as_foldr#foldl_which_may_terminate_early] be viewed as an instance of shortcut fusion? Is this what shortcut fusion is supposed to do?
qmm 2017-02-03 11:58:03
servant's hello world example seems to be more modular
qmm 2017-02-03 11:58:24
i'm wondering how to make scotty a little more modular
qmm 2017-02-03 11:59:46
suggestions on how to extract the route handlers so there isn't get root $ do ... get "/:word" do in a large IO block
qmm 2017-02-03 11:59:50
?
erisco 2017-02-03 12:00:39
Gurkenglas, I think I can use them quite effectively here so thanks for reminding me of them
qmm 2017-02-03 12:00:58
i guess i could do
qmm 2017-02-03 12:01:18
get foo $ fooRoute
erisco 2017-02-03 12:05:09
you're programming right when the types are twice as long as the terms
erisco 2017-02-03 12:27:17
and when your comments reduce to some propositions... nice place to be
Lokathor 2017-02-03 12:27:36
erisco, sounds like you need more descriptive term names
Lokathor 2017-02-03 12:27:51
and like you need better comments
erisco 2017-02-03 12:27:57
actually I've gone for more than one letter this time :P
erisco 2017-02-03 12:28:16
the English can only vaguely explain what the precise language can
Lokathor 2017-02-03 12:28:27
the fact that haskell looks like math sometimes, and people think that's bad, to me means that math just has garbage for notation that should not be imitated.
erisco 2017-02-03 12:29:32
can you really imitate those parts of it?
Lokathor 2017-02-03 12:30:09
i've used Haskell for two years now and I still use java style nameTheWholeThing variables as much as possible
Lokathor 2017-02-03 12:30:17
in any code i expect to need to understand later
Lokathor 2017-02-03 12:30:47
because "some random person trying to learn the code base 6 months from now" is usually me
erisco 2017-02-03 12:31:01
I'm in the camp that believes verbosity can be superfluous
erisco 2017-02-03 12:31:24
for example, I say ncol, instead of numberOfColumns
Lokathor 2017-02-03 12:31:37
well, given other context, that might be a fair shortening
Lokathor 2017-02-03 12:31:58
but i've yet to see any other Haskell code that i'd ever call too verbose
erisco 2017-02-03 12:32:28
I'm happy to use single letters when the type already says everything
erisco 2017-02-03 12:32:45
when I say ncol it is relevant because the kind is Nat, and who knows otherwise what I am using this Nat for
Tuplanolla 2017-02-03 12:32:55
I'd use longer names if Vim's autocompletion wasn't so bad.
Lokathor 2017-02-03 12:33:13
Tuplanolla, did you know that there's a build tool called tup?
Lokathor 2017-02-03 12:33:20
it's jsut the first thing your name made me think of
Tuplanolla 2017-02-03 12:33:21
Yes.
erisco 2017-02-03 12:33:23
when I say p it is not ambiguous because it has the type Puzzle and things of type Puzzle are just puzzles
Lokathor 2017-02-03 12:33:39
if there's a "TQueue InputEvent" i'll still call it inQueue instead of i
erisco 2017-02-03 12:34:36
just like if I was using an Int really as just an Int, say when writing fac, I am just going to call it x or n
Lokathor 2017-02-03 12:34:38
Tuplanolla, maybe you should consider an editor with better copy and paste support :3
erisco 2017-02-03 12:34:58
whereas if it is a dimension then maybe I call it width or height
yushyin 2017-02-03 12:34:59
I do it like this, the length and descriptively of my identifiers are proportional to there scope
Tuplanolla 2017-02-03 12:35:05
I don't see the connection, Lokathor.
yushyin 2017-02-03 12:35:31
their*
Lokathor 2017-02-03 12:35:43
Tuplanolla, you said that lack of auto-complete hindered your desire for longer identifiers. If there's something that's long enough i'll just copy it and paste it into wherever else it's used
Lokathor 2017-02-03 12:36:17
but I don't use autocomplete in haskell so perhaps i'm considering it from the wrong angle
Tuplanolla 2017-02-03 12:36:27
Vim can already access X11, GTK+ and internal register clipboards. The problem is that I can't keep twenty registers in my head.
Lokathor 2017-02-03 12:37:03
you gotta pick a naming style and stick to it, is all the advice i can give
Lokathor 2017-02-03 12:37:14
if short names are your style then that's managable i guess
erisco 2017-02-03 12:37:30
iNVERTEDlOWERcAMELcASE
Lokathor 2017-02-03 12:37:39
yes that
Lokathor 2017-02-03 12:38:04
let's see, my very most recent haskell writing would be.. this https://github.com/Lokathor/galaxy-break/blob/master/src/Main.hs
Lokathor 2017-02-03 12:38:18
a text game demo that's already running 3 threads at once!
Tuplanolla 2017-02-03 12:38:22
Typing `liftIO $ async $ bracketCont msgChan ThreadClock $ fix $ \ again -> do` should only require `lif$asy$brmsgC$fix$\a->do` and the rest would come from a properly trained Markov chain completion algorithm.
erisco 2017-02-03 12:38:30
lol, mk? rand?
erisco 2017-02-03 12:38:35
what is this
Lokathor 2017-02-03 12:39:09
Tuplanolla, you've got some wild ideas there
Lokathor 2017-02-03 12:39:15
erisco, did you mean to me?
erisco 2017-02-03 12:39:34
I am just teasing
erisco 2017-02-03 12:39:46
your code looks neither more nor less verbose than I typically see
merijn 2017-02-03 12:39:48
hmmm
systadmin 2017-02-03 12:39:49
hi
Lokathor 2017-02-03 12:39:57
SPJ himself uses mkValue constructors :P
merijn 2017-02-03 12:41:03
Any Conduit users? I have a function "Consumer Foo m r -> Consumer Foo m r" which won't accept my "ConduitM Foo Foo m r" how can I beat it into working? Or will it simply not work with those types?
erisco 2017-02-03 12:41:13
it is fine because everyone knows what mk means