Search Haskell Channel Logs

Thursday, February 2, 2017

#haskell channel featuring piyush-kurur, jophish, mbrock, ocharles, merijn, hpc,

reactormonk 2017-02-02 01:55:40
I've got a record Request { host :: ByteString }, and a Maybe ByteString. How do I maybe update the record?
hpc 2017-02-02 01:56:41
decide what you want out of the Just case, and then decide what you want out of the Nothing case
hpc 2017-02-02 01:57:11
and then see if that lines up with anything that already exists, or write your own thing
piyush-kurur 2017-02-02 02:01:14
request for help from anyone with openbsd+haskell.
reactormonk 2017-02-02 02:01:15
I'd guess there something I could do with lenses?
piyush-kurur 2017-02-02 02:02:52
i would like someone to confirm that raaz compiles with openbsd (http://github.com/raaz-crypto/raaz)
piyush-kurur 2017-02-02 02:03:50
essentially I have used arc4random for entropy on openbsd which needs to be tested
piyush-kurur 2017-02-02 02:06:47
https://github.com/raaz-crypto/raaz/issues/298
jophish 2017-02-02 02:29:04
tdammers: amazing, thanks!
ocharles 2017-02-02 02:30:05
reactormonk: fmap (\a -> r { host = a}) maybeBytestring is one option
ocharles 2017-02-02 02:30:18
err
ocharles 2017-02-02 02:30:28
well, it certainly is one option, but it's probably not what you want :p
reactormonk 2017-02-02 02:30:48
ocharles, I have about 6 updates, about 3 with Maybe
ocharles 2017-02-02 02:30:50
perhaps fromMaybe r (fmap (\a -> r { host = a}) maybeBytestring) is better
ocharles 2017-02-02 02:31:16
reactormonk: lift the non-maybes into maybe with Just, then compose the whole thing with applicative. But there's not enough information in your question to provide a good answer
ocharles 2017-02-02 02:31:19
there are multiple strategies
ocharles 2017-02-02 02:31:36
Should the update happen if *all* Maybe's are Just? Or should we just filter the "Just"s out and ignore the Nothings?
reactormonk 2017-02-02 02:31:46
https://gist.github.com/d3d1248d5e1b88cf2ad2cfcf2c96aa50
reactormonk 2017-02-02 02:32:12
Don't set the Just, update everything else.
mbrock 2017-02-02 02:36:57
interesting how the Turtle library doesn't seem to provide a function of type Shell Line -> IO Text
merijn 2017-02-02 02:37:29
Man...sometimes I really wish we had first-class patterns...
mbrock 2017-02-02 02:38:09
(...and interesting in general how hard most programming languages make it to run another program and get the content of stdout...)
merijn 2017-02-02 02:43:45
There's no way to match an (unknown) constructor which must have one field, is there?