2026/06/17

Newest at the top

2026-06-17 15:22:12 +0000lossless(~haze@user/ryou) ryou
2026-06-17 15:21:10 +0000jgee242(~jayanth@static-98-115-128-109.phlapa.fios.verizon.net) (Ping timeout: 276 seconds)
2026-06-17 15:15:02 +0000puke(~puke@user/puke) puke
2026-06-17 15:10:06 +0000ft(~ft@p4fc2ab3f.dip0.t-ipconnect.de) ft
2026-06-17 15:07:49 +0000machinedgod(~machinedg@d172-219-48-230.abhsia.telus.net) machinedgod
2026-06-17 14:59:47 +0000 <vms14> for now i have to get familiar with the state monad and others, so it's fine
2026-06-17 14:58:44 +0000 <vms14> i still think that i should find a way to provide an illusion where there is no stack and is all function composition behind the scenes, but i have no idea how i would do that, especially for stuff like dup, drop, etc
2026-06-17 14:57:27 +0000 <davean> If you REALLY want to abstract it
2026-06-17 14:57:21 +0000 <vms14> i need a stack that can hold multiple types and a dictionary to store words as functions and then is just read words and evaluate them
2026-06-17 14:57:13 +0000 <davean> class Stackable a where stackize :: a -> StackType
2026-06-17 14:56:38 +0000 <vms14> https://gitlab.com/ohmycat/oh/-/blob/main/oh.hs
2026-06-17 14:56:36 +0000 <vms14> that's what i made yesterday, without not really knowing too much what i was doing
2026-06-17 14:55:58 +0000 <vms14> i didn't really try that approach, i've only tried to learn how to use the state monad with a list of integers
2026-06-17 14:55:19 +0000 <davean> or whatever
2026-06-17 14:55:17 +0000 <davean> push :: Stackable a => a -> StackThing ()
2026-06-17 14:55:03 +0000 <vms14> Leary example seems to be exactly what i wanted, so i'll try to understand that and see how it works
2026-06-17 14:54:57 +0000 <davean> and what does your push function look like ...
2026-06-17 14:54:30 +0000 <vms14> davean: i felt like there should be a way so i can just push an integer or a string without having to wrap them, so any other function will work with normal types, i would have made some sort of unpwrap function that extracts the value from the wrapper, but that felt like doing more work because you do not konw enough
2026-06-17 14:52:27 +0000 <davean> I mean it might be a bit intimidating to consider if you can just coerce to wrap/unwrap, but its well determined if you can.
2026-06-17 14:51:25 +0000 <vms14> merijn: any error in haskell is confusing to me until i get familiar with it
2026-06-17 14:49:48 +0000 <davean> They might but I have no idea what they're scared of there.
2026-06-17 14:48:33 +0000 <merijn> But in practice I've rarely found that to come up
2026-06-17 14:48:08 +0000 <merijn> vms14: tbh, you probably *do* have to do something like that in most cases
2026-06-17 14:47:51 +0000s00pcan(~s00pcan@71.214.104.207) s00pcan
2026-06-17 14:47:34 +0000 <merijn> vms14: Do you have some examples of type errors that you find confusing?
2026-06-17 14:46:41 +0000 <davean> Even if you did, I don't see the worry about wrapping and unwrapping. I'm going to stop here though. I don't think I have the time to understand
2026-06-17 14:42:32 +0000 <vms14> davean: i thought i had to do something like data StackElement = SInt Int | SChar Char ... xd
2026-06-17 14:41:42 +0000 <merijn> vms14: Those are good ways to get even more confusing type errors
2026-06-17 14:41:29 +0000 <merijn> vms14: tbf, that's probably accurate for stuff like GADTs/ExistentialQuantification
2026-06-17 14:41:21 +0000 <vms14> i feel like it argues with me and i don't understand the type errors
2026-06-17 14:41:07 +0000s00pcan(~s00pcan@71.214.104.207) (Ping timeout: 265 seconds)
2026-06-17 14:41:03 +0000 <vms14> If you're a beginner Haskell programmer who feels like GHC argues with you too often, who often finds type errors inscrutable, then this book is probably not for you. Not yet
2026-06-17 14:40:54 +0000 <vms14> btw i get why i didn't keep reading the book, the book itself told em to fuck off
2026-06-17 14:40:35 +0000 <vms14> davean: because i did not know of any other options
2026-06-17 14:37:41 +0000 <davean> vms14: why did you think you'd need template haskell and boilerplate wrapping and unwrapping?
2026-06-17 14:37:37 +0000 <vms14> also the book is relatively short, 200 pages
2026-06-17 14:36:51 +0000 <vms14> jaror: there is a section in that book about gadts and right after it heterogeneous lists in page 55
2026-06-17 14:31:35 +0000 <vms14> i thought i would have to rely on template haskell to generate boilerplate code for wrapping and unwrapping
2026-06-17 14:31:23 +0000 <lambdabot> IO ()
2026-06-17 14:31:22 +0000 <mauke> :t interact $ unlines . words
2026-06-17 14:28:26 +0000 <merijn> vms14: They're neat tricks that (when used with some restraint) can help a lot, but easier to wrap your head around when simpler stuff is more natural
2026-06-17 14:25:58 +0000 <vms14> thing*
2026-06-17 14:25:49 +0000 <vms14> the only think i can do is a hello world xde
2026-06-17 14:25:17 +0000 <vms14> i was considering that book because i thought mastering the type system of haskell would be good, but i am also impatient to start doing things with haskell
2026-06-17 14:23:27 +0000 <jaror> https://thinkingwithtypes.com/
2026-06-17 14:23:25 +0000 <jaror> I haven't read it but maybe Sandy Maguire's "thinking with types" covers this?
2026-06-17 14:22:31 +0000 <jaror> To be able to use lists at the type level
2026-06-17 14:22:09 +0000 <jaror> You also need DataKinds
2026-06-17 14:21:57 +0000 <vms14> ty
2026-06-17 14:21:44 +0000jgee242(~jayanth@static-98-115-128-109.phlapa.fios.verizon.net)