Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-17 08:56:27 DirefulSalt joins (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt)
2021-03-17 08:56:46 <hololeap> curiousgay: it's talking about exporting class methods, which could be listed explicitly in the class, or elsewhere in the form of `f :: C t => t -> a` (for example)
2021-03-17 08:56:57 × Paks quits (~paks@c-69-136-183-189.hsd1.il.comcast.net) (Ping timeout: 264 seconds)
2021-03-17 08:57:09 × ph88_ quits (~ph88@2a02:8109:9e00:7e5c:85cc:3a34:36cf:1a53) (Ping timeout: 265 seconds)
2021-03-17 08:57:15 <timCF> * I meant `ExceptT` not `EitherT`
2021-03-17 08:57:25 Paks joins (~paks@c-69-136-183-189.hsd1.il.comcast.net)
2021-03-17 08:57:40 <hololeap> curiousgay: when you export/import a class method that is explicitly part of the class, it follows the same form as a data constructor
2021-03-17 08:58:14 <LKoen> famubu: my understanding is that you need to do pattern-matching rather than test for equality; if you want to test for equality you need the whole type [a] to support equality, which requires a to support equality, in which case you should add the requirement "Eq a" to the signature
2021-03-17 08:58:36 <hololeap> curiousgay: import Control.Monad.Trans.Class (MonadTrans (lift)) -- like this
2021-03-17 08:58:42 heatsink joins (~heatsink@2600:1700:bef1:5e10:f837:3533:97b:1f44)
2021-03-17 08:59:07 <curiousgay> hololeap: I said I understand the first part but don't understand the part about variables
2021-03-17 08:59:49 <merijn> curiousgay: It's just saying that "module Foo (MyClass(foo))" and "module Foo (MyClass, foo)" are equivalent
2021-03-17 08:59:49 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-17 09:00:08 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-17 09:00:13 Alleria joins (~textual@zrcout.mskcc.org)
2021-03-17 09:00:15 <merijn> timCF: EitherT isn't a bifunctor
2021-03-17 09:00:21 <merijn> timCF: Neither is ExceptT
2021-03-17 09:00:29 <curiousgay> merijn: you mean qvar doesn't rename methods?
2021-03-17 09:00:36 Alleria is now known as Guest36438
2021-03-17 09:00:47 <famubu> LKoen: That must've been it. I changed it to `listLength [] = 0` and then it worked. Thanks!
2021-03-17 09:00:54 <merijn> curiousgay: I have no clue who/what qvar refers too
2021-03-17 09:01:06 <hololeap> curiousgay: if you look at Data.Foldable, you'll see mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
2021-03-17 09:01:11 × asheshambasta quits (~user@ptr-e1lysauv56fsp3y7v62.18120a2.ip6.access.telenet.be) (Ping timeout: 244 seconds)
2021-03-17 09:01:18 <merijn> famubu: Right, because pattern matching doesn't use Eq nor == :)
2021-03-17 09:01:36 <hololeap> curiousgay: mapM_ isn't explicitly part of the Foldable class, but it's still a class method. i think that's what it is talking about
2021-03-17 09:01:40 <timCF> merijn: well, I think I found function close enough to `first`, it's called `withExceptT`
2021-03-17 09:01:46 <curiousgay> merijn: https://www.haskell.org/onlinereport/haskell2010/haskellch5.html in 5.2 mentions qvar as a single statement
2021-03-17 09:01:47 Sorny joins (~Sornaensi@79.142.232.102)
2021-03-17 09:02:02 <famubu> merijn: I see. Still new to Haskell. :-D
2021-03-17 09:03:05 <merijn> famubu: Common beginner mistake to rely on "== []" over pattern matching :)
2021-03-17 09:03:22 coot joins (~coot@37.30.58.223.nat.umts.dynamic.t-mobile.pl)
2021-03-17 09:03:22 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-17 09:03:38 × heatsink quits (~heatsink@2600:1700:bef1:5e10:f837:3533:97b:1f44) (Ping timeout: 264 seconds)
2021-03-17 09:03:43 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-17 09:04:32 acidjnk_new joins (~acidjnk@p200300d0c72b9506e0723511d2830c2e.dip0.t-ipconnect.de)
2021-03-17 09:04:50 × jrqc quits (rofl@2603:3016:805:8f20:e1a6:a5b:7383:5872) (Ping timeout: 264 seconds)
2021-03-17 09:04:54 × Guest36438 quits (~textual@zrcout.mskcc.org) (Ping timeout: 260 seconds)
2021-03-17 09:04:54 × Sorna quits (~Sornaensi@077213203030.dynamic.telenor.dk) (Ping timeout: 260 seconds)
2021-03-17 09:05:10 peutri_ is now known as peutri
2021-03-17 09:05:38 dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com)
2021-03-17 09:05:49 unlink_ joins (~unlink2@p200300ebcf13b600588c7881abb1ea42.dip0.t-ipconnect.de)
2021-03-17 09:06:37 <hololeap> timCF: you can use `liftEither :: MonadError e m => Either e a -> m a` and `ExceptT :: m (Either e a) -> ExceptT e m a`
2021-03-17 09:06:38 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-17 09:06:43 <curiousgay> hololeap: it's talking about naming values, field names and class methods as variables
2021-03-17 09:06:48 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-17 09:06:53 hackage tree-diff 0.2 - Diffing of (expression) trees. https://hackage.haskell.org/package/tree-diff-0.2 (phadej)
2021-03-17 09:07:34 <hololeap> curiousgay: if i understand correctly, mapM_ is an example of a class method as a variable
2021-03-17 09:07:34 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-17 09:07:44 <curiousgay> 5.2 in Haskell report says: "A value, field name, or class method, whether declared in the module body or imported, may be named by giving the name of the value as a qvarid, which must be in scope. Operators should be enclosed in parentheses to turn them into qvarids."
2021-03-17 09:07:54 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-17 09:08:57 Sorny is now known as Sornaensis
2021-03-17 09:09:04 <dminuoso> curiousgay: I think you misunderstand what "variable" means.
2021-03-17 09:09:14 jrqc joins (~rofl@96.78.87.197)
2021-03-17 09:09:21 <dminuoso> In Haskell we use "variable" in a more mathematical sense. That is "variable" is not a mutable reference
2021-03-17 09:09:25 <merijn> Also, don't mix "lexical definition" and "language semantics"
2021-03-17 09:09:38 <dminuoso> It's rather a placeholder that refers to some expression/value
2021-03-17 09:09:58 <hololeap> dminuoso: or function, right?
2021-03-17 09:10:07 <dminuoso> (It's variable in the sense that if you wrote `let x = 5 in exp` you could vary the value of `x` without altering `exp`
2021-03-17 09:10:16 <dminuoso> hololeap: functions are values
2021-03-17 09:10:28 <curiousgay> dminuoso: I understand the mathematical sense of variables, but I'm confused about defining them inside module/import declaration
2021-03-17 09:10:32 <hololeap> just wanted to clarify
2021-03-17 09:10:41 × dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Ping timeout: 265 seconds)
2021-03-17 09:10:52 idhugo_ joins (~idhugo@80-62-116-180-mobile.dk.customer.tdc.net)
2021-03-17 09:11:29 <hololeap> curiousgay: it's the easiest case
2021-03-17 09:11:29 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-17 09:11:33 <dminuoso> curiousgay: In simple terms, you can import *variables* by writing `import Mod (var1, var2, ...)`
2021-03-17 09:11:54 Alleria__ joins (~textual@zrcout.mskcc.org)
2021-03-17 09:11:57 <dminuoso> But `MyClass(var)` is just special syntax, however
2021-03-17 09:11:59 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-17 09:12:05 × nitrix quits (~nitrix@haskell/developer/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
2021-03-17 09:12:26 <dminuoso> And it turns out, methods are just variables
2021-03-17 09:12:44 <curiousgay> dminuoso: that's what the first part in gentle introduction before the word "or" said
2021-03-17 09:12:59 <curiousgay> ah
2021-03-17 09:13:23 × idhugo quits (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) (Ping timeout: 265 seconds)
2021-03-17 09:13:23 × emmanuel_erc quits (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com) (Read error: Connection reset by peer)
2021-03-17 09:13:26 <curiousgay> never mind, you didn't write nested brackets
2021-03-17 09:13:34 emmanuel_erc joins (~user@2603-7000-9600-01c9-0000-0000-0000-0874.res6.spectrum.com)
2021-03-17 09:16:05 fiQ2 joins (~fiQ@mirkk.ninja)
2021-03-17 09:16:17 ADG1089__ joins (~aditya@106.214.253.186)
2021-03-17 09:16:43 × Alleria__ quits (~textual@zrcout.mskcc.org) (Ping timeout: 256 seconds)
2021-03-17 09:16:44 nitrix joins (~nitrix@haskell/developer/nitrix)
2021-03-17 09:18:53 hackage eventlog2html 0.9.0 - Visualise an eventlog https://hackage.haskell.org/package/eventlog2html-0.9.0 (mpickering)
2021-03-17 09:19:12 × bitmagie quits (~Thunderbi@200116b806d4970045cae2470eb56c01.dip.versatel-1u1.de) (Quit: bitmagie)
2021-03-17 09:20:55 malumore joins (~malumore@151.62.112.239)
2021-03-17 09:22:06 × ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection)
2021-03-17 09:23:05 ADG1089__ joins (~aditya@106.214.253.186)
2021-03-17 09:24:29 <famubu> Can't we use negative numbers in the `..` notation for lists? `[5,3..0]` gives `[5,3,1]` but `[5,3..-1]` gave error saying a variable named `..-` is not in scope.
2021-03-17 09:24:53 <hololeap> > [5,3..(-1)]
2021-03-17 09:24:56 <lambdabot> [5,3,1,-1]
2021-03-17 09:25:23 <famubu> hololeap: Thanks. :-)
2021-03-17 09:25:36 <hololeap> it gets confused with `-` being a prefix operator
2021-03-17 09:25:51 × howdoi quits (uid224@gateway/web/irccloud.com/x-cnfnotqfqspqvzjj) (Quit: Connection closed for inactivity)
2021-03-17 09:27:25 e2 joins (e2@sponsored.by.bnc4you.xyz)
2021-03-17 09:29:00 <hololeap> famubu: when in doubt, put negative Num literals in parenthesis
2021-03-17 09:29:54 <famubu> hololeap: +1
2021-03-17 09:31:20 × ADG1089__ quits (~aditya@106.214.253.186) (Remote host closed the connection)
2021-03-17 09:34:15 <shad0w_> famubu: you mean (-1) ? : p
2021-03-17 09:35:16 × Sathiana quits (~kath@185-113-98-38.cust.bredband2.com) (Quit: WeeChat 3.0)
2021-03-17 09:36:16 <merijn> Or use a space
2021-03-17 09:36:27 <merijn> Pretty sure that work, anyway

All times are in UTC.