Search Haskell Channel Logs

Wednesday, February 1, 2017

#haskell channel featuring samvher, edwardk, byorgey, ertes, Tuplanolla, zipper, and 6 others.

ski 2017-02-01 09:47:41
edwardk : anyway, basically i needed(?) to write `mapExistsC :: forall c d f g. (forall a. c a :- d a) -> (forall a. f a -> g a) -> (ExistsC c f -> ExistsC d g); mapExistsC imp fg (HideC fa) = match imp fg fa HideC where match :: forall a. (c a :- d a) -> (f a -> g a) -> c a => f a -> forall o. (d a => g a -> o) -> o; match sub fga fa k = k (fga fa) // sub'
ski 2017-02-01 09:48:01
edwardk : .. alternatively doing `... = match imp fg fa where match :: forall a. (c a :- d a) -> (f a -> g a) -> c a => f a -> ExistsC d g; match sub fga fa = HideC (fga fa) // sub' (but that's not as symmetric ..)
ski 2017-02-01 09:48:37
.. so i was wondering if you perhaps had done anything similar, possibly doing it in a simpler way than this
ertes 2017-02-01 09:49:10
i'll just use the current nanosecond since process start for unique identifiers… should be safe enough
ertes 2017-02-01 09:49:16
just joking
ski 2017-02-01 09:49:41
(ftr, `data ExistsC c f = forall a. c a => HideC (f A)', in case it's not obvious)
edwardk 2017-02-01 09:50:30
ski: not off hand. i don't really have anything for taking a coend over a in p (f a) (g a)
ski 2017-02-01 09:51:01
ok
edwardk 2017-02-01 09:51:03
the two natural transformation like ones are ends of that form, the exists one at theend are coends
ski 2017-02-01 09:51:10
(but you have stuff for ends ?)
edwardk 2017-02-01 09:51:33
Nat serves that purpose
zipper 2017-02-01 09:51:42
Hello edwardk
ski 2017-02-01 09:52:06
oh, `Nat' as in natural transformation ?
edwardk 2017-02-01 09:52:10
yeah
zipper 2017-02-01 09:52:16
Do you guys have issues installing structured haskell mode on linux via stack?
edwardk 2017-02-01 09:52:22
which can be viewed as a particular end
edwardk 2017-02-01 09:52:38
forall a. f a -> g a has that form
ski 2017-02-01 09:53:26
(now `Nat (:~:) (:-)' and `Nat (:~:) (->)' makes more sense :)
ertes 2017-02-01 09:53:34
zipper: for emacs? why would you install that via stack? the common way is via MELPA
zipper 2017-02-01 09:53:59
Not for emacs it requires an executable
zipper 2017-02-01 09:54:11
It seems it's not compatible with the current lts
zipper 2017-02-01 09:54:27
So I tried 1.0.0 and it seems to be working
ski 2017-02-01 09:54:42
edwardk : ends for other profunctors or dinaturals than `(->)' ? `(:-)' ?
edwardk 2017-02-01 09:55:03
i don't think i have those anywhere
ski 2017-02-01 09:55:23
ok
edwardk 2017-02-01 09:56:04
i have some fancy stuff for more interesting profunctors in hask, but thats just because once you have a suitable definition of functor almost everything that is a functor to a functor category is a 'profunctor' under a suitable view
edwardk 2017-02-01 09:56:44
but didn't bother to write the general p (f a) (g a) construction that underlies natural transformations. had to stop somewhere
edwardk 2017-02-01 09:57:30
i wrote up a brief thing on ends and coends as part of my series on kan-extensions, but haven't said much on the topic otherwise
ski 2017-02-01 09:58:04
where's said series ?
samvher 2017-02-01 10:05:38
ski: maybe here, http://comonad.com/reader/2008/kan-extensions/
ski 2017-02-01 10:06:11
hm, i suppose you either mean or
ski 2017-02-01 10:06:17
samvher, *nod*
edwardk 2017-02-01 10:15:43
ski: i think it was the third article
edwardk 2017-02-01 10:16:02
and i meant the comonad.com posts
volhovm 2017-02-01 10:18:16
Is there any cross-platform library for process management? I need to do system-exit w/o exceptions involved (sadly they are handled even on error/exitSuccess). `unix` has `exitImmediately`, but it's for unix only.
Tuplanolla 2017-02-01 10:22:12
Is there a version of `bracket` that rethrows or do I need to make my own?
ph88 2017-02-01 10:23:19
hey guys in this tutorial https://generics-eot.readthedocs.io/en/latest/tutorial.html they mention "the number of the constructor" what kind of number is this ?
byorgey 2017-02-01 10:26:38
ph88: it probably just means that the constructors of a data type are numbered starting from 1 or 0 or something
byorgey 2017-02-01 10:26:54
e.g. in data Foo = Bar | Baz | Quux , Bar has number 0, Baz is number 1, Quux is number 2
ski 2017-02-01 10:27:15
edwardk : ok, ty
byorgey 2017-02-01 10:27:24
This is just an educated guess though
glguy 2017-02-01 10:27:40
Tuplanolla: bracketOnError?
Tuplanolla 2017-02-01 10:28:04
Doesn't it absorb the exception, glguy?
glguy 2017-02-01 10:28:12
err, bracket doesn't absorb the exception already
Tuplanolla 2017-02-01 10:28:25
Oh! Useful.
ski 2017-02-01 10:28:52
Tuplanolla : also `finally'
Tuplanolla 2017-02-01 10:29:11
I have to say the documentation isn't the most clear with the differences.
vimalloc_ 2017-02-01 10:29:22
Haskell noob here. If anyone is feeling particulary bored, do you wanna review some code? It's really basic, just checks if a sudoku is solved or not. It works, but I wanna make sure I'm doing stuff in a good 'haskelly/functional' way before continuing.
glguy 2017-02-01 10:29:28
Tuplanolla: "If an exception is raised, then bracket will re-raise the exception (after performing the release)."
vimalloc_ 2017-02-01 10:29:28
It's https://gist.github.com/vimalloc/44188961d4f19a09bbd4185fd2a5848c
glguy 2017-02-01 10:30:52
vimalloc_: Instead of all (==True) you can write, and. But instead of all (==True) . map f, you can write: all f
glguy 2017-02-01 10:31:26
vimalloc_: You should basically never write (==True), if you ever need that function you can use id
Tuplanolla 2017-02-01 10:31:28
Certainly, glguy. I meant that `onException` says it's "like `finally`", which is a "variant of `bracket`", so I have to go through all of them.
vimalloc_ 2017-02-01 10:31:39
glguy: Thanks!
ski 2017-02-01 10:32:12
@src all
lambdabot 2017-02-01 10:32:13
all p = and . map p
Tuplanolla 2017-02-01 10:32:44
Also some parts use "re-throw" and others "re-raise", so searching for one doesn't get me the others.