Typeclass Inferencing Rules
Notes on Wadler's paper "How to make ad-hoc polymorphism less ad-hoc"
Summary
Links
Log output
16:37:17.332 14:37:13.161 [New I/O worker #7] WARN customer-stream: [customer-uuid-job] Customer stream ended, closing channel 16:37:17.332 14:37:13.161 [async-dispatch-1] ERROR cache: [customer-uuid-job] Stop setting keys 16:37:22.428 14:37:18.162 [async-dispatch-2] INFO jobs: [customer-uuid-job] Started customer-uuid maintenance job
Equality
class Eq a where (==) :: a -> a -> Bool instance Eq Int where (==) = eqInt instance Eq Char where (==) = eqChar member :: Eq a => [a] -> a -> Bool member [] = False member (x:xs) y = (x == y) \/ member xs y
Math
Small example:
\begin{equation} \forall a . a \to a \end{equation}Large example:
\begin{align*} \text{Eq} \,=\, &\{\, \text{Bool, Char, Int, Integer, Float, Double} \,\}\, \cup \\ &\{\, [\tau ] \mid \tau \in \text{Eq} \,\}\, \cup \\ &\{\, (\tau_1, \tau_2) \mid \tau_1,\tau_2 \in \text{Eq} \,\}\, \cup \\ &\{\, (\tau_1, \tau_2, \tau_3) \mid \tau_1,\tau_2,\tau_3 \in \text{Eq} \,\}\, \cup \\ &\{\, (\tau_1, \tau_2, \tau_3, \tau_4) \mid \tau_1,\tau_2,\tau_3,\tau_4 \in \text{Eq} \,\}\, \cup \\ &\dots \end{align*}