Logs: freenode/#haskell
| 2020-10-17 13:51:32 | <bifunc2> | Is it appropriate to put an integration test into an HUnit testCase? |
| 2020-10-17 13:52:13 | × | nyd quits (~lpy@unaffiliated/elysian) (Quit: nyd) |
| 2020-10-17 13:53:03 | × | cdepillabout quits (~cdepillab@pl35600.ag1001.nttpc.ne.jp) (Quit: Leaving) |
| 2020-10-17 13:55:06 | → | fendor joins (~fendor@046124068105.public.t-mobile.at) |
| 2020-10-17 13:55:31 | × | drbean quits (~drbean@TC210-63-209-144.static.apol.com.tw) (Ping timeout: 256 seconds) |
| 2020-10-17 13:55:49 | × | Nahra quits (~Nahra@unaffiliated/nahra) (Quit: leaving) |
| 2020-10-17 13:57:14 | × | da39a3ee5e6b4b0d quits (~textual@n11211935170.netvigator.com) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-10-17 13:57:36 | × | nbloomf quits (~nbloomf@2600:1700:83e0:1f40:a405:7897:267b:514b) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-10-17 14:00:50 | → | petersen joins (~petersen@redhat/juhp) |
| 2020-10-17 14:00:57 | → | da39a3ee5e6b4b0d joins (~textual@n11211935170.netvigator.com) |
| 2020-10-17 14:01:52 | → | gnrp1 joins (~gnrp@84.39.117.57) |
| 2020-10-17 14:06:46 | × | bifunc2 quits (bifunc2@gateway/vpn/protonvpn/bifunc2) (Ping timeout: 246 seconds) |
| 2020-10-17 14:07:30 | → | Sheilong joins (uid293653@gateway/web/irccloud.com/x-mfevbueuacsxobra) |
| 2020-10-17 14:15:20 | → | kotrcka joins (~kotrcka@ip-94-112-194-11.net.upcbroadband.cz) |
| 2020-10-17 14:16:14 | → | howdoi joins (uid224@gateway/web/irccloud.com/x-ingbgflergmrjqkw) |
| 2020-10-17 14:16:30 | → | djellemah joins (~djellemah@2601:5c2:100:96c:e008:b638:39fe:6a54) |
| 2020-10-17 14:16:35 | → | nbloomf joins (~nbloomf@2600:1700:83e0:1f40:fc2b:b27d:96e3:a54e) |
| 2020-10-17 14:17:50 | × | nbloomf quits (~nbloomf@2600:1700:83e0:1f40:fc2b:b27d:96e3:a54e) (Client Quit) |
| 2020-10-17 14:21:06 | × | dwt quits (~dwt@c-98-200-58-177.hsd1.tx.comcast.net) (Ping timeout: 272 seconds) |
| 2020-10-17 14:30:41 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2020-10-17 14:31:17 | → | GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) |
| 2020-10-17 14:31:17 | × | GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host) |
| 2020-10-17 14:31:17 | → | GyroW joins (~GyroW@unaffiliated/gyrow) |
| 2020-10-17 14:31:52 | × | GyroW_ quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 272 seconds) |
| 2020-10-17 14:32:25 | × | ericsagnes quits (~ericsagne@2405:6580:0:5100:1942:718:5977:178d) (Ping timeout: 240 seconds) |
| 2020-10-17 14:33:47 | × | xff0x quits (~fox@2001:1a81:53c5:c200:800e:b588:fbcf:aa74) (Ping timeout: 260 seconds) |
| 2020-10-17 14:33:59 | <zincy__> | Is it correct to refer to the parameter in Maybe's type constructor as a polymorphic type variable? |
| 2020-10-17 14:34:38 | → | xff0x joins (~fox@2001:1a81:53c5:c200:3161:a29a:3186:4358) |
| 2020-10-17 14:34:45 | <L29Ah> | s/polymorphic// |
| 2020-10-17 14:35:15 | <zincy__> | Does that mean delete the word? |
| 2020-10-17 14:35:28 | → | urodna joins (~urodna@unaffiliated/urodna) |
| 2020-10-17 14:35:33 | × | lnlsn quits (~lnlsn@2804:14c:2b:891d::1007) (Ping timeout: 272 seconds) |
| 2020-10-17 14:35:35 | × | kotrcka quits (~kotrcka@ip-94-112-194-11.net.upcbroadband.cz) (Quit: kotrcka) |
| 2020-10-17 14:35:49 | <L29Ah> | yes |
| 2020-10-17 14:36:14 | → | conal joins (~conal@64.71.133.70) |
| 2020-10-17 14:36:18 | × | invaser quits (~Thunderbi@31.148.23.125) (Quit: invaser) |
| 2020-10-17 14:36:44 | → | invaser joins (~Thunderbi@31.148.23.125) |
| 2020-10-17 14:36:51 | <zincy__> | Ok thanks |
| 2020-10-17 14:37:54 | → | dwt joins (~dwt@c-98-200-58-177.hsd1.tx.comcast.net) |
| 2020-10-17 14:37:57 | → | bitmapper joins (uid464869@gateway/web/irccloud.com/x-nisutrzlzcwlcitv) |
| 2020-10-17 14:38:48 | <ski> | zincy__ : not polymorphic |
| 2020-10-17 14:39:03 | × | dhil quits (~dhil@195.213.192.122) (Ping timeout: 260 seconds) |
| 2020-10-17 14:39:33 | → | Tops2 joins (~Tobias@dyndsl-095-033-019-139.ewe-ip-backbone.de) |
| 2020-10-17 14:39:57 | <zincy__> | ski: Maybe I dont understand what polymorphism is but when I see a type variable I just think oh look polymorphic |
| 2020-10-17 14:40:02 | <zincy__> | Is that misguided? |
| 2020-10-17 14:40:03 | <ski> | (parametric types begets polymorphic operations on such types. so there is a relation) |
| 2020-10-17 14:40:45 | <ski> | `length' is polymorphic. its type `[a] -> Int' is not polymorphic (nor is the type variable `a', in that type, polymorphic) |
| 2020-10-17 14:41:15 | <zincy__> | Oh so polymorphism refers to operations on values of different types |
| 2020-10-17 14:41:41 | <zincy__> | Whereas type variable is just about representation |
| 2020-10-17 14:41:48 | <ski> | the explicit type of `length' is `forall a. [a] -> Int'. Haskell allows you to leave out the `forall' in source, and it'll be inserted implicitly by the language. but it's always, conceptually, there |
| 2020-10-17 14:42:12 | <ski> | a value is polymorphic if and only if it has a type of general shape `forall a. ..a..' |
| 2020-10-17 14:42:24 | <zincy__> | Ah thanks! |
| 2020-10-17 14:42:47 | <ski> | just like a value is a list if and only if it has a type of general shape `[...]'. or is a function if and only if it has a type of general shape `... -> ...' |
| 2020-10-17 14:42:54 | <zincy__> | So just functions can be polymorphic? |
| 2020-10-17 14:43:10 | × | Tops2 quits (~Tobias@dyndsl-095-033-019-139.ewe-ip-backbone.de) (Client Quit) |
| 2020-10-17 14:43:15 | <ski> | no. e.g. `Nothing' is not a function, but is still polymorphic. has type `forall a. Maybe a' |
| 2020-10-17 14:43:56 | <zincy__> | Is Nothing not a data constructor and data constructors are functions? |
| 2020-10-17 14:44:07 | <ski> | not all deata constructors are functions, no |
| 2020-10-17 14:44:25 | <ski> | `Nothing' doesn't have a type that looks like `... -> ...'. hence it's not a function |
| 2020-10-17 14:45:06 | <zincy__> | So only data constructors which are parameterised by at least one other value are functions? |
| 2020-10-17 14:45:10 | × | jpcooper quits (~user@unaffiliated/jpcooper) (Ping timeout: 272 seconds) |
| 2020-10-17 14:45:13 | <ski> | in fact, strictly speaking, `Just' isn't a function, either. it has type `forall a. a -> Maybe a'. it's a "polymorphic value (that when specialized, will become a function)" |
| 2020-10-17 14:45:14 | → | ericsagnes joins (~ericsagne@2405:6580:0:5100:54da:6b21:e514:b8a2) |
| 2020-10-17 14:45:18 | × | fragamus_ quits (~michaelgo@73.93.152.141) (Read error: Connection reset by peer) |
| 2020-10-17 14:45:38 | <ski> | yes, data constructors which take arguments, which "pack data fields", are functions |
| 2020-10-17 14:46:07 | <ski> | (or, in this case, "polymorphic functions", meaning "polymorphic value, that when specialized, will become a function") |
| 2020-10-17 14:46:24 | <zincy__> | So forall a. id :: a -> a isn't a function? |
| 2020-10-17 14:46:33 | <zincy__> | Until you parameterise the `a`? |
| 2020-10-17 14:46:45 | × | Katarushisu quits (~Katarushi@82.30.254.24) (Quit: The Lounge - https://thelounge.chat) |
| 2020-10-17 14:47:18 | <ski> | strictly speaking, it's not a function. but if we take `id :: forall a. a -> a', and specialize this, replacing `a' by `Bool' say, we get `id :: Bool -> Bool', which is a function |
| 2020-10-17 14:47:51 | <zincy__> | Thanks, I have upgraded my thinking |
| 2020-10-17 14:47:55 | × | unlink2 quits (~unlink2@p200300ebcf17c500f1cd4c5efbdddd1e.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 2020-10-17 14:48:02 | <ski> | one perhaps confusing part here is that the specializing of a polymorphic value is written as nothing, in the syntax. we still write `id'. but conceptually, it's an operation |
| 2020-10-17 14:48:07 | <zincy__> | And to think I understood data constructors and Maybe :D |
| 2020-10-17 14:48:21 | <ski> | (with a language extension, you can actually write `id @Bool' for this) |
| 2020-10-17 14:49:00 | <zincy__> | Yeah so the polymorphic value becomes a function at some point during run time |
| 2020-10-17 14:49:44 | <ski> | you can think of it as being a kind of expression node, in the abstract syntax tree in the implementation. it's just that it's (usually) written as nothing, in the source code |
| 2020-10-17 14:50:00 | → | cole-h_ joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2020-10-17 14:50:25 | → | fragamus joins (~michaelgo@73.93.152.141) |
| 2020-10-17 14:50:26 | <zincy__> | Ah thanks |
| 2020-10-17 14:51:28 | hackage | path-io 1.6.1 - Interface to ‘directory’ package for users of ‘path’ https://hackage.haskell.org/package/path-io-1.6.1 (mrkkrp) |
| 2020-10-17 14:51:47 | × | isBEKaml quits (~~.~@unaffiliated/isbekaml) (Quit: Leaving) |
| 2020-10-17 14:52:00 | → | jneira_ joins (~jneira@111.red-176-83-68.dynamicip.rima-tde.net) |
| 2020-10-17 14:52:11 | <ski> | something like `data Exp | Var Ident | Con Ident | App Exp Exp | Spec Exp Typ | ...' with `data Typ = TyVar Ident | TyCon Ident | Fun Typ Typ | Forall Ident Typ | ...' |
| 2020-10-17 14:52:14 | <zincy__> | So is the general shape the same for parametric and adhoc polymorphism? |
| 2020-10-17 14:52:29 | <zincy__> | Or is the difference there just the behaviour of the operation |
| 2020-10-17 14:53:25 | <ski> | you could represent an expression like `not (id False)', using this AST, as `App (Var "not") (App (Spec (Var "id") (TyCon "Bool")) (Con "False"))' |
| 2020-10-17 14:53:54 | <ski> | zincy__ : the difference is that the latter also involve type class constraints |
| 2020-10-17 14:54:08 | <zincy__> | Ok gotcha |
| 2020-10-17 14:54:34 | <ski> | `sort :: forall a. Ord a => [a] -> [a]' means `sort :: forall a. ((Ord a) => ([a] -> [a]))' |
| 2020-10-17 14:54:45 | <zincy__> | So will that AST be reqritten when the `a` is specialised? |
| 2020-10-17 14:54:59 | <zincy__> | And when would the rewriting occur? |
| 2020-10-17 14:55:01 | <ski> | `... => ...' is a separate operation on types. you could call it the type of overloaded operations, i suppose |
| 2020-10-17 14:55:56 | <zincy__> | Interesting |
| 2020-10-17 14:57:08 | <ski> | well, in that example, `Var "id"' would be classified as having the type (namely `forall a. a -> a') expressed by `Forall "a" (Fun (TyVar "a") (TyVar "a"))' |
| 2020-10-17 14:57:40 | → | knupfer joins (~Thunderbi@200116b82cc5f5003098c64aed4ab9ee.dip.versatel-1u1.de) |
| 2020-10-17 14:58:02 | → | alp_ joins (~alp@2a01:e0a:58b:4920:417:348e:da6e:d990) |
| 2020-10-17 14:58:37 | <ski> | specializing that to `Bool', we have that `Spec (Var "id")' is classified by `Fun (TyCon "Bool") (TyCon "Bool")' |
| 2020-10-17 14:59:32 | × | hiroaki quits (~hiroaki@2a02:908:4b18:e20::a362) (Ping timeout: 246 seconds) |
| 2020-10-17 15:00:01 | × | gnrp1 quits (~gnrp@84.39.117.57) () |
All times are in UTC.