- Mini Compose Melbourne 2019
Jobs
Jobs
| {-# LANGUAGE OverloadedStrings #-} | |
| import Control.Applicative | |
| import Data.Char (isAlpha) | |
| import Data.Attoparsec.ByteString.Char8 | |
| data Expr = Mul Expr Expr | Add Expr Expr | Lit Char | Var Char deriving Show | |
| expr = (add <|> mul <|> (Var <$> satisfy isAlpha) <|> (Lit <$> satisfy isDigit)) <* endOfInput |
| module Example where | |
| import Data.Map | |
| import Data.Validation | |
| import Data.List.NonEmpty (NonEmpty((:|))) | |
| -- | Merge maps rejecting duplicate keys, which are collected in the 'Failure' value | |
| -- | |
| -- >>> awsm (fromList [('a', 1)]) (fromList [('b', 2)]) | |
| -- Success (fromList [('a',1),('b',2)]) |
:doc command| {-| | |
| This module provides types for clamping data in a given range or | |
| interval. | |
| -} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE DataKinds #-} | |
| module Poly where | |
| data Mode = Mode1 | Mode2 | |
| data Action ctx a = Action | |
| -- | Coerce the phantoms (poly-kinded) |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <ldap.h> | |
| int main(int argc, char **argv) { | |
| if (argc < 2) { | |
| printf("Usage!\n"); | |
| exit(1); | |
| } |