Newest at the top
| 2026-03-11 08:42:46 +0100 | <dminuoso> | The biggest pedagogic mistake of Haskell. |
| 2026-03-11 08:42:01 +0100 | <dminuoso> | mesaoptimizer: I mean most individual instances of Applicative/Monad are trivial enough to figure out in a minute or two as long as you have more than a week of programming experience - and that knowledge is likely enough to become competent in Haskell.. |
| 2026-03-11 08:40:26 +0100 | ski | . o O ( "How to Replace Failure by a List of Successes: A method for exception handling, backtracking, and pattern matching in lazy functional languages" by Philip Wadler in 1985 at <http://www.rkrishnan.org/files/wadler-1985.pdf> ) |
| 2026-03-11 08:40:09 +0100 | <humasect> | yea; it clicks when it clicks |
| 2026-03-11 08:39:25 +0100 | <dminuoso> | I'd be willing to bet you can learn Haskell just fine without understanding what Applicative or Monad "are" |
| 2026-03-11 08:38:59 +0100 | <dminuoso> | irrelevant for learning haskell. |
| 2026-03-11 08:38:57 +0100 | <dminuoso> | mesaoptimizer: Some of the reasons that Applicative/Monad are difficult to understand are an obscure name and the fact that the pattern they abstract over something that has no "purpose" or "intent", just an observation that there's some things that just follow the same form and laws... I personally think that too much time is lost trying to focus around what they mean because it's almost entirely |
| 2026-03-11 08:38:13 +0100 | arandombit | (~arandombi@user/arandombit) (Ping timeout: 244 seconds) |
| 2026-03-11 08:36:12 +0100 | <mesaoptimizer> | dminuoso: I see, that's useful to know |
| 2026-03-11 08:36:03 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds) |
| 2026-03-11 08:35:57 +0100 | <dminuoso> | Forget what I said, then. |
| 2026-03-11 08:35:56 +0100 | <mesaoptimizer> | Functors are easy to wrap one's head around via just the type signature. Applicatives and Monad type signatures seem a bit harder to understand just by looking at it though |
| 2026-03-11 08:35:51 +0100 | <dminuoso> | mesaoptimizer: But you're on a right track as far as coerce goes. If you're using it with TypeApplications it's as good as manual unpacking/repacking - albeit more unusual |
| 2026-03-11 08:35:21 +0100 | <[exa]> | nothing explains that you don't want to use X better than using X |
| 2026-03-11 08:35:03 +0100 | <[exa]> | +1 for coercefield experience |
| 2026-03-11 08:34:38 +0100 | <humasect> | eh well. learn on the battlefield |
| 2026-03-11 08:34:17 +0100 | <dminuoso> | This is how you know you're in #haskell |
| 2026-03-11 08:34:10 +0100 | <dminuoso> | Beginner trying to grasp Functor and Maybe already dabbling with TypeApplication :-) |
| 2026-03-11 08:33:31 +0100 | <mesaoptimizer> | `coerce` without enabling the `TypeApplication` extension seems almost unusable at least in my experience |
| 2026-03-11 08:33:06 +0100 | <mesaoptimizer> | I see. I was using type applications with it |
| 2026-03-11 08:32:15 +0100 | <dminuoso> | Explicit unpacking/repacking is just better most of the time. |
| 2026-03-11 08:31:56 +0100 | <dminuoso> | Oh it's not dangerous, but I'd be willing to say that almost any use of `coerce` in your first year is probably a smell |
| 2026-03-11 08:31:27 +0100 | <dminuoso> | mesaoptimizer: It's not really about "understanding" coercions, just that they dont fit into *any* idiomatic code for when you bootstrap yourself into the language. |
| 2026-03-11 08:31:23 +0100 | <mesaoptimizer> | dminuoso: hmm, perhaps you have a better idea than I do of how footgunny `Data.Coerce` is. I do know that I can't use it if I enable `Safe` language pragma |
| 2026-03-11 08:31:11 +0100 | merijn | (~merijn@host-cl.cgnat-g.v4.dfn.nl) merijn |
| 2026-03-11 08:30:25 +0100 | <[exa]> | :) |
| 2026-03-11 08:30:19 +0100 | <gentauro> | [exa]: got it |
| 2026-03-11 08:30:02 +0100 | <dminuoso> | mesaoptimizer: I'm not sure how that module could help you on your path *shrugs* |
| 2026-03-11 08:30:02 +0100 | <[exa]> | well add the SBS and there you go |
| 2026-03-11 08:29:31 +0100 | <gentauro> | [exa]: yeah, my code import is -> `import qualified Data.ByteString.Lazy as LBS`. Kind of dump to import the `lazy` version if I want to do strict stuff |
| 2026-03-11 08:29:24 +0100 | <mesaoptimizer> | I did a PLT semantics course, its all right |
| 2026-03-11 08:28:58 +0100 | <dminuoso> | If you're starting out Data.Coerce is most likely something you not should be wielding |
| 2026-03-11 08:28:32 +0100 | chele | (~chele@user/chele) chele |
| 2026-03-11 08:28:27 +0100 | <mesaoptimizer> | my current favorite resource has been https://leanpub.com/finding-success-in-haskell by Julie Moronuki and Chris Martin. It helped me ease into the use of Either and Maybe and `newtype` and introduced me to `Data.Coerce` |
| 2026-03-11 08:28:19 +0100 | <preflex> | Sorry, I haven't seen bitemyapp |
| 2026-03-11 08:28:19 +0100 | <ski> | preflex: xseen bitemyapp |
| 2026-03-11 08:28:06 +0100 | <gentauro> | [exa]: use case is (files are small enough to be in mem) so yes, they need to be fully in mem |
| 2026-03-11 08:28:01 +0100 | <[exa]> | as in, `fromStrict <$> StrictBS.readFile` |
| 2026-03-11 08:27:23 +0100 | <[exa]> | gentauro: you might want to use the strict reader https://hackage-content.haskell.org/package/bytestring-0.12.2.0/docs/Data-ByteString.html#v:readFile and then thaw the string |
| 2026-03-11 08:26:45 +0100 | humasect | (~humasect@184.151.37.182) humasect |
| 2026-03-11 08:26:39 +0100 | <gentauro> | :-\ |
| 2026-03-11 08:26:37 +0100 | <gentauro> | I guess by forcing the length of the file and then returning the bytes |
| 2026-03-11 08:26:17 +0100 | <gentauro> | [exa]: last time I did this -> `LBS.readFile f >>= \bs -> LBS.length bs `seq` pure bs` :| |
| 2026-03-11 08:26:14 +0100 | <mesaoptimizer> | then again, Chris Allen and Julie Moronuki's https://haskellbook.com mentions record syntax (I did a search in the PDF) and it was published in 2017 |
| 2026-03-11 08:25:36 +0100 | <mesaoptimizer> | I returned to it recently and didn't like it, and especially didn't appreciate the lack of a mention of record syntax anywhere, but perhaps that was after the publication of the 2016 book |
| 2026-03-11 08:24:51 +0100 | <mesaoptimizer> | I read the first part of Graham Hutton's book two years ago btw |
| 2026-03-11 08:24:50 +0100 | <[exa]> | gentauro: btw what's the usecase there? literally just forcing the file in? |
| 2026-03-11 08:24:32 +0100 | <[exa]> | mesaoptimizer: the community LYAH is not bad if you know some coding already https://learnyouahaskell.github.io/ |
| 2026-03-11 08:22:50 +0100 | <gentauro> | [exa]: thx |
| 2026-03-11 08:22:13 +0100 | <lambdabot> | http://www.haskell.org/haskellwiki/Typeclassopedia |