monochrom 2017-02-04 07:48:35
This is interesting.
opqdonut 2017-02-04 07:49:10
isn't that just DNE?
monochrom 2017-02-04 07:49:40
What is DNE?
opqdonut 2017-02-04 07:49:55
double negation elimination
opqdonut 2017-02-04 07:50:15
but I misremembered, double negation elimination is nonconstructive, double negation introduction is constructive
monochrom 2017-02-04 07:51:28
This is the second closest to double-negation elimination. This is quadruple-negation eliminate-to-just-double-ion.
opqdonut 2017-02-04 07:51:32
yeah
monochrom 2017-02-04 07:51:49
The first closest is triple-negation eliminate-to-just-one-ion
opqdonut 2017-02-04 07:51:54
yeah
opqdonut 2017-02-04 07:52:05
which you get from DNI by contraposition
monochrom 2017-02-04 07:52:22
I looked at it because hpc mentioned join for Cont r.
xcmw 2017-02-04 08:15:39
I find that 50% of the functions I write are in the form of: function_name x = x & ... <&> ... >>= ... Is there a way to avoid having x?
Welkin 2017-02-04 08:16:50
yes
Welkin 2017-02-04 08:16:54
it's called point-free
Welkin 2017-02-04 08:17:20
compose your functions and drop the x
Welkin 2017-02-04 08:17:50
not sure why you would use & and <&> thought
Welkin 2017-02-04 08:17:57
instead of just using $ and <$>
Welkin 2017-02-04 08:18:15
you can use =<< instead of >>= to fit function composition better
Welkin 2017-02-04 08:18:23
so it is a pipeline from right to left
xcmw 2017-02-04 08:18:57
Welkin: Becuase $ and <$> and =<< are backwards. At least to me
Welkin 2017-02-04 08:19:10
they are not backwords
Welkin 2017-02-04 08:19:15
they are the correct direction
Welkin 2017-02-04 08:19:19
especially for composition
Welkin 2017-02-04 08:19:26
not backwards*
xcmw 2017-02-04 08:22:19
Welkin: How do you compose with monads? I know & maps to >>> but what about when monads are involved?
Rembane 2017-02-04 08:23:16
xcmw: foldM is very good stuff
xcmw 2017-02-04 08:26:20
Rembane: How does foldM help? I am not working with lists
Welkin 2017-02-04 08:27:26
:t foldM
lambdabot 2017-02-04 08:27:28
(Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
michaelt 2017-02-04 08:27:34
:t \f g h -> f >=> return . g >=> h
lambdabot 2017-02-04 08:27:36
Monad m => (a -> m a1) -> (a1 -> b) -> (b -> m c) -> a -> m c
Welkin 2017-02-04 08:27:43
xcmw: it depends on exactly what you are doing
michaelt 2017-02-04 08:27:51
xcmw: like that maybe ^^^
Welkin 2017-02-04 08:28:29
but of course you can use <=< as well
rickygee 2017-02-04 08:28:29
:t >>=
lambdabot 2017-02-04 08:28:31
error: parse error on input '>>='
michaelt 2017-02-04 08:28:42
:t (>>=)
lambdabot 2017-02-04 08:28:44
Monad m => m a -> (a -> m b) -> m b
xcmw 2017-02-04 08:31:23
I see that & maps to >>> and that >>= maps to >=>. What does <&> map too? return . ?
Welkin 2017-02-04 08:31:59
what?
Welkin 2017-02-04 08:32:05
& = flip ($)
Welkin 2017-02-04 08:32:37
<&> = flip <$>
Welkin 2017-02-04 08:32:41
those are the definitions
xcmw 2017-02-04 08:34:28
Welkin: I understand it now
taktoa 2017-02-04 08:39:27
does anyone know why aeson encodes Text without properly escaping it to make valid JSON?
taktoa 2017-02-04 08:40:03
encode ("→" :: Text) becomes "\226\134\146"
taktoa 2017-02-04 08:40:32
which is wrong, it should be "\u2192" (I think.)
taktoa 2017-02-04 08:41:03
at the very least, "\226" is certainly not a valid JSON escape sequence
taktoa 2017-02-04 08:44:17
oh, nevermind, I'm being dumb