c_wraith 2017-02-18 12:45:20
ghci uses the haskeline library for things like that. It's probably configurable one way or another
maksim__ 2017-02-18 12:46:04
no i mean during debugging
maksim__ 2017-02-18 12:46:07
for the stack trace
c_wraith 2017-02-18 12:46:11
Oh, I see
maksim__ 2017-02-18 12:46:40
fghci-hist-size=n
lalalala 2017-02-18 12:46:40
hm Scotty is acting up for me, I get this error "Expected type: ScottyM () Actual type: ActionM ()" even though I just copied their example?
c_wraith 2017-02-18 12:47:07
lalalala: is the example for the same version as you're running?
jle` 2017-02-18 12:47:18
Prutheus: just ask your question :)
lalalala 2017-02-18 12:47:22
c_wraith: i used cabal so i haven't checked the version
c_wraith 2017-02-18 12:47:55
lalalala: haskell libraries tend to change. Best to be sure your version matches the version used in samples
lalalala 2017-02-18 12:48:11
c_wraith: how do I check that?
Tuplanolla 2017-02-18 12:48:46
Is there a more concise way to say `void . sequenceA . over _Just f`?
c_wraith 2017-02-18 12:49:27
Tuplanolla: at least use sequenceA_ ?
jle` 2017-02-18 12:49:37
:t \f -> void . sequenceA . over _Just f
Tuplanolla 2017-02-18 12:49:38
Oh!
lambdabot 2017-02-18 12:49:39
Applicative f => (a1 -> f a) -> Maybe a1 -> f ()
Tuplanolla 2017-02-18 12:49:48
The idea was to only perform an effect with the contents of `Just`.
jle` 2017-02-18 12:49:51
Tuplanolla: sounds like mapM_ ?
jle` 2017-02-18 12:49:58
:t mapM_
lambdabot 2017-02-18 12:49:59
(Foldable t, Monad m) => (a -> m b) -> t a -> m ()
lalalala 2017-02-18 12:50:03
what does this do "{-# LANGUAGE OverloadedStrings #-}" ?
jle` 2017-02-18 12:50:11
mapM_ :: (a -> m b) -> Just a -> m ()
lalalala 2017-02-18 12:50:17
or it's just a comment huh
Tuplanolla 2017-02-18 12:50:28
Thanks. I knew I was overthinking it.
c_wraith 2017-02-18 12:50:30
lalalala: no, it's a pragma that enables a language extension
jle` 2017-02-18 12:50:36
Tuplanolla: fwiw this is one of the most common usages of mapM_
lalalala 2017-02-18 12:50:41
c_wraith: oh i need it?
c_wraith 2017-02-18 12:50:46
lalalala: That particular extension makes string literals polymorphic the way numeric literals are
lalalala 2017-02-18 12:50:59
c_wraith: i didn't use that from the example
c_wraith 2017-02-18 12:51:16
lalalala: does your code have no string literals?
lalalala 2017-02-18 12:51:48
c_wraith: i haven't used that before, im quite new and it worked without
c_wraith 2017-02-18 12:52:10
lalalala: turns out I don't know nearly enough about Scotty to figure out how ActionM and ScottyM are related.
lalalala 2017-02-18 12:52:38
c_wraith: thanks tho
jle` 2017-02-18 12:52:42
lalalala: it's useful for when you need to use functions that expect a Text, and you want to use one from a string literal like "hello"
jle` 2017-02-18 12:52:53
lalalala: "hello" is a String so the function wouldn't be happy
jle` 2017-02-18 12:53:17
but OverloadedStrings will automatically parse the string literal as a Text so you can give it directly to the function
lalalala 2017-02-18 12:53:31
jle`: this is all I've done so far: https://gist.github.com/freddedotme/01c729071cc15a5224b77ffd3e9fa773
jle` 2017-02-18 12:53:58
i guess this means that the 'html' function is happy accepting a String as an input
jle` 2017-02-18 12:54:07
so using a string literal there is fine w/o overloaded strings
jle` 2017-02-18 12:54:24
btw i'm sure you know this, but mconcat [x] = x
lalalala 2017-02-18 12:54:43
jle`: the thing is that is from the example on their github
lalalala 2017-02-18 12:54:43
it is*
lalalala 2017-02-18 12:55:56
i think i've realized what i did wrong
lalalala 2017-02-18 12:56:37
it works, I had to add the "get "/" $ do" before as well, i forgot that step.
mniip 2017-02-18 13:03:48
we call a category P-enriched if it's accompained with a C^op x C -> P hom-functor?
Zemyla 2017-02-18 13:19:04
So question. Assume I have a newtype ConstN n a = ConstN { getConstN :: n } such that instance Num n => Applicative (ConstN n) where { pure = const (ConstN 1); ConstN nf <*> ConstN na = ConstN $ nf * na }
Zemyla 2017-02-18 13:19:36
I want to have an Alternative instance with empty = 0 and (<|>) = (+).
Zemyla 2017-02-18 13:21:22
However, I'm wondering if I'll need to require a Fractional instance for it, though, because the solution to many n = n <*> many n <|> pure (:) is m = n * m + 1, which is m = -1 / (n - 1).
Zemyla 2017-02-18 13:21:26
And similarly for some n.
monochrom 2017-02-18 13:23:08
That is an interesting instance.
monochrom 2017-02-18 13:23:36
It is OK to stay Num and leave many and some as bottoms.
jle` 2017-02-18 13:39:37
many and some are bottoms for almost every instance of Alternative anyway
EvanR 2017-02-18 13:43:06
"if the termination status of a program is neither provable or disprovable in standard set theory, then the program must not terminate. if it did, the program itself stands as proof of termination, contradicting the assumption that it cant be proved either way"
EvanR 2017-02-18 13:43:27
"if you dont believe the program stands as proof of termination, just run it until it stops, which is guaranteed by assumption"
EvanR 2017-02-18 13:44:19
HOWEVER the assumption that it stops is a hypothetical, and i read that computing under binders assumption a contradiction is a common source of freeze ups if the implementation isnt careful
dolio 2017-02-18 13:44:50
Huh?