Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 248 249 250 251 252 253 254 255 256 257 258 .. 17985
1,798,411 events total
2021-06-02 21:31:54 <dminuoso> djb2021: That sounds rather confusing, to be honest.
2021-06-02 21:31:55 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-06-02 21:31:55 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-06-02 21:32:46 × exarkun quits (~exarkun@user/exarkun) (Remote host closed the connection)
2021-06-02 21:33:05 × davidnutting quits (~nuttingd@75.164.99.232) (Client Quit)
2021-06-02 21:33:19 exarkun joins (~exarkun@user/exarkun)
2021-06-02 21:33:22 davidnutting joins (~nuttingd@75.164.99.232)
2021-06-02 21:33:56 <dminuoso> Ah now I understand.
2021-06-02 21:34:05 <dminuoso> Yes.
2021-06-02 21:34:23 <dminuoso> You only get file for SwaggerKindParamOtherSchema
2021-06-02 21:35:04 <dminuoso> This fact is supported in various places in swagger2
2021-06-02 21:35:07 × ddellacosta quits (~ddellacos@86.106.121.72) (Remote host closed the connection)
2021-06-02 21:35:22 <dminuoso> More concretely, file is only valid for param
2021-06-02 21:35:36 ddellacosta joins (~ddellacos@86.106.121.72)
2021-06-02 21:36:50 <dminuoso> So yeah, because Schema uses `ParamSchema SwaggerKindSchema`, it cant contain a file it looks like
2021-06-02 21:37:08 <djb2021> Ok, thanks - in other words it is a bug, right?
2021-06-02 21:37:16 <dminuoso> Not sure, it looks intentional
2021-06-02 21:37:24 <lbseale> boxscape: Here's an easy solution, use filterWithKey with a function that checks if the key is within a set date range
2021-06-02 21:37:29 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
2021-06-02 21:37:42 <boxscape> lbseale yep, that works, but seems slower than necessary
2021-06-02 21:37:59 <boxscape> since you have to go through all entries
2021-06-02 21:38:50 <boxscape> lbseale oh, but wait
2021-06-02 21:39:01 <boxscape> lbseale you can use split
2021-06-02 21:39:14 <dminuoso> djb2021: looks forbidden in openapi 2.0
2021-06-02 21:39:30 × myShoggoth quits (~myShoggot@97-120-89-117.ptld.qwest.net) (Ping timeout: 245 seconds)
2021-06-02 21:39:58 <boxscape> lbseale if you split at the lower bound, you get everything smaller and larger as two separate maps, and then use split on the latter to get everything between the two bounds and everything larger than the upper bound
2021-06-02 21:40:13 <dminuoso> Mmm
2021-06-02 21:40:16 <dminuoso> "A definition of the response structure. It can be a primitive, an array or an object. If this field does not exist, it means no content is returned as part of the response. As an extension to the Schema Object, its root type value may also be "file". This SHOULD be accompanied by a relevant produces mime-type."
2021-06-02 21:40:19 <boxscape> lbseale or splitLookup if you need values exactly matching the bound as well
2021-06-02 21:40:30 × ddellacosta quits (~ddellacos@86.106.121.72) (Ping timeout: 264 seconds)
2021-06-02 21:40:53 <lbseale> boxscape: yes! this is exactly what we want
2021-06-02 21:41:05 <dminuoso> djb2021: Ah https://github.com/GetShopTV/swagger2/issues/76
2021-06-02 21:41:17 × tremon quits (~tremon@217-63-61-89.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in)
2021-06-02 21:41:30 <lbseale> get a sub-map with just keys within the given range
2021-06-02 21:42:17 <djb2021> But, please, look here: https://swagger.io/specification/v2/:' An additional primitive data type "file" is used by the Parameter Object and the Response Object to set the parameter type or the response as being a file.' And then, please, read here: https://hackage.haskell.org/package/swagger2-2.6/docs/src/Data.Swagger.Internal.html#Response, There
2021-06-02 21:42:18 <djb2021> the "file" is clearly allowed.
2021-06-02 21:42:42 <djb2021> aah you got it already
2021-06-02 21:44:10 <djb2021> dminuoso: thank you so much, the bug report makes it clear!
2021-06-02 21:44:12 <dminuoso> Yeah sorry it took me a moment to cut through the thick typitis.
2021-06-02 21:44:23 <dminuoso> djb2021: Btw, you mentioned "kinds"
2021-06-02 21:44:36 <djb2021> oh yes, can you explain that to me?
2021-06-02 21:44:45 <dminuoso> So none of this is kind stuff, they are actually types
2021-06-02 21:44:55 <dminuoso> the choice of the word "kind" is just in the english sense
2021-06-02 21:45:35 <dminuoso> The key facility here is an extension called `DataKinds`, which you can use to lift data constructors to types
2021-06-02 21:45:46 <dminuoso> % :set -XDataKinds
2021-06-02 21:45:46 <yahb> dminuoso:
2021-06-02 21:45:52 <dminuoso> % data Color = Red | Green
2021-06-02 21:45:52 <yahb> dminuoso:
2021-06-02 21:45:56 <dminuoso> % :k Red
2021-06-02 21:45:56 <yahb> dminuoso: Color
2021-06-02 21:46:14 <dminuoso> See, how `Red` also exists on the type level? That is, there exists a type called `Red`.
2021-06-02 21:46:37 × fendor quits (~fendor@178.115.57.160.wireless.dyn.drei.com) (Remote host closed the connection)
2021-06-02 21:47:19 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 252 seconds)
2021-06-02 21:47:37 <hpc> % data Light a where Go :: Light Green; Stop :: Light Red
2021-06-02 21:47:37 <yahb> hpc:
2021-06-02 21:47:39 <hpc> :t Go
2021-06-02 21:47:40 <lambdabot> error:
2021-06-02 21:47:40 <lambdabot> • Data constructor not in scope: Go
2021-06-02 21:47:40 <lambdabot> • Perhaps you meant one of these:
2021-06-02 21:47:51 <dminuoso> % :t Go
2021-06-02 21:47:51 <yahb> dminuoso: Light 'Green
2021-06-02 21:48:05 <hpc> whoops, lambdabot habit :D
2021-06-02 21:48:09 <djb2021> ah - i think i start understanding
2021-06-02 21:48:28 <dminuoso> djb2021: (And if you are really curious, kinds are to types, as types are to values)
2021-06-02 21:48:30 <djb2021> so Red and Green (which were constructors) are now types
2021-06-02 21:48:33 <dminuoso> Yup!
2021-06-02 21:48:42 <hpc> % :k Light -- and just for completeness
2021-06-02 21:48:42 <yahb> hpc: Color -> *
2021-06-02 21:48:45 <dminuoso> You can also refer to them as 'Red and 'Green
2021-06-02 21:48:55 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-06-02 21:48:58 <dminuoso> The tick serves to diambiguate, but whenever its unambiguous, the tick is optional
2021-06-02 21:50:18 × AgentM quits (~agentm@pool-162-83-130-212.nycmny.fios.verizon.net) (Quit: Leaving.)
2021-06-02 21:50:24 habib joins (~habib@89.38.69.198)
2021-06-02 21:50:35 × habib quits (~habib@89.38.69.198) (Quit: habib)
2021-06-02 21:50:47 o1lo01ol1o joins (~o1lo01ol1@c-73-10-81-85.hsd1.nj.comcast.net)
2021-06-02 21:50:55 × Baloo__ quits (~Baloo_@h-98-128-172-214.A785.priv.bahnhof.se) (Read error: Connection reset by peer)
2021-06-02 21:50:58 <dminuoso> djb2021: So kinds is an old term for "the types of types", nowadays the type of a type is some other type again.
2021-06-02 21:51:36 <djb2021> ok, i think i got it, the only thing that confuses me still is the signature as above: Color -> *
2021-06-02 21:51:41 <dminuoso> Yeah, so
2021-06-02 21:51:41 <boxscape> (ghc error messages still use "kind" though)
2021-06-02 21:51:48 <dminuoso> djb2021: * is a very special type
2021-06-02 21:52:06 <dminuoso> let's replace it with Type (which is a different name for it)
2021-06-02 21:52:07 <djb2021> how should i read that signature
2021-06-02 21:52:42 <dminuoso> The type of Light (which itself is a type!) is `Color -> Type`
2021-06-02 21:52:46 <hpc> djb2021: Light is a type-level function that takes a Color and produces a type
2021-06-02 21:52:51 <hpc> djb2021: it's like Maybe :: * -> *
2021-06-02 21:52:59 dminuoso votes we should replace * with Type
2021-06-02 21:53:01 <dminuoso> for sanity
2021-06-02 21:53:02 <hpc> or Type -> Type
2021-06-02 21:53:23 <boxscape> % :set -XNoStarIsKind
2021-06-02 21:53:23 <yahb> boxscape: Some flags have not been recognized: -XNoStarIsKind
2021-06-02 21:53:26 × river quits (~river@tilde.team/user/river) (Read error: Connection reset by peer)
2021-06-02 21:53:31 <boxscape> % :set -XNoStarIsType
2021-06-02 21:53:31 <yahb> boxscape:
2021-06-02 21:53:35 <boxscape> % :k Light
2021-06-02 21:53:35 <yahb> boxscape: Color -> Type
2021-06-02 21:53:38 <dminuoso> djb2021: To introduce a relevant term, types can be inhabitable or non-inhabitable
2021-06-02 21:53:54 <dminuoso> djb2021: a type is said to be inhabitable, if values of that type can exist
2021-06-02 21:54:30 <dminuoso> 'Red is uninhabitable (that means there exists no values of type Red, not even undefined!)
2021-06-02 21:54:44 <dminuoso> Similarly Type is uninhabitable

All times are in UTC.