ertes 2017-03-05 03:49:13
proposal: let's rename 'liftIO' to 'io' =)
johnw 2017-03-05 03:49:31
ertes: easy to do as a local function
ertes 2017-03-05 03:49:54
sure
ertes 2017-03-05 03:50:10
but a first-hand definition has soooooooooooo many advantages, you know
ertes 2017-03-05 03:50:29
like being first-hand
ertes 2017-03-05 03:50:32
and having advantages
cocreature 2017-03-05 03:51:01
I don't think that's a well founded definition of the advantages it provides
ertes 2017-03-05 03:51:30
if you think corecursively it is =)
cocreature 2017-03-05 03:52:24
are corecursive definitions also called „well-founded"?
johnw 2017-03-05 04:02:45
cocreature: I'm not seeing that used in the literature for the case of corecursion
johnw 2017-03-05 04:03:25
in Coq we just talk about the guardedness condition
lyxia 2017-03-05 04:08:47
which is a heuristic for productivity
xubunto 2017-03-05 04:11:20
is it possible to map a prefix expression such as div?
Rembane 2017-03-05 04:11:49
xubunto: Map it to what?
johnw 2017-03-05 04:11:50
lyxia: well, it's a conservative heuristic, and not just "probably productive"
xubunto 2017-03-05 04:12:03
Rembane: 2 values
Rembane 2017-03-05 04:12:35
xubunto: Yes. In a number of ways, for instance: zipWith div [1..10] [10,9..1]
Rembane 2017-03-05 04:12:49
xubunto: Or: map (`div` 10) [1..]
xubunto 2017-03-05 04:13:08
what about (map . map)"
tomboy64 2017-03-05 04:13:50
isn't it map (div 10) [1..]?
xubunto 2017-03-05 04:14:07
tomboy64: trying to see if there is a way to do only div
tomboy64 2017-03-05 04:14:38
xubunto: "only div"?
xubunto 2017-03-05 04:14:57
tomboy64: not div 10, only div
tomboy64 2017-03-05 04:15:08
map it to what?
ertes 2017-03-05 04:15:39
is there a way to convert an at-most-one-Traversal into an IndexPreservingTraversal? writing an IndexPreservingTraversal directly is pretty awkward
xubunto 2017-03-05 04:15:40
tomboy64: 2 lists
tomboy64 2017-03-05 04:16:21
xubunto: map (\x -> map (\y -> div x y) ylist) xlist
Rembane 2017-03-05 04:16:46
tomboy64: If you run div 10, you will divide 10 with something, if you use (`div` 10) you will divide something with ten.
tomboy64 2017-03-05 04:16:53
or [ z | div x y, x <- xlist, y <- ylist ]
tomboy64 2017-03-05 04:17:15
errr
ertes 2017-03-05 04:17:24
xubunto: what are your inputs, and what is the desired result?
tomboy64 2017-03-05 04:17:43
no that can't be right
xubunto 2017-03-05 04:18:07
ertes: i would love to be able to do map div [1,2,3] [4,5,6]
tomboy64 2017-03-05 04:18:09
ertes: 2 lists. he either wants zipWith or something to create a 2d-field
int-e 2017-03-05 04:18:19
tomboy64: did you mean [div x y | x <- xlist, y <- ylist]?
tomboy64 2017-03-05 04:18:28
int-e: exactly
xubunto 2017-03-05 04:18:42
int-e: that is list comp right?
int-e 2017-03-05 04:18:43
you could use applicatives: div <$> xlist <*> ylist
int-e 2017-03-05 04:18:49
xubunto: yes
ertes 2017-03-05 04:19:24
xubunto: and what's the desired result?
ertes 2017-03-05 04:19:40
there are a number of options
xubunto 2017-03-05 04:19:45
ertes: int-e got it
lyxia 2017-03-05 04:19:49
johnw: could we say guardedness is to productivity as well-foundedness is to termination?
xubunto 2017-03-05 04:20:10
i wanted to see if i could use <$> and <*> with a prefix method to better understand how it works
johnw 2017-03-05 04:21:54
lyxia: in Coq that is entirely true. Terminating functions must destruct their argument down to a base case (proven by a well-founded relation), and Productive functions must always construct new layers around subsequent calls (I'm not sure if a means exists, though, to prove this by a relation that represents a greatest fixed point)
johnw 2017-03-05 04:22:21
corecursion is certainly less mature than recursion
johnw 2017-03-05 04:23:13
(er, in Coq)
johnw 2017-03-05 04:23:28
I think if it were used more, it would have better support
lyxia 2017-03-05 04:24:06
I see. Thanks!
ertes 2017-03-05 04:26:11
hmm, -XMultiWayIf doesn't work in arrow notation… great =/
ertes 2017-03-05 04:33:12
there has to be a nicer way to write this: https://gist.github.com/esoeylemez/5dffd42b4fee7f8591c8fddf778830c5
ertes 2017-03-05 04:33:53
(i have traversals with more than two cases, so the 'case' is just for demonstration purposes)
ertes 2017-03-05 04:35:14
i thought of using ArrowMonad, but there is no obvious way to use it that would actually be nicer than this