Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 834 835 836 837 838 839 840 841 842 843 844 .. 18025
1,802,452 events total
2021-07-07 08:37:53 <Hecate> and their callers have to provide facilities for those "constraints" to be validated
2021-07-07 08:37:57 <merijn> Hecate: Where can I get that function? >.>
2021-07-07 08:38:09 <Hecate> merijn: work for Lockheed-Martin
2021-07-07 08:38:13 <Hecate> (plz don't)
2021-07-07 08:38:24 michalz joins (~michalz@185.246.204.126)
2021-07-07 08:39:01 <merijn> Hecate: Could be SpaceX too :p
2021-07-07 08:39:06 <sshine> Hecate, but modern, granular effect systems break this illusion because the programmer gets to specify what's a first-class effect and what isn't, right?
2021-07-07 08:40:25 <Hecate> hmm
2021-07-07 08:40:34 <Hecate> I don't feel that way when using an effect system
2021-07-07 08:40:51 <Hecate> sshine: do you know MTL and typeclasses?
2021-07-07 08:40:55 <sshine> yes
2021-07-07 08:41:12 <ahdyt> and know how to use it to solve problems?
2021-07-07 08:41:13 Lycurgus joins (~juan@cpe-45-46-140-49.buffalo.res.rr.com)
2021-07-07 08:41:21 <sshine> but I haven't used an effect system in Haskell, only used mtl and toyed around with effect systems in Scala briefly.
2021-07-07 08:41:27 <merijn> Let's all repeat our mantra: mtl is not an effect system, unless you like torturing yourself >.>
2021-07-07 08:41:39 <ahdyt> ah haha
2021-07-07 08:41:44 <Hecate> okay so, when we use MTL at work, it's usually not "MonadFileSystem" or "MonadDB", but higher-level significations for business logic
2021-07-07 08:41:47 <Hecate> like "MonadStorage"
2021-07-07 08:41:59 <ahdyt> ah, okay.
2021-07-07 08:42:04 <merijn> Hecate: That's not even using mtl, though?
2021-07-07 08:42:06 <Hecate> "MonadTracing" instead of "MonadNetwork" + "MonadMetrics"
2021-07-07 08:42:39 <Hecate> merijn: (MonadStorage m, MonadTracing m) => arg1 -> m returnType
2021-07-07 08:42:42 <ahdyt> is that storage used for building distributed file system?
2021-07-07 08:43:05 <merijn> Hecate: That's just using tagless final, no?
2021-07-07 08:43:22 <Hecate> ahdyt: it only matters if your business logic deals with the intrisics of distributed file systems :P
2021-07-07 08:43:24 <merijn> Which is also what mtl uses, but to pointless effect >.>
2021-07-07 08:43:29 <Hecate> merijn: no?
2021-07-07 08:43:42 <Hecate> I mean, when you say tagless final I think of Oleg's paper
2021-07-07 08:43:56 <Hecate> and from what I recall of it, no it's not "just using tagless final"
2021-07-07 08:44:32 <merijn> Hecate: I mean, MonadStorage/MonadTracing in no way use mtl (except, maybe, as incidental implementation detail)
2021-07-07 08:45:00 <Hecate> merijn: uuuh yes?
2021-07-07 08:45:01 <sshine> Hecate, so defining that hierarchy of Monad* classes is sort of extending the semantics of your effects. I suppose there's an entire design space I haven't yet explored. I understand how picking one class of effects makes for one set of abstractions instead of another.
2021-07-07 08:45:23 <Hecate> merijn: they are typeclass constraints that we use in mtl style
2021-07-07 08:45:39 <merijn> Hecate: https://serokell.io/blog/tagless-final seems to support my understanding that mtl is just tagless final encoding too
2021-07-07 08:45:52 <merijn> Hecate: The "mtl style" *is* tagless final encoding :p
2021-07-07 08:46:12 <sshine> is "mtl-style" and "has-style" the same except for wording? or does "has-style" also say something about a specific taxonomy of effects?
2021-07-07 08:46:18 <merijn> I like tagless final encoding, I just dislike mtl :p
2021-07-07 08:46:23 <Hecate> sshine: the nice stuff is that you need MonadIO for a buch of those operation, but if you don't put it explicitly in your type signature, you can't really use liftIO
2021-07-07 08:46:32 yauhsien joins (~yauhsien@61-231-39-135.dynamic-ip.hinet.net)
2021-07-07 08:46:56 <Hecate> sshine: has-style is just sugar
2021-07-07 08:47:06 <Hecate> don't worry too much about this, it's just a typeclass
2021-07-07 08:47:19 <sshine> Hecate, ah, so the full implementation of a MonadFoo might really need MonadIO, but as the library user, you neither need to know nor get to abuse this fact?
2021-07-07 08:48:21 <Hecate> sshine: if you have (MonadStorage m) in your constraints (which obviously requires doing some IO access, whether on the network of FS), you get to access the methods provided by this typeclass
2021-07-07 08:48:30 <Hecate> an opaque "store" and an opaque "get", for example
2021-07-07 08:48:37 <merijn> sshine: The advantage is that you can entirely rewrite your Foo/Storage implementation without 90% of your code needing to be refactored
2021-07-07 08:48:54 <Hecate> now, if in your function you want to do `liftIO getCurrentTime", GHC will complain to you that you need MonadIO in your constraints
2021-07-07 08:49:21 <merijn> sshine: If all code *using* Storage only knows about a tiny number of primitives implemented in the typeclass, then any code *using* Storage is only affected if that interface changes, but not when any of its internals change
2021-07-07 08:49:21 <Hecate> merijn: can I ask your opinion on https://github.com/arybczak/effectful ?
2021-07-07 08:49:37 <Hecate> merijn: I wrote a time handler for it https://github.com/Kleidukos/effectful-time/
2021-07-07 08:50:08 <merijn> Hecate: My opinion is: I am a busy, busy man, who can't be arsed to look at 10 million effects systems that seem to have dubious/marginal improvements for the code I write :p
2021-07-07 08:50:58 × yauhsien quits (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-07-07 08:51:08 ubert joins (~Thunderbi@2a02:8109:9880:303c:ca5b:76ff:fe29:f233)
2021-07-07 08:51:11 <Hecate> merijn: very well :P
2021-07-07 08:51:44 <merijn> Most I've seen of all these effects libraries is pointless navelgazing with little to no ecosystem support :p
2021-07-07 08:52:09 <merijn> Maybe if the language was designed from the ground up to accommodate it I'd be more interested
2021-07-07 08:52:18 × mnrmnaugh quits (~mnrmnaugh@pool-96-252-87-182.bstnma.fios.verizon.net) (Ping timeout: 252 seconds)
2021-07-07 08:52:27 <zincy__> I haven't bothered to learn a single effects library yet apart from monad transformers hehe
2021-07-07 08:52:40 <merijn> But right now it's just "some wrappers around base and you gotta hope they keep up"
2021-07-07 08:52:52 <Hecate> zincy__: don't bother yet
2021-07-07 08:52:54 <merijn> zincy__: I would argue transformers aren't really effects systems at all
2021-07-07 08:53:12 <Hecate> effect systems like effectful are most useful in big applications where MTL style shows its limits
2021-07-07 08:53:20 <zincy__> Is that because of the fact monad transformers are static?
2021-07-07 08:53:21 <merijn> Hecate: You know what would get my interest? An effect system designed around/playing nice with something like OpenBSD's pledge()
2021-07-07 08:53:27 × ikex quits (~ash@user/ikex) (Quit: ZNC - https://znc.in)
2021-07-07 08:53:35 <Hecate> merijn: never heard about this syscall
2021-07-07 08:53:36 <merijn> Also, I wish every other OS would port pledge >.<
2021-07-07 08:53:40 ikex joins (ash@user/ikex)
2021-07-07 08:53:41 <zincy__> merijn: Would you say using something like free monads would be an effects system?
2021-07-07 08:53:46 <merijn> Hecate: pledge is amazing
2021-07-07 08:53:59 <Hecate> merijn: ok let me read about it
2021-07-07 08:54:01 × ahdyt quits (~ahdyt@103.105.35.88) (Ping timeout: 246 seconds)
2021-07-07 08:54:27 <merijn> Hecate: It's basically granular privilege drop
2021-07-07 08:54:28 × dunkeln quits (~dunkeln@188.70.10.207) (Ping timeout: 258 seconds)
2021-07-07 08:54:50 <Hecate> merijn: I can see this, it's most interesting
2021-07-07 08:55:28 <merijn> But they spend a lot of effort to make it easy to integrate in existing codebases. As opposed to all these capability networks that basically require full rewrites of your code
2021-07-07 08:56:24 <merijn> If you could design and match your effect system to that and have the language auto-pledge away everything your types say you won't use. *That* would be cool
2021-07-07 08:58:28 <tomsmeding> then would be a really cool use of the type system guarantees
2021-07-07 09:03:14 <fendor> can I make an uninhabitable type synonym?
2021-07-07 09:03:30 <sshine> type LikeThis = Void ?
2021-07-07 09:04:34 ptr_frac7al joins (~longlong@user/ptr-frac7al/x-0038398)
2021-07-07 09:05:14 × Lycurgus quits (~juan@cpe-45-46-140-49.buffalo.res.rr.com) (Quit: Exeunt)
2021-07-07 09:05:19 <fendor> I want `pattern T n <- <Impossible pattern>`
2021-07-07 09:05:40 <sshine> oh, you mean pattern synonym
2021-07-07 09:06:36 <tomsmeding> (1 -> 2) with ViewPatterns?
2021-07-07 09:07:34 <fendor> yeah, pattern synonym
2021-07-07 09:07:44 <fendor> that wont typecheck, right?
2021-07-07 09:08:30 <tomsmeding> hm yeah, maybe (const True -> False) -- switching to booleans to not have to default to some integral type
2021-07-07 09:09:51 <fendor> huh... yeah, seems like a good idea
2021-07-07 09:09:54 × ptr_frac7al quits (~longlong@user/ptr-frac7al/x-0038398) (Ping timeout: 268 seconds)
2021-07-07 09:09:57 <haskl> What are people's thoughts on Options.Applicative?
2021-07-07 09:10:04 <tomsmeding> fendor: pattern T x <- ((\x -> (True, x)) -> (False, x))
2021-07-07 09:10:11 <tomsmeding> seems to type check?
2021-07-07 09:12:52 tomsmeding wonders about why one would need such a pattern synonym
2021-07-07 09:14:13 <sshine> haskl, do you mean thoughts on the optparse-applicative library, or its submodule in particular?
2021-07-07 09:14:51 <fendor> since I had to change the type, pattern T y <- ((\x -> (True, undefined) -> (False, y)) typechecks
2021-07-07 09:14:56 <haskl> sshine, sorry, yes, optparse-applicative library
2021-07-07 09:15:07 __monty__ joins (~toonn@user/toonn)
2021-07-07 09:15:08 <sshine> haskl, sorry for not making that assumption :P it's an awesome library.
2021-07-07 09:15:14 <fendor> tomsmeding, ghc Avail constructor changed from Name to a union of Name and FieldLabel
2021-07-07 09:15:23 <sshine> haskl, did you see optparse-generic, though? (you can't always use this, but when you can, it saves time.)

All times are in UTC.