Logs: freenode/#haskell
| 2020-10-19 19:15:08 | <lambdabot> | Maybe you meant: wn v rc pl id do bf @ ? . |
| 2020-10-19 19:15:10 | <hyperisco> | crestfallen, did you realise that @[] is not a value and not an empty list? |
| 2020-10-19 19:15:17 | → | cosimone joins (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd) |
| 2020-10-19 19:16:11 | → | recon_- joins (~quassel@2602:febc:0:b6::6ca2) |
| 2020-10-19 19:16:22 | <crestfallen> | thanks all, yeah hyperisco it is a setting, so ghci knows what f you want pure to indicate |
| 2020-10-19 19:16:32 | <crestfallen> | indicate? word choice |
| 2020-10-19 19:17:49 | <hyperisco> | if you like, all types are passed as parameters, but normally they are passed implicitly by the compiler |
| 2020-10-19 19:18:06 | → | conal joins (~conal@64.71.133.70) |
| 2020-10-19 19:18:22 | <hyperisco> | if you want to pass a type explicitly, you can use TypeApplications to do so |
| 2020-10-19 19:18:34 | → | ystael joins (~ystael@168.sub-174-196-209.myvzw.com) |
| 2020-10-19 19:19:02 | <crestfallen> | ok yeah so if you set it, and wanted to write a full expression, what would the (shortened) expression look like? |
| 2020-10-19 19:19:24 | <crestfallen> | I'm assuming it is a more terse expression |
| 2020-10-19 19:19:26 | <hyperisco> | I am not sure what you are asking for |
| 2020-10-19 19:20:18 | → | Lycurgus joins (~niemand@98.4.96.235) |
| 2020-10-19 19:20:29 | <crestfallen> | Like instead of using Just ((:) 2) <*> (pure []) |
| 2020-10-19 19:21:02 | × | knupfer quits (~Thunderbi@200116b82c450700441c7c862ee5eb73.dip.versatel-1u1.de) (Quit: knupfer) |
| 2020-10-19 19:21:07 | <crestfallen> | if it were to be already set, could you have a shorter expression? |
| 2020-10-19 19:21:20 | → | knupfer joins (~Thunderbi@200116b82c45070071699ce90995afec.dip.versatel-1u1.de) |
| 2020-10-19 19:21:26 | × | knupfer quits (~Thunderbi@200116b82c45070071699ce90995afec.dip.versatel-1u1.de) (Client Quit) |
| 2020-10-19 19:21:39 | → | knupfer joins (~Thunderbi@200116b82c4507006c8b8e4546ef723c.dip.versatel-1u1.de) |
| 2020-10-19 19:21:39 | × | knupfer quits (~Thunderbi@200116b82c4507006c8b8e4546ef723c.dip.versatel-1u1.de) (Client Quit) |
| 2020-10-19 19:21:58 | <geekosaur> | if you had one where it could be inferred |
| 2020-10-19 19:22:21 | <geekosaur> | have you tried asking ghci the type of the expression with and without the @[] ? |
| 2020-10-19 19:22:24 | <hyperisco> | types can be inferred, values cannot be (if we ignore ImplicitParams) |
| 2020-10-19 19:22:27 | → | knupfer joins (~Thunderbi@200116b82c450700f42c1c1a4887d4fe.dip.versatel-1u1.de) |
| 2020-10-19 19:22:27 | × | knupfer quits (~Thunderbi@200116b82c450700f42c1c1a4887d4fe.dip.versatel-1u1.de) (Client Quit) |
| 2020-10-19 19:22:43 | × | recon_- quits (~quassel@2602:febc:0:b6::6ca2) (Remote host closed the connection) |
| 2020-10-19 19:23:17 | → | knupfer joins (~Thunderbi@200116b82c450700018f4d4b438b9de8.dip.versatel-1u1.de) |
| 2020-10-19 19:23:17 | × | knupfer quits (~Thunderbi@200116b82c450700018f4d4b438b9de8.dip.versatel-1u1.de) (Client Quit) |
| 2020-10-19 19:23:28 | → | knupfer joins (~Thunderbi@200116b82c450700a035f643f76eb1ae.dip.versatel-1u1.de) |
| 2020-10-19 19:23:32 | <crestfallen> | let me try that thanks geekosaur |
| 2020-10-19 19:23:33 | × | knupfer quits (~Thunderbi@200116b82c450700a035f643f76eb1ae.dip.versatel-1u1.de) (Read error: Connection reset by peer) |
| 2020-10-19 19:23:33 | <hyperisco> | you can golf your code there but it isn't going to be helped by a type application |
| 2020-10-19 19:23:38 | → | coot_ joins (~coot@37.30.52.239.nat.umts.dynamic.t-mobile.pl) |
| 2020-10-19 19:23:43 | → | knupfer joins (~Thunderbi@200116b82c4507005d2376b981a68d64.dip.versatel-1u1.de) |
| 2020-10-19 19:23:51 | → | recon_- joins (~quassel@2602:febc:0:b6::6ca2) |
| 2020-10-19 19:23:52 | <crestfallen> | thanks one moment |
| 2020-10-19 19:24:45 | × | coot quits (~coot@37.30.52.68.nat.umts.dynamic.t-mobile.pl) (Ping timeout: 240 seconds) |
| 2020-10-19 19:24:45 | coot_ | is now known as coot |
| 2020-10-19 19:25:37 | → | ggainey joins (~ggainey@185.204.1.185) |
| 2020-10-19 19:25:50 | <hyperisco> | going on a tangent… you need more sophisticated types than Haskell has (conveniently) on offer to have useful value inference |
| 2020-10-19 19:26:36 | × | geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 256 seconds) |
| 2020-10-19 19:26:37 | × | tomboy64 quits (~tomboy64@gateway/tor-sasl/tomboy64) (Remote host closed the connection) |
| 2020-10-19 19:26:48 | <monochrom> | You know how people prefer following tangents than following direct relevant productive answers. |
| 2020-10-19 19:27:17 | → | sfvm joins (~sfvm@37.228.215.148) |
| 2020-10-19 19:27:25 | × | AceNovo quits (~chris@184.101.162.142) (Remote host closed the connection) |
| 2020-10-19 19:28:04 | <monochrom> | The excitement of maximizing mysterious, uncertainty, adventures, and procrastinating actually solving the problem at hand. |
| 2020-10-19 19:28:09 | <hyperisco> | well I am not sure what the thinking is, but if it is wondering why we have to still state values when the type is already known, it is a relevant point |
| 2020-10-19 19:28:41 | <monochrom> | No, the question is why or when to state types. |
| 2020-10-19 19:28:51 | <hyperisco> | there is no reason to assume Haskell's asymmetry of values and types if you have a fresh perspective |
| 2020-10-19 19:29:39 | <monochrom> | phrased very unclearly, but it is still asking about when to omit types |
| 2020-10-19 19:29:59 | <monochrom> | or when to legally omit types |
| 2020-10-19 19:30:32 | × | ystael quits (~ystael@168.sub-174-196-209.myvzw.com) (Read error: Connection reset by peer) |
| 2020-10-19 19:30:47 | → | thir joins (~thir@p200300f27f0b040039cda3b6fce8e5af.dip0.t-ipconnect.de) |
| 2020-10-19 19:32:07 | × | conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 2020-10-19 19:33:43 | → | tomboy64 joins (~tomboy64@gateway/tor-sasl/tomboy64) |
| 2020-10-19 19:33:54 | → | conal joins (~conal@64.71.133.70) |
| 2020-10-19 19:35:54 | → | Pitaya joins (~mdomin45@cpe-24-211-129-187.nc.res.rr.com) |
| 2020-10-19 19:36:22 | × | nineonine quits (~nineonine@216.81.48.202) (Remote host closed the connection) |
| 2020-10-19 19:36:44 | <crestfallen> | very sorry, I don't know how to set @[] so the inference is known by ghci if pure is used |
| 2020-10-19 19:37:30 | <hyperisco> | :t pure @[] -- what does ghci tell you when you do this? |
| 2020-10-19 19:37:31 | <lambdabot> | error: |
| 2020-10-19 19:37:32 | <lambdabot> | Pattern syntax in expression context: pure@[] |
| 2020-10-19 19:37:32 | <lambdabot> | Did you mean to enable TypeApplications? |
| 2020-10-19 19:37:46 | <hyperisco> | if it says that then you need to :set -XTypeApplications |
| 2020-10-19 19:38:38 | <crestfallen> | that I get: it's a -> [a], which is a -> f a |
| 2020-10-19 19:39:06 | <hyperisco> | those are not the same type |
| 2020-10-19 19:39:06 | <koz_> | Do Vectors have something like itraverse? |
| 2020-10-19 19:39:09 | × | Iwawa quits (~mdomin45@cpe-24-211-129-187.nc.res.rr.com) (Ping timeout: 258 seconds) |
| 2020-10-19 19:39:24 | <koz_> | Like, something of type (Applicative f) => (Int -> a -> f b) -> Vector a -> f (Vector b) |
| 2020-10-19 19:39:42 | <crestfallen> | sorry I meant pure :: Applicative f => a -> f a |
| 2020-10-19 19:39:55 | <crestfallen> | the f is [] |
| 2020-10-19 19:40:18 | <hyperisco> | what is the problem? |
| 2020-10-19 19:40:40 | <hyperisco> | are we having a confusion of variable scope |
| 2020-10-19 19:41:06 | <crestfallen> | well I also read where ghci defaults to the f being IO or something |
| 2020-10-19 19:41:09 | <hyperisco> | every use of pure has its own f |
| 2020-10-19 19:41:21 | → | p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) |
| 2020-10-19 19:41:34 | <hyperisco> | in Haskell source you're used to seeing type variables not explicitly bound |
| 2020-10-19 19:41:40 | <hyperisco> | pure :: Applicative f => a -> f a |
| 2020-10-19 19:41:49 | <hyperisco> | what this means though is pure :: forall f a. Applicative f => a -> f a |
| 2020-10-19 19:42:02 | <hyperisco> | every use of pure has its own f and a variables, they are bound by it |
| 2020-10-19 19:42:19 | <solonarv> | koz_: if nothing else, lens has a typeclass for that indexed traversal and Vector is certainly an instance of it |
| 2020-10-19 19:42:31 | <hyperisco> | :t (pure @[], pure @Maybe) -- for example |
| 2020-10-19 19:42:32 | <lambdabot> | error: |
| 2020-10-19 19:42:32 | <lambdabot> | Pattern syntax in expression context: pure@[] |
| 2020-10-19 19:42:32 | <lambdabot> | Did you mean to enable TypeApplications? |
| 2020-10-19 19:42:44 | × | kuribas quits (~user@ptr-25vy0i8tnjeny9qrt7n.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3)) |
| 2020-10-19 19:42:55 | <crestfallen> | very sorry hyperisco but what about where we have the ((*),(+)). that is also part of what is being ascribed? |
| 2020-10-19 19:43:06 | <solonarv> | koz_: oh! there is Data.Vector.imapM if you're okay with a Monad constraint rather than Applicativ |
| 2020-10-19 19:43:16 | <hyperisco> | I don't know the discussion about that |
| 2020-10-19 19:43:18 | → | nineonine joins (~nineonine@216-19-190-182.dyn.novuscom.net) |
| 2020-10-19 19:43:31 | × | nineonine quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Read error: Connection reset by peer) |
| 2020-10-19 19:43:43 | → | nineonine joins (~nineonine@216-19-190-182.dyn.novuscom.net) |
| 2020-10-19 19:44:04 | <crestfallen> | hyperisco: it's here, thanks http://ix.io/2BhD |
| 2020-10-19 19:44:15 | <koz_> | solo |
| 2020-10-19 19:44:21 | <koz_> | solonarv: That's fine. |
| 2020-10-19 19:44:22 | <hyperisco> | saying pure @[] is like saying subtract 3 … you wouldn't expect that because you use subtract 3 once that everywhere then on that the first argument to subtract is set to 3 |
| 2020-10-19 19:44:46 | <hyperisco> | so is the same for pure @[] it isn't the case that f is set to [] then on for every use of pure, it only applies to the one use of pure |
| 2020-10-19 19:46:36 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2020-10-19 19:47:04 | × | nineonine quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Remote host closed the connection) |
All times are in UTC.