I hereby claim:
- I am frasertweedale on github.
- I am frasertweedale (https://keybase.io/frasertweedale) on keybase.
- I have a public key whose fingerprint is 5848 CE28 186B B469 C295 15E1 4B53 9052 4111 E1E2
To claim this, I am signing this object:
module Experiement where | |
import Data.Kind (Type) | |
import Data.Proxy (Proxy(..)) | |
data VariantA | |
data VariantB | |
data VariantC | |
data Object (a :: Type) = Object |
I hereby claim:
To claim this, I am signing this object:
module Main where | |
import Control.Monad (replicateM) | |
import Data.Char (ord) | |
import Data.Foldable (for_) | |
import Data.List (foldl') | |
import Data.Word (Word) | |
import System.Environment (getArgs) | |
hash :: [Char] -> Word |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
import Control.Applicative (Alternative(..)) | |
import Data.Char (isDigit) |
module SubsetsMatchingCondition where | |
import Data.Maybe (mapMaybe) | |
data Cond a = Unsatisfied a | Satisfied a | |
deriving (Show) | |
-- | Construct *minimal* subsets that satisfy the | |
-- condition upon the monoidal fold. The monoidal | |
-- append must be "monotonic" for sensible results. |
import java.io.ByteArrayOutputStream; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.io.PrintWriter; | |
import java.net.InetAddress; | |
import java.nio.charset.StandardCharsets; | |
import org.mozilla.jss.CryptoManager; | |
import org.mozilla.jss.InitializationValues; | |
import org.mozilla.jss.crypto.X509Certificate; |
import java.util.Hashtable; | |
import javax.security.auth.callback.CallbackHandler; | |
import javax.security.auth.callback.Callback; | |
import netscape.ldap.LDAPConnection; | |
import netscape.ldap.LDAPEntry; | |
import netscape.ldap.LDAPUrl; | |
class Main { |
/* Composable errors via traits | |
A major challenge (among several) in error handling is how to deal with | |
disjoint error types produced by the libraries you use (as well as by | |
your own program) in a consistent and ergonomic way. Rust's `?` operator | |
improves the ergonomics of error handling, but it can only be used with | |
a single error type throughout a single function. Libraries define their | |
own error types and they don't know about each other, nor about the calling | |
program. So if we want to deal with errors from different libraries as | |
a single type (an sum or enum of the different underlying error types), we |
{-# LANGUAGE KindSignatures #-} | |
module Workflow where | |
import Data.Bool (bool) | |
data Workflow a r | |
= Decision a (Workflow a r) (Workflow a r) | |
| Guard a (Workflow a r) |