2024/05/03

Newest at the top

2024-05-03 16:26:30 +0200 <gaff> kuribas: I know
2024-05-03 16:26:10 +0200 <gaff> wha I found was that the binding in the `do` block forces an evaluation while in the applicative style it may/does not. I am not sure I am right, though.
2024-05-03 16:25:12 +0200 <kuribas> gaff: the do desugars to: p >>= \x -> many p >>= \xs -> return (x:xs)
2024-05-03 16:24:50 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds)
2024-05-03 16:24:31 +0200 <EvanR> different implementations
2024-05-03 16:24:30 +0200 <kuribas> gaff: For a lawful instance the should be the same, but it isn't garanteed.
2024-05-03 16:24:25 +0200 <EvanR> oh you're right. But yeah
2024-05-03 16:24:23 +0200 <gaff> well, `some` in that example has the same type in both styles.
2024-05-03 16:23:53 +0200 <EvanR> they don't have the same type by default
2024-05-03 16:23:53 +0200 <lambdabot> Num p => p
2024-05-03 16:23:52 +0200 <kuribas> :t 4
2024-05-03 16:23:51 +0200 <lambdabot> Num p => p
2024-05-03 16:23:50 +0200 <kuribas> :t 3
2024-05-03 16:23:42 +0200 <kuribas> gaff: Some type doesn't mean the same expression.
2024-05-03 16:23:25 +0200 <lambdabot> Monad m => a -> m a
2024-05-03 16:23:25 +0200 <EvanR> :t return
2024-05-03 16:23:08 +0200tv(~tv@user/tv)
2024-05-03 16:22:58 +0200 <gaff> EvanR: I am not sure what you mena there, Both expressions have the same type.
2024-05-03 16:22:15 +0200 <EvanR> otherwise, one expands to Monad the other Applicative class
2024-05-03 16:21:50 +0200 <EvanR> not if you enable ApplicativeDo
2024-05-03 16:21:43 +0200agent314_(~quassel@104.193.135.218) (Ping timeout: 268 seconds)
2024-05-03 16:21:37 +0200agent314(~quassel@185.102.218.105.adsl.inet-telecom.org)
2024-05-03 16:21:35 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2024-05-03 16:20:10 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds)
2024-05-03 16:19:23 +0200onion(~yin@user/zero)
2024-05-03 16:19:14 +0200 <gaff> Is there any difference between writing code in the applicative vs monadic style? For example, `some p = do { x <- p; xs <- many p; return (x:xs) }` VS `some p = (:) <$> p <*> many p`?
2024-05-03 16:17:43 +0200onion(~yin@user/zero) (Ping timeout: 255 seconds)
2024-05-03 16:17:20 +0200 <kuribas> "forall a. " means "for any type a"
2024-05-03 16:17:05 +0200waleee(~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Quit: WeeChat 4.1.2)
2024-05-03 16:16:54 +0200 <kuribas> That's what (f :: forall a. a -> a) means
2024-05-03 16:16:38 +0200gaff(~gaff@49.207.227.255)
2024-05-03 16:16:25 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2024-05-03 16:16:21 +0200 <kuribas> First argument of "id'" should be a function that works on any type.
2024-05-03 16:16:19 +0200machinedgod(~machinedg@d173-183-246-216.abhsia.telus.net)
2024-05-03 16:15:30 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds)
2024-05-03 16:15:19 +0200 <kuribas> You say succ would work with any type, but it doesn't.
2024-05-03 16:11:35 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2024-05-03 16:11:26 +0200danse-nr3(~danse-nr3@151.43.124.243) (Ping timeout: 255 seconds)
2024-05-03 16:11:12 +0200euphores(~SASL_euph@user/euphores)
2024-05-03 16:10:22 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds)
2024-05-03 16:06:39 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2024-05-03 16:05:14 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds)
2024-05-03 16:04:50 +0200euphores(~SASL_euph@user/euphores) (Quit: Leaving.)
2024-05-03 16:02:36 +0200onion(~yin@user/zero)
2024-05-03 16:01:32 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2024-05-03 16:01:26 +0200ft(~ft@p3e9bc1bf.dip0.t-ipconnect.de) (Quit: leaving)
2024-05-03 16:00:29 +0200onion(~yin@user/zero) (Ping timeout: 240 seconds)
2024-05-03 15:59:38 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds)
2024-05-03 15:56:27 +0200stiell_(~stiell@gateway/tor-sasl/stiell)
2024-05-03 15:55:26 +0200stiell_(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds)