Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 768 769 770 771 772 773 774 775 776 777 778 .. 5022
502,152 events total
2020-10-21 08:42:31 × hnOsmium0001 quits (uid453710@gateway/web/irccloud.com/x-uufhwubdezwfmvks) (Quit: Connection closed for inactivity)
2020-10-21 08:42:59 <Lycurgus> because goedel in one case, einstein/GR/SR in the other
2020-10-21 08:43:23 <Rembane> So good
2020-10-21 08:44:01 francesco_ joins (~francesco@host-82-54-10-114.retail.telecomitalia.it)
2020-10-21 08:44:24 × Franciman quits (~francesco@host-82-48-166-25.retail.telecomitalia.it) (Disconnected by services)
2020-10-21 08:44:28 francesco_ is now known as Franciman
2020-10-21 08:50:28 <Lycurgus> (in contrast to differential forward time travel at relativistic speeds, which makes perfect sense)
2020-10-21 08:51:19 × ishutin_ quits (~Ishutin@80-95-94-59.pool.digikabel.hu) (Remote host closed the connection)
2020-10-21 08:51:26 ishutin joins (~Ishutin@80-95-94-59.pool.digikabel.hu)
2020-10-21 08:51:42 jedws joins (~jedws@121.209.161.98)
2020-10-21 08:52:05 <Lycurgus> any opinions on Control.Monad.Logic as a (pure) prolog?
2020-10-21 08:52:34 × Chi1thangoo quits (~Chi1thang@87.112.60.168) (Ping timeout: 272 seconds)
2020-10-21 08:52:40 MarcelineVQ joins (~anja@198.254.202.72)
2020-10-21 08:55:16 Echosolace joins (~Echosolac@p790105-ipngn4101hiraide.tochigi.ocn.ne.jp)
2020-10-21 08:55:27 Chi1thangoo joins (~Chi1thang@87.112.60.168)
2020-10-21 08:55:45 fendor joins (~fendor@91.141.2.147.wireless.dyn.drei.com)
2020-10-21 08:56:21 × jedws quits (~jedws@121.209.161.98) (Ping timeout: 256 seconds)
2020-10-21 08:56:23 <Echosolace> I'm having some trouble with basic level understanding. Can someone check my thought process here?
2020-10-21 08:56:29 <Echosolace> Function in question:
2020-10-21 08:56:31 <Echosolace> search :: (Eq a) => [a] -> [a] -> Bool
2020-10-21 08:56:32 <Echosolace> search needle haystack =
2020-10-21 08:56:32 <Echosolace> let nlen = length needle
2020-10-21 08:56:32 <Echosolace> in foldl (\acc x -> if take nlen x == needle then True else acc) False (tails haystack)
2020-10-21 08:56:46 <lortabac> Lycurgus: I am not too familiar with Control.Monad.Logic, but I suppose you also need something like unification-fd to make a Prolog
2020-10-21 08:57:13 <Echosolace> So, from the top... We define the typeclass of the function we just named, search.
2020-10-21 08:57:23 <Lycurgus> it has unification i believe but just getting acquainted
2020-10-21 08:57:42 <Echosolace> It has typeclass of equateable. It takes two lists as parameters and returns a boolean.
2020-10-21 08:57:49 <Echosolace> Is that a fair enough understanding so far?
2020-10-21 08:57:50 <Lycurgus> just breaks a lot of commonly used stuff
2020-10-21 08:58:18 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-21 08:58:32 × ishutin quits (~Ishutin@80-95-94-59.pool.digikabel.hu) (Ping timeout: 256 seconds)
2020-10-21 08:58:48 <Lycurgus> but i'm guessing you were referring to dependent types
2020-10-21 08:59:17 <lortabac> Echosolace: 'Eq a =>' is not a type class definition. It is a constraint on type 'a'
2020-10-21 09:00:01 × Andy2011Zoe quits (~Andy2011Z@217.146.82.202) ()
2020-10-21 09:00:03 <Echosolace> Interesting. Ok.
2020-10-21 09:00:16 <lortabac> Echosolace: you can read this type as: '[a] -> [a] -> Bool' where 'a' is an instance of 'Eq'
2020-10-21 09:00:30 <Echosolace> Thank you thank you.
2020-10-21 09:01:00 <ski> Echosolace : you can use a logical operation, instead of the `if'-`then'-`else'
2020-10-21 09:01:04 <Echosolace> Moving down, search needle haystack =
2020-10-21 09:01:19 ph88 joins (~ph88@2a02:8109:9e40:2704:4db:e8f1:c91e:6140)
2020-10-21 09:01:26 <Echosolace> search then parameter 1 and then parameter 2 =
2020-10-21 09:01:39 <Echosolace> I hear "and then" is a bad way to phrase it..
2020-10-21 09:02:11 <Echosolace> Anyways, I believe I'm correct in that we are just naming the parameters there..
2020-10-21 09:02:18 <ski> yes
2020-10-21 09:02:22 × dyniec[m] quits (dyniecmatr@gateway/shell/matrix.org/x-gjzsseikahzwfhmv) (Quit: Idle for 30+ days)
2020-10-21 09:02:24 × vaibhavsagar quits (vaibhavsag@gateway/shell/matrix.org/x-ynipythrsvdyajlm) (Quit: Idle for 30+ days)
2020-10-21 09:02:25 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
2020-10-21 09:02:30 × jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
2020-10-21 09:03:33 <Echosolace> let nlen = length needle - This is predefining a function before an in call I guess. Taking the length of the predefined needle variable.
2020-10-21 09:03:39 berberman_t parts (berberma_4@gateway/shell/matrix.org/x-cgdaaoawojkzwzyx) ("User left")
2020-10-21 09:03:48 <merijn> Echosolace: You can think of typeclass constraints as conditional/prerequisites of types. So "foo :: Eq a => a -> a -> Bool" can be read as "IF 'a' is an instance of Eq THEN 'foo :: a -> a -> Bool' ELSE type error"
2020-10-21 09:04:22 <ski> Echosolace : not defining a function, but a integer (in this case). yes, it's locally defined
2020-10-21 09:04:32 thc202 joins (~thc202@unaffiliated/thc202)
2020-10-21 09:04:50 × Chi1thangoo quits (~Chi1thang@87.112.60.168) (Ping timeout: 256 seconds)
2020-10-21 09:04:52 <Echosolace> And now the meat:
2020-10-21 09:04:53 <Echosolace> in foldl (\acc x -> if take nlen x == needle then True else acc) False (tails haystack)
2020-10-21 09:05:13 berberman_t joins (berberma_4@gateway/shell/matrix.org/x-cgdaaoawojkzwzyx)
2020-10-21 09:05:27 hackage ngx-export-tools 0.4.9.0 - Extra tools for Nginx haskell module https://hackage.haskell.org/package/ngx-export-tools-0.4.9.0 (lyokha)
2020-10-21 09:05:36 ishutin joins (~Ishutin@91-83-11-216.pool.digikabel.hu)
2020-10-21 09:05:43 × cristi_ quits (~cristi@82.76.158.82) (Quit: cristi_)
2020-10-21 09:06:03 <Echosolace> in foldl (moving from left of the array.., adding to an accumulator..., needs a first instance which is defined as False after the )
2020-10-21 09:06:34 <Echosolace> I'm having trouble verbalizing ->
2020-10-21 09:06:50 cristi_ joins (~cristi@82.76.158.82)
2020-10-21 09:07:21 <Echosolace> x is the head of the list in this situation?
2020-10-21 09:07:28 × geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 246 seconds)
2020-10-21 09:07:51 <ski> `x' stands for each element of the list, in turn
2020-10-21 09:08:00 <Echosolace> Thank you.
2020-10-21 09:08:37 <ski> you can read `->' here as "maps to". so `\acc x -> ..acc..x..' is "the function that, when given two parameters, call them `acc' and `x', maps them to `..acc..x..'"
2020-10-21 09:08:50 whatisRT joins (~whatisRT@2002:5b41:6a33:0:5c34:b0ad:5b4d:c699)
2020-10-21 09:09:06 <Echosolace> I'll run that through my head a bit, thanks.
2020-10-21 09:09:19 karanlikmadde joins (~karanlikm@2a01:c22:b046:2a00:715c:4cac:e6ca:b78)
2020-10-21 09:09:37 <ski> (`acc' is the "current result so far" (before taking `x' into account). `..acc.x..' is the "updated result (having taken `x' into account)")
2020-10-21 09:10:18 berberman_t parts (berberma_4@gateway/shell/matrix.org/x-cgdaaoawojkzwzyx) ("User left")
2020-10-21 09:11:20 knupfer joins (~Thunderbi@dynamic-046-114-151-226.46.114.pool.telefonica.de)
2020-10-21 09:12:53 <ski> > foldl (\str n -> "(" ++ str ++ " * " ++ showsPrec 10 n "" ++ ")") "1" [2,3,5,7]
2020-10-21 09:12:55 <lambdabot> "((((1 * 2) * 3) * 5) * 7)"
2020-10-21 09:12:58 jamm_ joins (~jamm@unaffiliated/jamm)
2020-10-21 09:14:20 ishutin_ joins (~Ishutin@94-21-82-21.pool.digikabel.hu)
2020-10-21 09:14:25 × ishutin quits (~Ishutin@91-83-11-216.pool.digikabel.hu) (Ping timeout: 240 seconds)
2020-10-21 09:14:28 × StoneToad quits (~StoneToad@199-167-119-239.ppp.storm.ca) (Ping timeout: 256 seconds)
2020-10-21 09:14:48 × Lycurgus quits (~niemand@98.4.96.235) (Quit: Exeunt)
2020-10-21 09:14:48 × knupfer quits (~Thunderbi@dynamic-046-114-151-226.46.114.pool.telefonica.de) (Read error: Connection reset by peer)
2020-10-21 09:15:04 × bergsans quits (~bergsans@c80-217-8-29.bredband.comhem.se) (Ping timeout: 258 seconds)
2020-10-21 09:15:34 StoneToad joins (~StoneToad@199-167-119-239.ppp.storm.ca)
2020-10-21 09:15:48 CourtneyNZ joins (~CourtneyN@ec2-52-63-156-37.ap-southeast-2.compute.amazonaws.com)
2020-10-21 09:16:04 × dexterfoo quits (dexter@2a01:7e00::f03c:91ff:fe86:59ec) (K-Lined)
2020-10-21 09:16:04 × nh quits (NextHendri@unaffiliated/nexthendrix) (K-Lined)
2020-10-21 09:16:04 × Jon quits (jon@dow.land) (K-Lined)
2020-10-21 09:16:04 × Takumo quits (takumo@unaffiliated/takumokatekari) (K-Lined)
2020-10-21 09:17:29 nh joins (~NextHendr@finickitively.co.uk)
2020-10-21 09:17:53 nh is now known as Guest73576
2020-10-21 09:18:03 × whatisRT quits (~whatisRT@2002:5b41:6a33:0:5c34:b0ad:5b4d:c699) (Quit: ZNC 1.7.5 - https://znc.in)
2020-10-21 09:18:13 × jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
2020-10-21 09:18:24 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-21 09:18:53 Takumo joins (takumo@unaffiliated/takumokatekari)
2020-10-21 09:19:21 dexterfoo joins (dexter@2a01:7e00::f03c:91ff:fe86:59ec)
2020-10-21 09:19:52 Guest73576 is now known as NextHendrix
2020-10-21 09:19:52 × NextHendrix quits (~NextHendr@finickitively.co.uk) (Changing host)
2020-10-21 09:19:52 NextHendrix joins (~NextHendr@unaffiliated/nexthendrix)
2020-10-21 09:21:11 jmtd joins (jon@dow.land)

All times are in UTC.