Search Haskell Channel Logs

Tuesday, February 28, 2017

#haskell channel featuring ertes, lambdabot, yaxu, byorgey, glguy, sternmull,

ertes 2017-02-28 05:49:21
monochrom: i'm trying isabelle for the above purpose now… seems like everybody is using it, so i figured i might just do the same =)
clmg 2017-02-28 06:00:37
Can fclabels traverse a record?
clmg 2017-02-28 06:00:53
I need to find a record with a specific field
yaxu 2017-02-28 06:03:26
I'm failing to get type inference to work across typeclasses, a minimal example: http://lpaste.net/353064
yaxu 2017-02-28 06:03:53
This in ghci 7.10.3
yaxu 2017-02-28 06:04:13
Any tips on making this work? Would dearly love to do this sort of thing without declaring types!
byorgey 2017-02-28 06:04:29
yaxu: the problem is that it doesn't know what type the '4' should have
byorgey 2017-02-28 06:04:56
yaxu: try toS (4 :: Int)
byorgey 2017-02-28 06:05:00
yaxu: how should it work without declaring types?
yaxu 2017-02-28 06:05:12
byorgey: Yes I get that but would like to not have to declare the type
ertes 2017-02-28 06:05:32
clmg: "traverse"? "find"?
byorgey 2017-02-28 06:05:33
type inference is not allowed to depend on the fact that there is only one instance of Foo, because another module could add another instance later
yaxu 2017-02-28 06:05:44
byorgey: I expected the use of typeclass to constrain the types it would consider
byorgey 2017-02-28 06:06:14
yaxu: no, because typeclass instances are open.
ertes 2017-02-28 06:07:33
clmg: please explain more clearly what you have right now and what you would like to do with it
yaxu 2017-02-28 06:08:26
byorgey: hmm, but I've just noticed (actually someone else noticed) that this works if I use Integer rather than Int
yaxu 2017-02-28 06:13:15
byorgey: hmm, but I've just noticed (actually someone else noticed) that this works if I use Integer rather than Int (resending in case it got lost in the netsplit)
wrengr 2017-02-28 06:37:17
Someone pinged me yesterday?
sternmull 2017-02-28 06:41:57
I have a list like [["ah"], ["bee", "cee"], "dee"] and want to "multiply it out" into ["ahbeedee", "ahceedee"]. What is the function/operator i am looking for?
wz1000 2017-02-28 06:42:13
I remember seeing a non-recursive(in type or value) implementation of the y combinator. Does anyone know of what I am talking about?
pikajude 2017-02-28 06:42:19
sternmull: i don't think that list can exist, can it
pikajude 2017-02-28 06:42:22
it doesn't typecheck
glguy 2017-02-28 06:42:39
> concat <$> sequence [["ah"], ["bee", "cee"], ["dee"]]
lambdabot 2017-02-28 06:42:41
["ahbeedee","ahceedee"]
sternmull 2017-02-28 06:42:46
yes... the last element should be in a list of course
pikajude 2017-02-28 06:42:46
but sequence is what you're looking for
pikajude 2017-02-28 06:42:50
yeah, glguy got it
sternmull 2017-02-28 06:43:02
thank you!
wz1000 2017-02-28 06:43:16
i.e without a recursive type definition like data Mu a = Roll (Mu a -> a)
wz1000 2017-02-28 06:43:49
I remember it used higher ranked types to achieve this.