Top Tweets for #PatternGuards
@maksbotan @_gilmi I am team #PatternGuards for this reason, minimal indentation, branching, let declaration, pattern matching that can introduce local constraints
foo :: forall a. Typeable a => a
foo
| App f _ <- TypeRep @anianimates
, Just HRefl <- eqTypeRep (TypeRep @[]) f
= []
I wrote a code on Github with legacy code designs, revisited with FP in @java 14 :
(@GroupBees1 demo)
#validator
#decorator
#patternGuards
#factory
For all the classes, i show the legacy code and the refacto with FP.
#java14 #record #FP
https://t.co/CepJvXWbAP
@josecalderon @tomaspetricek In Haskell, with the former I can also introduce #PatternGuards for let bindings, guards or bring local constraints into scope
I work on my first project with @scala_lang and i admit that is a great programming language
#FP #Monad #Option #Try #Either #Tuple #PatternMatching #PatternGuards #CaseClasses ....
when I'm writing
map (\a -> ..)
& need guards (also useful for bringing constraints into local scope!) I don't think to write
map (\case a | .. -> ..)
because I'm not case-ing on 'a', I just hijack its #PatternGuards. Would I actually prefer
map (\a | .. -> ..)
who knows

@emi1ypi @whyevernotso It's the #PatternGuards syntax
foo a
| a < 0
= ..
| otherwise
= ..
which allows let bindings ('| let' is incidentally a drop in replacement for '| otherwise'), all of these let binding are accepts:

Trends for you
Most Popular Users

Elon Musk 
@elonmusk
239.3M followers

Barack Obama 
@barackobama
118.5M followers

Cristiano Ronaldo 
@cristiano
114.3M followers

Donald J. Trump 
@realdonaldtrump
111.7M followers

Narendra Modi 
@narendramodi
106.9M followers

Rihanna 
@rihanna
98.6M followers

NASA 
@nasa
92M followers

Justin Bieber 
@justinbieber
91.7M followers

KATY PERRY 
@katyperry
89.9M followers

Taylor Swift 
@taylorswift13
83.9M followers

Lady Gaga 
@ladygaga
75.4M followers

Virat Kohli 
@imvkohli
73.2M followers

Kim Kardashian 
@kimkardashian
70.8M followers

YouTube 
@youtube
68.6M followers

Neymar Jr 
@neymarjr
66.3M followers

Bill Gates 
@billgates
65.1M followers

Selena Gomez 
@selenagomez
63M followers

The Ellen Show
@theellenshow
62.1M followers

CNN 
@cnn
61.6M followers

X 
@x
60.6M followers




