This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pygments import highlight | |
| from pygments.formatters import TerminalFormatter | |
| from pygments.lexers import PostgresLexer, PostgresExplainLexer | |
| from sqlparse import format | |
| def pretty_print_query(queryset): | |
| print(f"{queryset.count()} rows in queryset") | |
| print( | |
| highlight( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env stack | |
| -- stack --resolver lts-15.10 script --package lens | |
| {-# LANGUAGE RankNTypes #-} | |
| import Control.Lens | |
| main :: IO () | |
| main = do | |
| let greetingLeft = Left "hello world" | |
| numberRight = Right 42 | |
| justSomething = Just "something" |