View freer_transformer.hs
{-#LANGUAGE GADTs, TypeApplications, DataKinds, TypeOperators #-}
import Control.Monad.Freer
import qualified Control.Monad.Freer as F
import Control.Monad.Trans.Writer
import Control.Monad.IO.Class
type Loc = Int
type LogSource = Int
type LogLevel = Int
type LogStr = String
View race.hs
import Control.Concurrent (threadDelay)
import Control.Concurrent.Async (race)
import Control.Monad
marika = forever $ do
threadDelay (10^6)
putStrLn "Marika Boo!!!"
s = do
c <- getChar
View oneshot.hs
{-#LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-}
import Pipes
import qualified Pipes.Prelude as P
import Control.Monad.Trans.State.Strict
import GHC.Magic
import qualified Pipes.Internal as I
import Data.IORef
import Control.Monad
import GHC.Types
import GHC.Prim
View IxFunctor.hs
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DefaultSignatures #-}
View streams.hs
{-#LANGUAGE BangPatterns #-}
import GHC.Magic
import Data.IORef
import Control.Monad
import Control.Monad.Trans
data Stream a m r = Yield a (Stream a m r) | Done r | Delay (() -> m (Stream a m r))
instance Functor m => Functor (Stream a m) where
fmap f (Done r) = Done (f r)
View gist:c77399da99c0a4e2ffdc728deb9bdbfc
{-#LANGUAGE BangPatterns #-}
import GHC.Magic
import Data.IORef
import Control.Monad
import Control.Monad.Trans
data Stream a m r = Yield a (Stream a m r) | Done r | Delay (() -> m (Stream a m r))
instance Functor m => Functor (Stream a m) where
fmap f (Done r) = Done (f r)
View oneShot.hs
{-#LANGUAGE BangPatterns #-}
import Pipes
import qualified Pipes.Prelude as P
import Control.Monad.Trans.State.Strict
import GHC.Magic
import qualified Pipes.Internal as I
import Data.IORef
import Control.Monad
emit :: Int -> Int -> IORef Int -> Producer Int IO ()
View pipes_oneshot.hs
{-#LANGUAGE BangPatterns #-}
import Pipes
import qualified Pipes.Prelude as P
import Control.Monad.Trans.State.Strict
import GHC.Magic
import qualified Pipes.Internal as I
import Data.IORef
import Control.Monad
await' :: Monad m => Proxy () a y' y m a
View Sink.hs
module Main (main) where
import System.IO.Error
import GHC.Magic
data Sink = Await (Maybe Char -> Sink) | Done Int
countFrom :: Int -> Sink
countFrom n = let k = countFrom $! n + 1
-- in Await $ \mi -> case mi of
View bench_foundation.hs
module Main where
import qualified Foundation as F
import qualified Foundation.Collection as F
import qualified Foundation.String as F
import qualified Foundation.Compat.ByteString as F
import Criterion.Main
import qualified Data.Text as T