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
-- | Echo: a small experimental library for functional reactive programming. | |
{-# LANGUAGE | |
GADTs | |
, GeneralizedNewtypeDeriving | |
, TemplateHaskell | |
, RecursiveDo | |
, MagicHash | |
, UnboxedTuples | |
#-} |
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
-- * Introducing type variables in class constraint, using ConstraintKinds. | |
-- * (Using ghc-7.6.3) | |
{-# LANGUAGE ConstraintKinds, GADTs, TypeFamilies #-} | |
module ConstraintCategory where | |
import GHC.Exts (Constraint) | |
-- Version of Category that can put constraints on the i/o of the category. |
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 GADTs #-} | |
module Test where | |
type Var = String | |
type Program = [(String, Expr ())] | |
data Expr a where | |
Intro :: (Expr a -> Expr b) -> Expr () | |
Apply :: Expr (a -> b) -> Expr a -> Expr b |
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 GADTs, TypeOperators, TupleSections #-} | |
module Generics.Algebra where | |
import Control.Category | |
import Control.Arrow | |
import Control.Applicative | |
import Prelude hiding ((.), id) | |
import Generics.Combinator |
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 | |
GADTs | |
, KindSignatures | |
, RankNTypes | |
, TupleSections | |
, TypeOperators | |
#-} | |
module Generics.Morphism where | |
import Control.Arrow |
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 | |
> DeriveFunctor | |
> , DeriveFoldable | |
> , DeriveTraversable | |
> , StandaloneDeriving | |
> , DoRec | |
> #-} | |
> module Graph where | |
> import Control.Applicative |
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 | |
TypeOperators | |
, TemplateHaskell | |
#-} | |
module Tie where | |
import Prelude hiding ((.), id) | |
import Control.Category | |
import Data.Record.Label |
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 Main where | |
import Network.C10kServer | |
import System.IO | |
main :: IO () | |
main = | |
runC10kServer (\h i -> hPutStrLn h $ "HTTP/1.1 200 Ok\r\nContent-Type: text/plain; charset=UTF-8\r\n\r\n" ++ show i) | |
C10kConfig | |
{ initHook = return () |
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 | |
TypeOperators | |
, KindSignatures | |
, TypeFamilies | |
, EmptyDataDecls | |
#-} | |
module StructuralTyping where | |
-- Type level sum and product that carry around an explicit type environment | |
-- encoded as a heterogenous list. |
NewerOlder