halogenandtoast 2017-02-05 17:45:26
and no I'm not, the void was leftover from tryign to do something else
jle` 2017-02-05 17:47:08
it's hard to see what's going on with the layouting removed
jle` 2017-02-05 17:47:30
what lines/indents go where
jle` 2017-02-05 17:47:45
maybe use { .. ; ..}, or put it on a paste?
lpaste 2017-02-05 17:48:10
halogenandtoast pasted "Stories.hs" at http://lpaste.net/352126
halogenandtoast 2017-02-05 17:48:18
jle`: ^^
halogenandtoast 2017-02-05 17:48:53
probably going to move groups into the single runDB section
jle` 2017-02-05 17:48:54
it looks like you are using runDB inside a runDB
halogenandtoast 2017-02-05 17:49:01
I'm not
halogenandtoast 2017-02-05 17:49:06
what makes you think I am?
jle` 2017-02-05 17:49:14
line 5
jle` 2017-02-05 17:49:20
is inside a block you are runDBing
jle` 2017-02-05 17:49:24
and it is a runDB
halogenandtoast 2017-02-05 17:49:30
ha
halogenandtoast 2017-02-05 17:49:31
yeah I am
halogenandtoast 2017-02-05 17:49:33
:|
jle` 2017-02-05 17:49:57
and yeah, you can probably pull everything into one runDB
halogenandtoast 2017-02-05 17:50:20
okay removing the runDB allowed me to remove the return
jle` 2017-02-05 17:50:41
the return did not do what you think it does
jle` 2017-02-05 17:50:51
if you return something and don't name the reuslt, that's basically a no-op
jle` 2017-02-05 17:51:00
_ <- return (putStrLn "hello")
jle` 2017-02-05 17:51:02
won't print out hello
lpaste 2017-02-05 17:51:10
halogenandtoast revised "Stories.hs": "Stories.hs" at http://lpaste.net/352126
jle` 2017-02-05 17:51:15
it just is a no-op IO action that returns an IO action that you don't do anything with
halogenandtoast 2017-02-05 17:51:45
jle`: Good point
halogenandtoast 2017-02-05 17:52:15
Does that paste look better then?
jle` 2017-02-05 17:52:54
mhm
halogenandtoast 2017-02-05 17:53:35
jle`: Thanks!
jle` 2017-02-05 17:54:45
halogenandtoast: you never use groups btw
jle` 2017-02-05 17:55:00
if you really don't, you don't need the (grouped <$>) on line 6
sshine 2017-02-05 17:55:40
why write (grouped <$>) when you can write fmap grouped?
jle` 2017-02-05 17:56:21
it's actually `grouped <$> blah` in the paste, heh, just writing it like this for irc purposes
sshine 2017-02-05 17:56:30
ah, ok
Ptival 2017-02-05 17:57:05
Koterpillar: but Identity t is not ~ t, right, so it requires a lot of wrap/unwrap?
halogenandtoast 2017-02-05 17:57:23
jle`: what do you mean about not using groups?
halogenandtoast 2017-02-05 17:57:35
oh
jle` 2017-02-05 17:57:38
halogenandtoast: you named it but never used it
Koterpillar 2017-02-05 17:57:41
Ptival: correct
halogenandtoast 2017-02-05 17:57:47
jle`: it's used in the template
halogenandtoast 2017-02-05 17:58:04
some TemplateHaskell shenanigans going on in there
jle` 2017-02-05 17:58:06
ah ok
halogenandtoast 2017-02-05 18:01:01
Haskell is often difficult, but I love it.
halogenandtoast 2017-02-05 18:01:35
One day it will be easy, and I will still love it.
halogenandtoast 2017-02-05 18:12:01
What is the purpose of mzero. For instance `parseJSON _ = mzero` I don't understand how or why that's the case.
Ptival 2017-02-05 18:12:25
is it ever possible to mention the type of the outermost function in the type of a where-function?
Axman6 2017-02-05 18:12:43
I don't understand the question
Ptival 2017-02-05 18:12:52
sorry, to mention a type variable from the outermost function type*
Axman6 2017-02-05 18:13:28
if you use ScopedTypeVariables then you can mention types from the top level funtion in places like where clauses
Ptival 2017-02-05 18:13:46
oooh
Ptival 2017-02-05 18:15:01
Axman6: ah, perfect, this solves my issue!
geekosaur 2017-02-05 18:15:17
...but you have to mark the ones you use with explicit foralls
Axman6 2017-02-05 18:15:20
it's kind of frustrating that's not the default behaviour
Axman6 2017-02-05 18:15:31
geekosaur: do you? I don't think I ever have
Koterpillar 2017-02-05 18:16:02
halogenandtoast: this is the definition of mzero: http://hackage.haskell.org/package/base-4.9.1.0/docs/Control-Monad.html#v:mzero
Koterpillar 2017-02-05 18:16:16
halogenandtoast: it's a "do nothing" operation, if applicable
Ptival 2017-02-05 18:16:49
geekosaur: even the ones you don't use it seems?
Axman6 2017-02-05 18:16:58
for AESON, I think mzero returns an error
geekosaur 2017-02-05 18:17:04
Axman6, https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#declaration-type-signatures
geekosaur 2017-02-05 18:17:20
Ptival, only the ones you need in scope, see the link ^
halogenandtoast 2017-02-05 18:19:01
Axman6: you are right, also thanks Koterpillar looks like it's better to use `typeMismatch`
Axman6 2017-02-05 18:22:54
yeah something more explicit it usually a better idea. I tend to just use the withFoo (withObject, withString etc.) functions, they allow you to name what you're expecting to be there and Aeson takes care of the error cases
jle` 2017-02-05 18:29:22
halogenandtoast, Koterpillar: er, wait, the do-nothing operation is not mzero
jle` 2017-02-05 18:29:25
it's 'return'
jle` 2017-02-05 18:29:42
halogenandtoast: mzero's use depends on the type that instances it
halogenandtoast 2017-02-05 18:29:47
:t return
lambdabot 2017-02-05 18:29:49
Monad m => a -> m a
halogenandtoast 2017-02-05 18:29:52
:t mzero
lambdabot 2017-02-05 18:29:54
MonadPlus m => m a
jle` 2017-02-05 18:30:06
for the parser type tat aeson uses, 'mzero' is "fail to parse"
jle` 2017-02-05 18:30:09
it's the failure action
jle` 2017-02-05 18:30:27
most instances of MonadPlus have mzero usually mean some failure of some sort
jle` 2017-02-05 18:30:36
but the actual meaning of mzero varies from instane to instance
jle` 2017-02-05 18:30:59
'mzero' is the parser that parses nothing and fails immediately