Now that I have tests settled for this particular module, I thought I'd go see what function in the stdlib might exist that is equivalent to my `orElse`. So, I punched its type signature into hoogle: Maybe a -> Maybe a -> Maybe a
-
Show this thread
-
Hoogle, an index of the ~standard libraries (and which you can run locally using an index of the libs used in *your* project
), popped back a set of results, the second of which is exactly equivalent to my `orElse`:
<|>, defined in Control.Applicative: http://hackage.haskell.org/package/base-4.12.0.0/docs/Control-Applicative.html#v:-60--124--62- …4 replies 1 retweet 18 likesShow this thread -
This kind of thing cannot be done without things that are super-important in the haskell world, e.g.: * sufficient static analysis discipline, obviously aided greatly by surfacing the type system * adequate community enthusiasm for tools to augment/replace flawed human faculties
2 replies 4 retweets 24 likesShow this thread -
Fun addendum that illustrates now noob I still am: I've actually used <|> a bunch because of parsec, but until now erroneously thought it was parsec-specific (thanks to the similarity to BNF's pipe). it's super-obvious now that <|> is big-F Fundamental
5 replies 0 retweets 11 likesShow this thread -
Replying to @cemerick
Used it with Maybe yet? Here's a puzzle: used it with Either? Why not?
1 reply 0 retweets 0 likes -
Replying to @dibblego
Well, the whole story was about my discovering <|> as a replacement for my own Maybe-only impl I haven't used it with Either, but surely will after last night
1 reply 0 retweets 1 like -
Replying to @cemerick
There is no Alternative for Either because there is no empty. Have a look at Data.Functor.Alt.
1 reply 0 retweets 0 likes -
-
He's being sincere. It is a good exercise to learn about Alt and ponder why Either has Alt but not Alternative. Here's the link for Alt http://hackage.haskell.org/package/semigroupoids-5.3.1/docs/Data-Functor-Alt.html …
1 reply 0 retweets 1 like -
Replying to @GeorgeTalksCode @dibblego
Ok, thanks for the link. I guess I'm not generally receptive to socratic methods in this context
1 reply 0 retweets 0 likes
I have no idea what is happening.
-
-
Replying to @dibblego @GeorgeTalksCode
I didn't realize you were actually posing a puzzle in your first response once I did (upon your 2nd reply), I felt like I walked into a "gotcha" moment, thus the emoji and gif unlike some (most?) other math/eng folk, I actually don't like things cast as puzzles/riddles
2 replies 0 retweets 1 like -
q: "what is happening?" a: "you're online"
0 replies 2 retweets 3 likes
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
