Search Haskell Channel Logs

Tuesday, January 31, 2017

#haskell channel featuring hpc, lambdabot, erisco, pikajude, antalsz, mr_sm1th, and 9 others.

janos 2017-01-31 12:47:12
dmj`, lambdabot, hpc: thanks guys! No I have something to read.
janos 2017-01-31 12:47:18
*now
jle` 2017-01-31 12:53:22
Jello_Raptor: there's one in type-combinators
jle` 2017-01-31 12:53:29
type-combinators has an HList too
hpc 2017-01-31 12:54:15
antalsz: ".Lazy" refers to the ByteString data type, not the IO
hpc 2017-01-31 12:54:27
antalsz: a lazy bytestring is a list of strict bytestring "chunks"
antalsz 2017-01-31 12:54:48
@hpc: And `writeFile` will force the whole thing and write it out?
lambdabot 2017-01-31 12:54:48
Unknown command, try @list
Jello_Raptor 2017-01-31 12:55:01
jle`: Thanks :)
glguy 2017-01-31 12:55:10
antalsz: @ is for bot commands
hpc 2017-01-31 12:55:18
yes, unless the documentation says it uses lazy IO
hpc 2017-01-31 12:55:30
which is usually very explicit because it's a source of bugs
antalsz 2017-01-31 12:55:32
glguy: I know, I've just been using Slack too much lately :-)
antalsz 2017-01-31 12:55:49
hpc: And that even answered my second question about how to know the answer! Thanks :-)
antalsz 2017-01-31 12:55:56
s/know/learn/
hpc 2017-01-31 12:56:23
https://hackage.haskell.org/package/bytestring-0.10.8.1/docs/Data-ByteString-Lazy.html#v:hGetContents - an example of lazy IO documented
antalsz 2017-01-31 12:58:21
awesome
Jello_Raptor 2017-01-31 12:58:32
jle`: This looks more like a type level Either, I want something like `HEither :: [*] -> *` with stuff like `_3 :: HEither (_:_:c:_) -> Maybe c`
erisco 2017-01-31 13:09:13
how can I tell ghci to run lifted IO without printing (because it then complains there is no Show instance)
Koterpillar 2017-01-31 13:11:04
erisco: void?
erisco 2017-01-31 13:11:54
never mind there should be a function in the lib somewhere
Koterpillar 2017-01-31 13:12:20
:t void
lambdabot 2017-01-31 13:12:22
Functor f => f a -> f ()
mr_sm1th 2017-01-31 13:12:24
Is there a Haskell function that groups concurrent occuranses in a list and makes a list of list out of them?
Koterpillar 2017-01-31 13:12:32
erisco: that is the function you want
jle` 2017-01-31 13:12:33
Jello_Raptor: that's this here http://hackage.haskell.org/package/type-combinators-0.2.4.3/docs/Data-Type-Sum.html
erisco 2017-01-31 13:12:37
no, it isn't
kadoban 2017-01-31 13:12:52
:t group -- mr_sm1th, this?
mr_sm1th 2017-01-31 13:12:53
e.g. "ssdddabb" -> ["ss", "dd", "a", "bb"]
lambdabot 2017-01-31 13:12:54
Eq a => [a] -> [[a]]
jle` 2017-01-31 13:12:55
Jello_Raptor: your HEither = HList Identity
kadoban 2017-01-31 13:13:06
Ya, group
mr_sm1th 2017-01-31 13:13:28
Nice.
mr_sm1th 2017-01-31 13:13:31
Thx.
Koterpillar 2017-01-31 13:13:38
erisco: hmm, I could run my function in GHCi without problems
kadoban 2017-01-31 13:13:42
Anytime
Koterpillar 2017-01-31 13:14:07
erisco: http://lpaste.net/351838
erisco 2017-01-31 13:14:56
no, I have m () for some MonadIO
Koterpillar 2017-01-31 13:15:33
and you want to liftIO it?
erisco 2017-01-31 13:15:42
no
Koterpillar 2017-01-31 13:16:00
well, GHCi can't run any MonadIO, just IO
erisco 2017-01-31 13:16:27
yes that's right, so I need to locate the correct function to tear away Symbolic
erisco 2017-01-31 13:16:33
from this heap of stuff http://hackage.haskell.org/package/sbv-5.15/docs/Data-SBV.html#t:Symbolic
Koterpillar 2017-01-31 13:16:54
Oh. So this is not about "without printing" or a Show instance
erisco 2017-01-31 13:17:10
it was
erisco 2017-01-31 13:17:16
then I realised I needed something else
erisco 2017-01-31 13:19:11
unfortunately I am mystified oO
barrucadu 2017-01-31 13:25:32
erisco: I think you might need to get a `Symbolic SBool` and then use `prove`, `sat`, or `allSat` to get the variable assignment the solver comes up with.
erisco 2017-01-31 13:25:58
seems so barrucadu
Sonolin 2017-01-31 13:26:41
I'm starting to learn lenses, and can anybody explain why "view (_ix 3)" requires a list of Monoids?
Sonolin 2017-01-31 13:26:44
https://ptpb.pw/YUZO/haskell
Sonolin 2017-01-31 13:27:15
I tried inspecting the :i of Const, and it seems there's a Monoid instance for Const... not sure if that's related, but I can't for the life of me figure out where Monoid comes in here
Sonolin 2017-01-31 13:30:08
ah! I think I get it now :)
Sonolin 2017-01-31 13:30:15
Applicative requries Monoid (for Const)
pikajude 2017-01-31 13:30:15
Sonolin: view requires a Monoid iirc
noan 2017-01-31 13:30:29
oh wow I feel a certain special sort of dumb. I can't get a haskell hello world happening for me with stack right now
Sonolin 2017-01-31 13:30:43
yea I understand now thanks pikajude :)
pikajude 2017-01-31 13:30:56
Sonolin: because if the getter fails, it needs to return mempty
Sonolin 2017-01-31 13:31:13
...which completely makes sense... I was just trying to wrap my head around why my custom code was requiring Monoid
pikajude 2017-01-31 13:31:26
oh
Sonolin 2017-01-31 13:31:44
(i.e. I implemented view with "\l s -> getConst (Const l s)" and was confused)
noan 2017-01-31 13:31:53
got it.
Sonolin 2017-01-31 13:32:39
erm "getConst (l Const s)"
noan 2017-01-31 13:32:40
haskell exec somefoo-exe just needed to be haskell exec somefoo-exe.exe because windows.
glguy 2017-01-31 13:32:54
Sonolin: The issue is specifically that: instance Monoid m => Applicative (Const m)
Sonolin 2017-01-31 13:33:18
cool thanks for clarification glguy