Search Haskell Channel Logs

Wednesday, February 8, 2017

#haskell channel featuring merijn, orion, shapr, glguy, halogena1dtoast, Profpatsch,

merijn 2017-02-08 04:48:25
Any opinions whether something like: http://lpaste.net/352229 would be a useful addition for Data.Monoid?
shapr 2017-02-08 05:02:10
halogena1dtoast: yay! link?
halogena1dtoast 2017-02-08 05:11:45
shapr: nhk.halogenandtoast.com and http://github.com/halogenandtoast/nhk-reader-haskell for source
shapr 2017-02-08 05:12:30
oh that's neat!
byorgey 2017-02-08 05:15:47
merijn: this is already in the monoid-extras package, in Data.Monoid.Inf . There might be some instances missing, I'm happy to consider a PR.
Profpatsch 2017-02-08 05:16:52
I want a class where you can define displayable names for all fields in a Record
Profpatsch 2017-02-08 05:16:54
Something like data Foo { a :: Int, b :: Bool }
Profpatsch 2017-02-08 05:16:56
(fieldsOf :: Foo -> [Text]) $ Foo 2 3 == [ "A field", "B field" ]
Profpatsch 2017-02-08 05:16:58
I need that all the time for user interfaces.
Profpatsch 2017-02-08 05:17:07
I'm sure something similar exists already, maybe with Proxies.
Profpatsch 2017-02-08 05:17:17
Can I haz pls?
Profpatsch 2017-02-08 05:17:49
And it should invalidate the instances somehow if there is a new field.
glguy 2017-02-08 05:21:07
Profpatsch: like this? http://lpaste.net/167793
Profpatsch 2017-02-08 05:41:18
glguy: That's cool, yes.
Profpatsch 2017-02-08 05:41:50
glguy: But! It's explicitely not for the field names as they exist.
Profpatsch 2017-02-08 05:42:03
But for attaching a "name" to each field.
Profpatsch 2017-02-08 05:43:35
Maybe even with a naming of type forall a. a possible.
orion 2017-02-08 05:43:53
Hey. My goal is to accept an email from postfix on stdin, pull out the From, To, Subject, Body, and Attachments, convert it to JSON, and send it off to RabbitMQ for further processing. Does anyone know of any good libraries for parsing emails?
Profpatsch 2017-02-08 05:44:20
And you can instantiate it for each type, e.g. Named (Html ()) Foo
Profpatsch 2017-02-08 05:44:33
Ah, I'm procrastinating again. :)