Filter
Exclude
Time range
-
Near
Après avoir montré un Validator en FP dans une première vidéo, je passe à la seconde qui montre la refacto d'un code legacy vers du FP en simulant un Pattern Guards : youtu.be/DFQHYY9_mfs J'espère que ca vous plaira :) @java #FP #refacto #legacy #PatternGuards #lambda
2
1
5
242
11 Jul 2022
PatternGuards and ViewPatterns are pretty neat. If you are only using them for one pattern probably just use a case statement.
2
4
Replying to @henelidotdev
It is || just written with funny alignment. Unfortunately, combining this trick with PatternGuards is not enough to have Or-Patterns 😞 There was a nice proposal by @_osa1 to introduce this feature to GHC. It's a pity community didn't help with it. github.com/ghc-proposals/ghc…
2
Replying to @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 @a , Just HRefl <- eqTypeRep (TypeRep @[]) f = []
1
2
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 github.com/groupbees/bees-de…

1
5
5
In Haskell, with the former I can also introduce #PatternGuards for let bindings, guards or bring local constraints into scope
1
2
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 ....
4
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
4
4
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:
1
1
14 Dec 2017
PatternGuards and TupleSections should be enabled by default
2
3
24 Sep 2017
90% of PLT noobs recommend using PatternGuards to make writing typing judgments easier. Order yours today!
2
1
19
30 Jul 2017
Replying to @ttk_vim
{-#LANGUAGE PatternGuards#-} case ch of 'a', 'b' -> ... でいけるはず
2
1
1
Replying to @Lugendre
PatternGuardsですね。ただし、Haskell 2010で正式な機能になったので、現在では拡張なしでも使えます。これは、内包表記との統一感といい、なかなか美しくて良い記法です。僕の本も、もうすこし薄くできれば、これも説明したかったくらいです。たしか、SPJが提案したかと
1
1
PatternGuardsを初めて使った。GHCの言語拡張についてはOverloadedStringsぐらいしか知らなかった。急いでいたとはいえ、あまりにも荒っぽいコードだ。 abc049.contest.atcoder.jp/su…

1
25 Feb 2012
非ライブラリなプログラムで知っておいて損はないGHC拡張一覧 → ParallelListComp PatternGuards DoRec Arrows OverloadedStrings
1