00:22
gfldex left
00:43
gfldex joined
|
|||
librasteve | did you try github.com/masukomi/Definitely | 04:32 | |
nijmegenzuigt | ye but first you gotta learn about Raku's CMAKE named MI6 🥲 | 04:34 | |
06:38
Tirifto left
08:19
dakkar joined
09:21
Tirifto joined
|
|||
vendethiel | @librasteve > Note: you should not specify Maybe when calling nothing(Type). For example, call nothing(Int) not nothing(Maybe[Int]). The function will take care of making sure it conforms to the Maybe Type for you. | 13:25 | |
Does this mean you can’t have Maybe[Maybe[Int]]? | |||
This does look like an optional library but it doesn’t look like a monad | |||
antononcube | @Arend Are functional parsers (aka parser combinators) Haskell-enough for you? | 13:54 | |
librasteve | @vendethiel - that seems like a fair challenge, off the top of my head I would say that the Definitely module would benefit from a bind operator. Afaik Definitely does allow you to do Maybe[Maybe[Int]] but I would suggest you check that. So the passage from the docs is just there to say that the nothing() sub does this for you. tbh this module was written in the spirit of _our elders & betters told us that | 16:02 | |
we can use return types like —> Int:D to avoid null errors in Raku, however some functional folk want to have explicit Option | Maybe types to be more like Rust and Raku is so cool we just decided to make this in a module`. So there is some way to go to tighten this module up from a concept car to a production model. PS. Rawley Fowlers Monad::Result module might be a bit more thorough | |||
github.com/rawleyfowler/Monad-Result | |||
if there is a set of rakuteers who feel that this is a valuable direction then maybe we can work to harden up a production level module for this use case … possibly something on exhaustive switch would be good too | 16:06 | ||
vendethiel | Nil | a is very different from Maybe[a] though :-). There’s no monadic interface and collapsing so I’d be surprised if it qualified as a Monad | 16:15 | |
antononcube | Why not use forward feed for "binding" (==>). | 16:18 | |
16:35
dakkar left
|
|||
librasteve | one of the advantages of the Monad::Result module is that is defines a binding operator as >>==: | 16:50 | |
I agree that Nil | a is very different from Maybe[a] and that's why I was pleased when Masukomi ran with the idea I had suggested in my blog post rakujourney.wordpress.com/2022/08/...some-none/ | 16:53 | ||
in the absence of a binding operator for Definitely then you have to do chaining manually like in the chainabledivision example here en.wikipedia.org/wiki/Monad(functi...ple:_Maybe so it would definitely be cool to improve Definitely by adding this - or just use the Monad::Result module (my low level of functional purity my be on show here) | 16:59 | ||
21:42
thowe left
21:43
thowe joined
|