Awake Security will be livestreaming a periodic 1-on-1 teaching session on Twitch. The subject of this session will always be one of our engineers teaching another one of our engineers how to do accomplish a practical task in Haskell while remote attendees watch, comment, and ask questions.
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
| {-# LANGUAGE DeriveAnyClass #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE RecordWildCards #-} | |
| import Data.ByteString (ByteString) | |
| import Data.Default.Class (Default(..)) | |
| import GHC.Generics (Generic) | |
| import Network.Connection (ConnectionParams(..)) | |
| import Options.Generic (ParseRecord) |
These are my rough notes when preparing for a Haskell livestream that I
thought would be worth sharing. Some things are general comments on
contributing to the open source ecosystem whereas other notes are specific
to the stream (e.g. Haskell and the streamly package)
How things look from a maintainer's point of view (for highly active projects):
- Reactive
As projects become more active the maintainer's "inbox" gets pretty large. A
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
| * Importance of category theory | |
| * Answers the question: "What is a *timeless* API?" | |
| * What does "timeless" mean? | |
| * Likely to still be relevant years from now | |
| * Likely to be low maintenance (since unlikely to change) | |
| * Less likely to be subject to controversy or discussion ("obvious") | |
| * Examples: | |
| * Everything Haskell's typeclassopedia (except maybe `Foldable`) | |
| * Categories / Monoids | |
| * `(.)` / `id` |
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
| ⊢ :let List/generate = https://prelude.dhall-lang.org/List/generate | |
| List/generate : ∀(n : Natural) → ∀(a : Type) → ∀(f : Natural → a) → List a | |
| ⊢ List/generate 10 | |
| λ(a : Type) | |
| → λ(f : Natural → a) | |
| → [ f 0, f 1, f 2, f 3, f 4, f 5, f 6, f 7, f 8, f 9 ] |
Programming Language Checklist by Colin McMillen, Jason Reed, and Elly Fong-Jones, 2011-10-10.
You appear to be advocating a new:
- functional
- imperative
- object-oriented
- procedural
- stack-based
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
| let | |
| nixpkgs = builtins.fetchTarball { | |
| url = "https://github.com/NixOS/nixpkgs/archive/f3fc2f3326a23797b2c95297e68ed8e8de2a95e6.tar.gz"; | |
| sha256 = "0wsplccl8bv522zh3y8affacw9pmzsxm18i5hdgz78gxh8m7k933"; | |
| }; | |
| nixos = import "${nixpkgs}/nixos" { | |
| system = "x86_64-linux"; | |
| configuration = { pkgs, ... }: |
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
| module ConcurrentMap where | |
| import Control.Concurrent.STM.TVar (TVar) | |
| import Control.Concurrent.STM (STM) | |
| import Data.Hashable (Hashable) | |
| import Data.HashMap.Strict (HashMap) | |
| import Data.Vector (Vector) | |
| import qualified Control.Concurrent.STM.TVar as TVar | |
| import qualified Data.Hashable as Hashable |
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
| {-# LANGUAGE RankNTypes #-} | |
| import Prelude hiding (Bool(..)) | |
| type Bool = forall a . a -> a -> a | |
| false :: Bool | |
| false = \true_ false_ -> false_ | |
| true :: Bool |
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
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE DeriveAnyClass #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| module Main where | |
| import Data.Csv (FromField, FromNamedRecord) | |
| import Data.Text (Text) | |
| import Data.Map (Map) |