Skip to content

Instantly share code, notes, and snippets.

View agocorona's full-sized avatar
💭
Status at .... https://gitter.im/Transient-Transient-Universe-HPlay/Lobby

Alberto agocorona

💭
Status at .... https://gitter.im/Transient-Transient-Universe-HPlay/Lobby
View GitHub Profile
no user package environment file found at /devel/transient
no user package environment file found at /devel/transient
Searching for eta in path.
Found eta at /root/.local/bin/eta
/root/.local/bin/eta --numeric-version
/root/.local/bin/eta is version 0.0.9.1
no user package environment file found at /devel/transient
Searching for eta-pkg in path.
Found eta-pkg at /root/.local/bin/eta-pkg
/root/.local/bin/eta-pkg --version
@agocorona
agocorona / Transient-cont.hs
Created July 18, 2017 23:53
a reformulation of Transient using a modified continuation monad
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, UndecidableInstances #-}
import Control.Applicative
import Control.Monad.IO.Class
import Control.Monad.Trans
import GHC.Conc
import System.IO.Unsafe
import Data.IORef
import Control.Concurrent.MVar
import qualified Data.Map as M
import Data.Typeable
{-# LANGUAGE RecordWildCards #-}
module Main where
import Unsafe.Coerce
import Transient.Internals
import Transient.Indeterminism
import Control.Monad.State
import System.IO.Unsafe
import Control.Monad
import Control.Applicative
{-# LANGUAGE RecordWildCards #-}
module Main where
import Unsafe.Coerce
import Transient.Internals
import Transient.Indeterminism
import Control.Monad.State
import System.IO.Unsafe
import Control.Monad
import Control.Applicative
@agocorona
agocorona / webapp.hs
Created July 7, 2017 11:17
webapp.hs from transient-examples recoded to make work the stop button in the last example
#!/usr/bin/env ./execthirdline.sh
-- compile it with ghcjs and execute it with runghc
-- set -e && port=`echo ${3} | awk -F/ '{print $(3)}'` && docker run -it -p ${port}:${port} -v $(pwd):/work agocorona/transient bash -c "mkdir -p static && ghcjs /work/${1} -o static/out && runghc /work/${1} ${2} ${3}"
-- usage: ./webapp.hs -p start/<docker ip>/<port>
{-# LANGUAGE CPP #-}
module Main where
-- hplayground by mark mann
-- identify user and record round by round results
{-# LANGUAGE DeriveDataTypeable, FlexibleInstances, UndecidableInstances #-}
module Main where
import Haste
import Haste.Foreign
import Haste.LocalStorage
import Haste.JSON (JSON(..))
from agocorona/transient-0.4.4.1
@agocorona
agocorona / runghcdockerWeb.sh
Created January 30, 2017 07:17
Sell script for the compilation with ghcjs and execution with runghc of transient programs with web nodes
set -e
port=`echo ${3} | awk -F/ '{print $(3)}'`
docker run -it -p ${port}:${port} -v $(pwd):/work agocorona/transient:01-27-2017 bash -c "mkdir -p static && ghcjs --make /work/${1} -o static/out && runghc /work/${1} ${2} ${3}"
@agocorona
agocorona / distributedApps.hs
Created January 30, 2017 07:13
Transieent: a web with a map-reduce widget and a distributed chat
#!/usr/bin/env ./buildrun2.sh
{-# LANGUAGE CPP, NoMonomorphismRestriction, DeriveDataTypeable #-}
module Main where
import Prelude hiding (div,id)
import Transient.Internals
@agocorona
agocorona / hasrocker.hs
Last active March 7, 2019 10:02
[benchmarking for the [hasrocket shottout](https://github.com/hashrocket/websocket-shootout)
{-# LANGUAGE OverloadedStrings #-}
-- haskell-transient application for the websocket shootout
-- https://github.com/hashrocket/websocket-shootout
-- this is the implementation of the benchmark with the transient libraries
-- https://github.com/transient-haskell
import Transient.Internals