I hereby claim:
- I am pwm on github.
- I am zsoltszende (https://keybase.io/zsoltszende) on keybase.
- I have a public key ASD_UEOrGftSbuEnWfL6BQhMQoZXAHl40-Mxv-8m3dtj5go
To claim this, I am signing this object:
| <?php | |
| declare(strict_types=1); | |
| namespace Lens; | |
| use Closure; | |
| class Lens | |
| { | |
| /** @var Closure */ |
| <?php | |
| declare(strict_types=1); | |
| interface Expr { | |
| public function e(Evaluator $eval); | |
| public function unbox(); | |
| } | |
| abstract class LRExpr implements Expr { | |
| private $l; |
| fact :: Int -> (Int -> IO ()) -> IO () | |
| fact n f | |
| | n == 0 = f 1 | |
| | otherwise = fact (n - 1) (\x -> f (n * x)) | |
| main :: IO () | |
| main = fact 5 (\x -> print x) |
I hereby claim:
To claim this, I am signing this object:
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE KindSignatures #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| module Sing where | |
| data Broker = B1 | B2 | B3 deriving (Show) | |
| data PolicyB1 = PB1 deriving (Show) |
| data Tree a = Empty | Node a (Tree a) (Tree a) deriving (Show) | |
| data Crumb a = LeftCrumb a (Tree a) | RightCrumb a (Tree a) deriving (Show) | |
| type Breadcrumbs a = [Crumb a] | |
| type Zipper a = (Tree a, Breadcrumbs a) | |
| goLeft :: Zipper a -> Zipper a | |
| goLeft (Node x l r, bs) = (l, LeftCrumb x r:bs) | |
| goRight :: Zipper a -> Zipper a | |
| goRight (Node x l r, bs) = (r, RightCrumb x l:bs) |
| {-# LANGUAGE DeriveTraversable #-} | |
| module AS where | |
| import Control.Monad.Trans.State.Strict | |
| data T a = L a | N (T a) (T a) | |
| deriving (Eq, Show, Functor, Foldable, Traversable) | |
| labelTree :: T a -> (T (a, Int), Int) |
| module BT where | |
| data T a = E | L a | N a (T a) (T a) deriving Show | |
| -- inorder foldr | |
| inor :: (a -> b -> b) -> b -> T a -> b | |
| inor _ v E = v | |
| inor f v (L a) = f a v | |
| inor f v (N a l r) = inor f (f a (inor f v r)) l |
| {-# LANGUAGE RecordWildCards #-} | |
| {-# LANGUAGE StrictData #-} | |
| module FSM | |
| ( FooEvent(..) | |
| , FooState(..) | |
| , Foo() | |
| , mkFoo | |
| , trFoo | |
| , getFooEvents |
| <?php | |
| declare(strict_types=1); | |
| final class Order | |
| { | |
| /** @var Event */ | |
| private $events; | |
| /** @var State */ | |
| private $state; |