Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-18 17:24:28 <koz_> fmap fmap fmap sequence fmap rofl
2021-03-18 17:26:05 bahamas joins (~lucian@unaffiliated/bahamas)
2021-03-18 17:27:08 × kuribas quits (~user@ptr-25vy0i92dp498ona6ki.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
2021-03-18 17:28:06 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2021-03-18 17:28:24 × kritzefitz_ quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-03-18 17:28:33 <koz_> :t fmap fmap fmap sequence fmap
2021-03-18 17:28:35 <lambdabot> (Traversable t, Monad m) => (a1 -> m a2) -> t a1 -> m (t a2)
2021-03-18 17:28:47 <koz_> Just... how.
2021-03-18 17:29:40 <tomsmeding> :t (.) (.) (.) sequence fmap
2021-03-18 17:29:42 <lambdabot> (Traversable t, Monad m) => (a1 -> m a2) -> t a1 -> m (t a2)
2021-03-18 17:29:55 × wopas32 quits (uid384704@gateway/web/irccloud.com/x-zmlpbitgmcaytcfj) (Quit: Connection closed for inactivity)
2021-03-18 17:30:18 <koz_> Ah yes.
2021-03-18 17:30:30 epicte7us joins (~epictetus@ip72-194-215-136.sb.sd.cox.net)
2021-03-18 17:30:50 <koz_> Sadly I don't think mapM is actually defined either of those ways.
2021-03-18 17:31:13 × Foritus quits (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net) (Ping timeout: 260 seconds)
2021-03-18 17:31:22 <koz_> :t (<$>) (<$>) (<$>) sequence (<$>)
2021-03-18 17:31:24 <lambdabot> (Traversable t, Monad m) => (a1 -> m a2) -> t a1 -> m (t a2)
2021-03-18 17:32:08 <koz_> Something something 'statements dreamed up by the utterly deranged' something. :P
2021-03-18 17:32:58 × malumore quits (~malumore@151.62.122.146) (Ping timeout: 245 seconds)
2021-03-18 17:33:23 × ep1ctetus quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Ping timeout: 245 seconds)
2021-03-18 17:34:17 Foritus joins (~buggery@cpc91316-watf11-2-0-cust68.15-2.cable.virginm.net)
2021-03-18 17:35:29 <tomsmeding> :t traverse
2021-03-18 17:35:30 <lambdabot> (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
2021-03-18 17:35:36 <tomsmeding> the same but more general
2021-03-18 17:35:45 <tomsmeding> resistence is futile
2021-03-18 17:37:09 elliott__ joins (~elliott@pool-108-51-101-42.washdc.fios.verizon.net)
2021-03-18 17:37:48 × Yumasi quits (~guillaume@2a01:e0a:5cb:4430:2eb3:d0f5:cc9d:3dff) (Ping timeout: 244 seconds)
2021-03-18 17:37:49 <koz_> Yeah, traverse does everything is a meme is not a meme. :P
2021-03-18 17:37:53 hackage erlang-ffi 1.0.0 - Send messages to an Erlang node using Haskell https://hackage.haskell.org/package/erlang-ffi-1.0.0 (Szetty)
2021-03-18 17:38:14 <monochrom> s/sequence/sequenceA/ for the Applicative version.
2021-03-18 17:38:26 <monochrom> :t fmap fmap fmap sequenceA fmap
2021-03-18 17:38:28 <lambdabot> (Traversable t, Applicative f) => (a1 -> f a2) -> t a1 -> f (t a2)
2021-03-18 17:39:22 × geekosaur quits (82650c7a@130.101.12.122) (Ping timeout: 240 seconds)
2021-03-18 17:41:34 × forgottenone quits (~forgotten@176.42.16.24) (Quit: Konversation terminated!)
2021-03-18 17:41:43 × Major_Biscuit quits (~Major_Bis@82-169-100-198.biz.kpn.net) (Ping timeout: 260 seconds)
2021-03-18 17:41:47 <hyperisco> concatenative programming sticks functions together with function composition
2021-03-18 17:41:59 × Shiranai quits (beed0de4@gateway/web/cgi-irc/kiwiirc.com/ip.190.237.13.228) (Quit: Connection closed)
2021-03-18 17:42:08 <hyperisco> is there an analogue but sticks things together with fmap?
2021-03-18 17:42:22 × chele quits (~chele@ip5b40237d.dynamic.kabel-deutschland.de) (Remote host closed the connection)
2021-03-18 17:42:31 <koz_> "Bro do u even lift" programming.
2021-03-18 17:42:42 <monochrom> You can coin the name "functorial programming".
2021-03-18 17:42:53 <aldum> lol
2021-03-18 17:43:24 <shad0w_> you could open the youtube channel fun fun functorials
2021-03-18 17:43:28 × jrqc quits (~rofl@96.78.87.197) (Ping timeout: 260 seconds)
2021-03-18 17:46:37 jrqc joins (~rofl@96.78.87.197)
2021-03-18 17:46:40 <koz_> Or 'Fun Fun Literature Club'.
2021-03-18 17:46:49 <koz_> Or 'Fun Fun Revolution'.
2021-03-18 17:47:03 <infinisil> I wrote a function `f :: Applicative f => Compose Maybe f a -> Compose f Maybe a`
2021-03-18 17:47:10 <infinisil> Is there a more general implementation of this?
2021-03-18 17:47:42 <koz_> Something like Compose . sequenceA . unCompose
2021-03-18 17:47:51 <monochrom> :)
2021-03-18 17:47:55 <infinisil> Oh yeah that looks like sequence
2021-03-18 17:47:57 <infinisil> Nice
2021-03-18 17:48:11 <infinisil> :t sequenceA
2021-03-18 17:48:13 <lambdabot> (Traversable t, Applicative f) => t (f a) -> f (t a)
2021-03-18 17:48:50 <koz_> (runCompose? deCompose? compost? decay?)
2021-03-18 17:49:10 <infinisil> getCompose :)
2021-03-18 17:49:31 <koz_> Wow, the least fun option.
2021-03-18 17:49:37 <koz_> It should really be 'decompose'.
2021-03-18 17:50:09 malumore joins (~malumore@151.62.122.146)
2021-03-18 17:50:43 <monochrom> newtype Compost f g a = Compost{fertilizer :: f (g a)}
2021-03-18 17:50:48 <koz_> Or actually, coerce sequenceA might work too.
2021-03-18 17:51:01 <infinisil> :t coerce
2021-03-18 17:51:03 <lambdabot> error:
2021-03-18 17:51:03 <lambdabot> • Variable not in scope: coerce
2021-03-18 17:51:03 <lambdabot> • Perhaps you meant ‘coerced’ (imported from Control.Lens)
2021-03-18 17:51:13 <koz_> (maybe, if Traversable doesn't hate on derivation again)
2021-03-18 17:51:33 <koz_> % :t coerce
2021-03-18 17:51:34 <yahb> koz_: Coercible a b => a -> b
2021-03-18 17:51:41 <koz_> Which tells you very little.
2021-03-18 17:52:03 <koz_> % :t coerce sequenceA
2021-03-18 17:52:03 <yahb> koz_: (Traversable t, Applicative f, Coercible b (t (f a) -> f (t a))) => b
2021-03-18 17:52:22 <koz_> I mean, in _theory_ that should work?
2021-03-18 17:52:32 × jrqc quits (~rofl@96.78.87.197) (Ping timeout: 240 seconds)
2021-03-18 17:52:36 <infinisil> % coerce sequenceA :: Compose Maybe f a -> Compose f Maybe a
2021-03-18 17:52:36 <yahb> infinisil: ; <interactive>:18:21: error: Not in scope: type constructor or class `Compose'; <interactive>:18:42: error: Not in scope: type constructor or class `Compose'
2021-03-18 17:53:08 <koz_> % import Data.Functor.Compose (Compose (Compose))
2021-03-18 17:53:09 <yahb> koz_:
2021-03-18 17:53:12 <infinisil> Well, the Compose . sequenceA . getCompose works well, and coerce sounds too scary :P
2021-03-18 17:53:30 <koz_> % :t coerce sequenceA :: Compose Maybe f a -> Compose f Maybe a
2021-03-18 17:53:30 <yahb> koz_: ; <interactive>:1:1: error:; * Couldn't match representation of type: f1 (Maybe a1); with that of: f0 [a0]; arising from a use of `coerce'; * In the expression: coerce sequenceA :: Compose Maybe f a -> Compose f Maybe a
2021-03-18 17:53:35 <koz_> Oh ffs.
2021-03-18 17:54:25 <koz_> There's probably some magic combination of @-nnotations and snails that can direct Coercible properly there.
2021-03-18 17:55:33 <koz_> :% :set -fshow-foralls
2021-03-18 17:55:39 <koz_> % :set -fshow-foralls
2021-03-18 17:55:40 <yahb> koz_: Some flags have not been recognized: -fshow-foralls
2021-03-18 17:55:47 <koz_> Argh what's that damned flag.
2021-03-18 17:55:52 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-03-18 17:56:05 <koz_> % :set -fprint-explicit-foralls
2021-03-18 17:56:05 <yahb> koz_:
2021-03-18 17:56:13 <koz_> % :t coerce sequenceA
2021-03-18 17:56:13 <yahb> koz_: forall {t :: * -> *} {f :: * -> *} {b} {a}. (Traversable t, Applicative f, Coercible b (t (f a) -> f (t a))) => b
2021-03-18 17:56:26 × shad0w_ quits (a0ca254d@160.202.37.77) (Quit: Connection closed)
2021-03-18 17:56:27 jrqc joins (~rofl@96.78.87.197)
2021-03-18 17:56:46 <koz_> % :t coerce sequenceA @_ @_ (Compose Maybe f a -> Compose f Maybe a)
2021-03-18 17:56:46 <yahb> koz_: ; <interactive>:1:25: error: View pattern in expression context: Compose Maybe f a -> Compose f Maybe a
2021-03-18 17:56:53 <koz_> % :t coerce sequenceA @_ @_ @(Compose Maybe f a -> Compose f Maybe a)
2021-03-18 17:56:53 <yahb> koz_: ; <interactive>:1:40: error: Not in scope: type variable `f'; <interactive>:1:42: error: Not in scope: type variable `a'; <interactive>:1:55: error: Not in scope: type variable `f'; <interactive>:1:63: error: Not in scope: type variable `a'
2021-03-18 17:57:12 <koz_> % :t coerce sequenceA @Maybe @f @(Compose Maybe f a -> Compose f Maybe a)
2021-03-18 17:57:13 <yahb> koz_: ; <interactive>:1:26: error: Not in scope: type variable `f'; <interactive>:1:44: error: Not in scope: type variable `f'; <interactive>:1:46: error: Not in scope: type variable `a'; <interactive>:1:59: error: Not in scope: type variable `f'; <interactive>:1:67: error: Not in scope: type variable `a'

All times are in UTC.