Search Haskell Channel Logs

Monday, February 20, 2017

#haskell channel featuring monochrom, bollu, spaceshi1s, lambdabot, Tuplanolla, nitrix, and 9 others.

Tuplanolla 2017-02-20 06:46:07
Well, I don't see how `foldMapOf` would be needed here.
JuanDaugherty 2017-02-20 06:46:15
it's the revers of factoring
spaceshi1s 2017-02-20 06:46:37
yeah
JuanDaugherty 2017-02-20 06:47:32
don't recall a name for that, evaluation, finding product
ski 2017-02-20 06:48:07
"expansion into terms" perhaps
ski 2017-02-20 06:49:52
"multiply out" ?
spaceshi1s 2017-02-20 06:50:35
multiply out? ah, something we could just do ourselves
JuanDaugherty 2017-02-20 06:53:01
or "find the polynomial"
monochrom 2017-02-20 06:55:20
sum of products
nshepperd_ 2017-02-20 06:56:09
nitrix: constraints package has that, I think. There's a type for constraint implication that gets a category instance
thatguy 2017-02-20 06:56:21
what is the easiest way if I want a program that converts chars to ints in the following way: a to 1, b to 2, ...
thatguy 2017-02-20 06:56:57
nvm
monochrom 2017-02-20 06:57:03
HSTNF = highschool teacher normal form :)
spaceshi1s 2017-02-20 07:00:16
hah!
nshepperd_ 2017-02-20 07:01:51
nitrix: newtype a :- b = Sub (a => Dict b)
nitrix 2017-02-20 07:02:50
nshepperd_: Ah! An EdwardK package, who've thought :P
glguy 2017-02-20 07:02:58
Tuplanolla: foldMapOf is just a use of Const, there's no magic. Instead of using Const we're using (,) here
ocramz 2017-02-20 07:03:00
hullo!
nitrix 2017-02-20 07:03:01
nshepperd_: Checking. Very appreciated.
nshepperd_ 2017-02-20 07:03:48
There's an edwardk package for that ™
ocramz 2017-02-20 07:04:20
Sending out a thought to edwardk for a prompt full recovery
Tuplanolla 2017-02-20 07:10:06
:t presetBad -- I still have to clean up this type, glguy.
lambdabot 2017-02-20 07:10:09
MonadReader a m => ((Maybe a2 -> (First a2, Maybe a3)) -> a -> (First a1, d)) -> m (Maybe a1, d)
Tuplanolla 2017-02-20 07:10:52
There's clearly `(a -> f b) -> s -> f t` in there.
Squarism 2017-02-20 07:13:30
anyone know if theres some trick to make aeson "to-json" conversion take a provided TimeZone in to account and convert date/time types into some timezone local datetime representation?
nitrix 2017-02-20 07:13:49
nshepperd_: I'm truely impressed. Turns out, it's called type entailment and someone thought of it before me :P
Akii 2017-02-20 07:14:49
johnw: thanks for your suggestion regarding rewriting my transformerstack, that should work
johnw 2017-02-20 07:15:41
Akii: it will save you from storing a lambda inside an Either in many places, which *might* have a performance impact
Akii 2017-02-20 07:16:12
I thought I'd need to make this a monad http://lpaste.net/352780
Akii 2017-02-20 07:16:25
but all I really need to do is to make this state and have a function manipulate it
Tuplanolla 2017-02-20 07:18:44
Does `MonadReader r m => Lens r t (Maybe a) (Maybe b) -> m (Maybe a, t)` look right to you, glguy?
johnw 2017-02-20 07:18:45
sound right; plus, it can't be a monad
Akii 2017-02-20 07:18:58
johnw: as we figured out yesterday D
Akii 2017-02-20 07:18:59
:D
Akii 2017-02-20 07:19:06
was fun trying though
glguy 2017-02-20 07:19:38
Tuplanolla: Generally you shouldn't take an actual Lens as a parameter, you'd take some non-polymorphically typed argument
johnw 2017-02-20 07:20:08
you can use ALens' to take a lens as a parameter
johnw 2017-02-20 07:20:16
(or ALens, in this case)
johnw 2017-02-20 07:20:24
just know that you have to call cloneLens on it before you can use it
glguy 2017-02-20 07:20:35
In this case it would be better to not take an ALens either, but the specific type you needed
glguy 2017-02-20 07:20:44
otherwise you'll have an unnecessary cloneLens in the definition
Tuplanolla 2017-02-20 07:21:18
What would that be? The explicit function type.
glguy 2017-02-20 07:21:49
for example: (<<.~) :: LensLike ((,) a) s t a b -> b -> s -> (a, t)
glguy 2017-02-20 07:21:59
this is a function very similar to what you're implementing
Tuplanolla 2017-02-20 07:22:15
Ah, I did take a look at that one earlier.
glguy 2017-02-20 07:23:55
Also the operation you were using wouldn't have been compatible with the Lens version since what you were using wasn't a Lens
Tuplanolla 2017-02-20 07:24:17
So I have `MonadReader r m => LensLike ((,) (First a)) r t (Maybe a) (Maybe b) -> m (Maybe a, t)`.
glguy 2017-02-20 07:24:46
That seems fine
Tuplanolla 2017-02-20 07:27:03
:t Data.IORef.atomicModifyIORef' -- Now the last annoyance is that the return value is swapped wrt this.
lambdabot 2017-02-20 07:27:05
GHC.IORef.IORef a -> (a -> (a, b)) -> IO b
Tuplanolla 2017-02-20 07:31:18
This is similar to asking whether `StateT` should've been `s -> m (s, a)` instead of `s -> m (a, s)`.
JuanDaugherty 2017-02-20 07:31:18
does 8.0.2 actually have so many fixes as to make upgrade needful?
JuanDaugherty 2017-02-20 07:31:35
(from 8.0.1)
JuanDaugherty 2017-02-20 07:32:37
s/so many/such/
glguy 2017-02-20 07:33:44
JuanDaugherty: You can look at the release notes to determine if the things that were fixed are important to you
bollu 2017-02-20 07:33:55
does anyone know of a standalone implementation of OutsideIn(X) type inference?
bollu 2017-02-20 07:33:59
(that is, not part of GHC)
JuanDaugherty 2017-02-20 07:34:34
glguy, ty