| Copyright | © Frank Jung 2021-2023 |
|---|---|
| License | GPL-3.0-only |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Cards
Description
From Tweag YouTube channel Introduction to Pattern Synonyms where Richard introduces GHC's feature of Pattern Synonyms, allowing programmers to abstract over a pattern.
Types
Enumerated Cards including Honor cards.
Bundled Patterns
| pattern CJack :: Card | Pattern synonyms can be "bundled" into exported |
| pattern CQueen :: Card | |
| pattern CKing :: Card | |
| pattern CAce :: Card |
Instances
| Show Card Source # | Show instance for |
| Eq Card Source # | |
| Ord Card Source # | |
Functions
checkEven :: Int -> Bool Source #
Check if a integer value is or odd.
>>>checkEven 42True>>>checkEven 11False
numCardsToPlay :: Honor -> Natural Source #
Have provided all patterns (see COMPLETE above).