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 Control.Monad (forever) | |
import Control.Concurrent (forkIO) | |
import Control.Concurrent.Chan | |
import Data.Pool | |
import Database.HDBC | |
import Database.HDBC.PostgreSQL |
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
require 'funkr/types' | |
class Reader | |
def initialize(func); @func = func; end | |
def run(env); @func.call(env); end | |
# Pour l'usage du foncteur applicatif | |
def map(&block); reader{|env| block.call(run(env))}; end | |
def self.pure(v); reader{|_env| v}; end | |
def apply(to); reader{|env| run(env).call(to.run(env))}; end |
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 #-} | |
data Zero | |
data Succ a | |
data List :: * -> * -> * where | |
Nil :: List Zero a | |
Cons :: a -> List t a -> List (Succ t) a | |
data AnyList :: * -> * where |
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 Parser1 where | |
-- | On importe uniquement quelques types de base, quelques fonctions | |
-- et quelques opérateurs habituels | |
import Prelude ( String, Maybe(..), Char, Int, Show(..), | |
fmap, fst, read, | |
splitAt, length, span, elem, | |
($), (.), (==), (+), (*) ) |
OlderNewer