Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 774 775 776 777 778 779 780 781 782 783 784 .. 5022
502,152 events total
2020-10-21 11:36:08 <ski> so e.g. `take :: Int -> [a] -> [a]' really means `take :: Int -> ([a] -> [a])', and `take 3 "abcdefgh"' really means `(take 3) "abcdefgh"'
2020-10-21 11:36:14 <ski> doesn't matter
2020-10-21 11:36:27 <ski> > take 3 "abcdefgh"
2020-10-21 11:36:29 <lambdabot> "abc"
2020-10-21 11:36:35 <ski> > map (take 3) (tails "abcdefgh")
2020-10-21 11:36:38 <lambdabot> ["abc","bcd","cde","def","efg","fgh","gh","h",""]
2020-10-21 11:36:45 machinedgod joins (~machinedg@24.105.81.50)
2020-10-21 11:37:16 <ski> `take 3' is a function that, when given a list as input, will give the list of the first three elements of that list (or less, if there wasn't three elements available)
2020-10-21 11:37:16 <nicknick> If we apply some (but not all)of the arguments to a function, what kind of function do we get as a result? ONE WORD ANSWER?
2020-10-21 11:37:39 <nicknick> what kind of function?
2020-10-21 11:38:12 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-21 11:38:22 <ski> one sometimes says that one gets a "partially applied" function. but that's not a property of the function itself, but rather of the way one arrived at it
2020-10-21 11:39:38 <ski> > elem 'c' "abcd"
2020-10-21 11:39:40 <lambdabot> True
2020-10-21 11:39:42 <ski> > elem 'e' "abcd"
2020-10-21 11:39:45 <lambdabot> False
2020-10-21 11:40:08 <ski> @let elemAbcd x = elem x "abcd"
2020-10-21 11:40:09 <lambdabot> Defined.
2020-10-21 11:40:16 <ski> > elemAbcd 'b'
2020-10-21 11:40:19 <lambdabot> True
2020-10-21 11:40:33 <ski> one could claim that `elemAbcd' is a partial application of `elem'
2020-10-21 11:42:56 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds)
2020-10-21 11:46:15 polyrain joins (~polyrain@2001:8003:e501:6901:1965:2d83:52d2:222c)
2020-10-21 11:46:51 × nicknick quits (75d746c7@117.215.70.199) (Remote host closed the connection)
2020-10-21 11:48:32 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-21 11:51:24 totallynotnate is now known as notnatebtw
2020-10-21 11:51:27 × borne quits (~fritjof@200116b864c00d0000dd0a7f6ac41015.dip.versatel-1u1.de) (Ping timeout: 260 seconds)
2020-10-21 11:51:49 borne joins (~fritjof@muedsl-82-207-207-196.citykom.de)
2020-10-21 11:51:59 danvet joins (~danvet@2a02:168:57f4:0:5f80:650d:c6e6:3453)
2020-10-21 11:52:11 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
2020-10-21 11:52:35 × danvet quits (~danvet@2a02:168:57f4:0:5f80:650d:c6e6:3453) (Client Quit)
2020-10-21 11:52:35 bartemius joins (~bartemius@109-252-19-142.nat.spd-mgts.ru)
2020-10-21 11:53:00 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds)
2020-10-21 11:57:38 × haasn quits (~nand@mpv/developer/haasn) (Quit: ZNC 1.7.5+deb4 - https://znc.in)
2020-10-21 11:57:59 haasn joins (~nand@mpv/developer/haasn)
2020-10-21 11:58:42 cristi_ joins (~cristi@82.76.158.82)
2020-10-21 11:58:43 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-21 11:59:03 nbloomf joins (~nbloomf@2600:1700:ad14:3020:6cd0:22a:1738:5d24)
2020-10-21 11:59:25 geekosaur joins (ac3a3eb0@172.58.62.176)
2020-10-21 11:59:34 × cristi_ quits (~cristi@82.76.158.82) (Remote host closed the connection)
2020-10-21 12:00:02 × tlockney quits (~tlockney@185.204.1.185) ()
2020-10-21 12:01:00 × whatisRT quits (~whatisRT@2002:5b41:6a33:0:5c34:b0ad:5b4d:c699) (Ping timeout: 246 seconds)
2020-10-21 12:01:27 × mirrorbird quits (~psutcliff@2a00:801:42b:7891:16b1:e53f:55b2:15e1) (Quit: Leaving)
2020-10-21 12:02:07 × Echosolace quits (~Echosolac@p790105-ipngn4101hiraide.tochigi.ocn.ne.jp) (Ping timeout: 246 seconds)
2020-10-21 12:03:13 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 264 seconds)
2020-10-21 12:04:40 urodna joins (~urodna@unaffiliated/urodna)
2020-10-21 12:06:49 GyroW_ joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
2020-10-21 12:06:49 × GyroW_ quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
2020-10-21 12:06:49 GyroW_ joins (~GyroW@unaffiliated/gyrow)
2020-10-21 12:08:01 darjeeli1 joins (~darjeelin@122.245.123.118)
2020-10-21 12:08:16 × GyroW quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 272 seconds)
2020-10-21 12:08:29 AlterEgo- joins (~ladew@124-198-158-163.dynamic.caiway.nl)
2020-10-21 12:09:15 ixlun joins (~matthew@213.205.241.94)
2020-10-21 12:10:26 <ixlun> Hi all, I was wondering if anyone knew of a way of making an equivalent of swapMVar, swapMVar_ :: MVar a -> a -> IO ()
2020-10-21 12:10:37 <ixlun> I tried `void . swapMVar'
2020-10-21 12:10:58 <ixlun> but that ends up somehow getting rid of the IO monad
2020-10-21 12:11:10 <ixlun> :t void . swapMVar
2020-10-21 12:11:11 <lambdabot> error:
2020-10-21 12:11:11 <lambdabot> Variable not in scope: swapMVar :: a -> f a0
2020-10-21 12:11:15 <merijn> ixlun: Yes, because swapMVar takes two arguments, not 1
2020-10-21 12:11:25 nicknick joins (75d746c7@117.215.70.199)
2020-10-21 12:11:28 <[exa]> ixlun: you need the magical (.).(.) operator
2020-10-21 12:11:32 <merijn> ixlun: So it's inferring that you're using the Monad instance of functions
2020-10-21 12:11:40 iMonad joins (1bf6c255@27-246-194-85.adsl.fetnet.net)
2020-10-21 12:11:46 <nicknick> I need an explanation for a0 n xs = foldr (^) n xs
2020-10-21 12:11:48 <merijn> or just, you know, using a variable name
2020-10-21 12:12:07 <[exa]> merijn: so pointful
2020-10-21 12:12:17 <merijn> nicknick: You should probably start by saying where you get confused :)
2020-10-21 12:12:24 <nicknick> What is a0 n xs = foldr (^) n xs doing?
2020-10-21 12:12:50 <ski> @type ((() <$) .) . Control.Concurrent.MVar.swapMVar
2020-10-21 12:12:51 <lambdabot> GHC.MVar.MVar b -> b -> IO ()
2020-10-21 12:13:13 <ixlun> merijn: What's the magical operator you mention above? I can't seem to hoogle that one
2020-10-21 12:13:32 <nicknick> Please tell me: What is a0 n xs = foldr (^) n xs doing?
2020-10-21 12:13:42 raichoo joins (~raichoo@dslb-084-062-114-218.084.062.pools.vodafone-ip.de)
2020-10-21 12:13:49 <ski> nicknick : `a0 2 [3,4,5] = 3 ^ (4 ^ (5 ^ 2))'
2020-10-21 12:14:16 × random quits (~random@185.219.70.106) (Quit: Leaving)
2020-10-21 12:14:23 coot_ joins (~coot@37.30.49.141.nat.umts.dynamic.t-mobile.pl)
2020-10-21 12:14:29 <ski> @let infixr 9 .:; (.:) :: (c0 -> c1) -> (a -> b -> c0) -> (a -> b -> c1); (.:) = (.) . (.)
2020-10-21 12:14:31 <lambdabot> Defined.
2020-10-21 12:14:43 <merijn> ixlun: I didn't mention it and you shouldn't use it, tbh
2020-10-21 12:14:47 <ski> @type (() <$) .: Control.Concurrent.MVar.swapMVar
2020-10-21 12:14:48 <lambdabot> GHC.MVar.MVar b -> b -> IO ()
2020-10-21 12:15:41 <[exa]> ixlun: take a look at type of (.) and compare with (.).(.) (or with the one that ski just defined)
2020-10-21 12:15:50 × coot quits (~coot@37.30.49.255.nat.umts.dynamic.t-mobile.pl) (Ping timeout: 260 seconds)
2020-10-21 12:15:51 coot_ is now known as coot
2020-10-21 12:17:46 <ixlun> :t (.) . (.)
2020-10-21 12:17:47 <lambdabot> (b -> c) -> (a1 -> a2 -> b) -> a1 -> a2 -> c
2020-10-21 12:17:56 geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr)
2020-10-21 12:18:13 <iMonad> hi, guys. I have a trouble with monad transformer.
2020-10-21 12:18:23 karanlikmadde joins (~karanlikm@2a01:c22:b046:2a00:218a:97bb:be49:dab9)
2020-10-21 12:18:34 <iMonad> I am following the wikibook MaybeT example
2020-10-21 12:18:42 <iMonad> newtype MaybeT m a = MaybeT { runMaybeT :: m (Maybe a) }
2020-10-21 12:18:49 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-21 12:18:57 <iMonad> instance Monad m => Monad (MaybeT m) where return = MaybeT . return . Just
2020-10-21 12:18:59 coot_ joins (~coot@37.30.51.114.nat.umts.dynamic.t-mobile.pl)
2020-10-21 12:19:12 <iMonad> but it can't compile
2020-10-21 12:19:39 <iMonad> it says
2020-10-21 12:19:40 <iMonad> • Could not deduce (Applicative (MaybeT m)) arising from the superclasses of an instance declaration from the context: Monad m bound by the instance declaration at main.hs:4:10-36 • In the instance declaration for ‘Monad (MaybeT m)’ |4 | instance Monad m => Monad (MaybeT m) where
2020-10-21 12:19:53 <[exa]> iMonad: please pastebin the longer messages
2020-10-21 12:20:13 <ski> you need to make an `Applicative' (and a `Functor') instance, as well

All times are in UTC.