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 Strict #-} | |
| {-# LANGUAGE Strict #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE RankNTypes, InstanceSigs, KindSignatures, GADTs, ConstraintKinds, ScopedTypeVariables #-} | |
| -- http://neilsculthorpe.com/publications/constrained-monad-problem.pdf | |
| import Data.Function | |
| import Data.List.NonEmpty (NonEmpty(..)) |
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 RankNTypes, InstanceSigs, KindSignatures, GADTs, ConstraintKinds, ScopedTypeVariables #-} | |
| -- http://neilsculthorpe.com/publications/constrained-monad-problem.pdf | |
| import GHC.Exts | |
| data NAF :: (* -> Constraint) -> (* -> *) -> * -> * where | |
| Pure :: a -> NAF c t a | |
| Ap :: c x => NAF c t (x -> a) -> t x -> NAF c t a |
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 RankNTypes, InstanceSigs, KindSignatures, GADTs, ConstraintKinds #-} | |
| -- Paper: http://neilsculthorpe.com/publications/constrained-monad-problem.pdf | |
| -- Talk: https://vimeo.com/69261960 | |
| import GHC.Exts | |
| data NF :: (* -> Constraint) -> (* -> *) -> * -> * where | |
| FMap :: c x => (x -> a) -> t x -> NF c t a |
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 OverloadedStrings #-} | |
| -- | | |
| module RIO.ConcurrentLog where | |
| import qualified Data.ByteString.Builder as SB | |
| import Data.List | |
| import Data.Time | |
| import RIO |
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
| applicative :: Q Exp -> [Q Exp] -> Q Exp | |
| applicative cons [] = [| pure $(cons) |] | |
| applicative cons (x:ys) = foldl (\inner y -> [| $(inner) <*> $(y) |]) [|$(cons) <$> $(x)|] ys |
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
| -- | Conduit piping with error handling. | |
| module Data.Conduit.Error where | |
| import Data.Conduit.Internal | |
| infixr 2 .|? | |
| (.|?) :: Monad m => ConduitT a b m (Either e ()) -> ConduitT b c m (Either e r) -> ConduitT a c m (Either e r) | |
| ConduitT left0 .|? ConduitT right0 = | |
| ConduitT $ \rest -> |
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 LambdaCase #-} | |
| -- | Sources that flush when their monadic action takes longer than n | |
| -- microseconds. | |
| module Data.Conduit.Flush where | |
| import Data.Conduit | |
| import Data.Conduit.Internal as Pipe (ConduitT(..), Pipe(..)) | |
| import UnliftIO |
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 ScopedTypeVariables #-} | |
| -- | A ResourceT-based way to use connections with conduit. | |
| module Data.Conduit.Network.Resource where | |
| import qualified Network.Socket as NS | |
| import Control.Exception | |
| import Control.Monad.IO.Class | |
| import Control.Monad.Trans.Resource |
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
| { | |
| "packages": [ | |
| { | |
| "components": [ | |
| { | |
| "modules": [ | |
| { | |
| "path": "/home/chris/Work/fpco/stack/src/Control/Concurrent/Execute.hs", | |
| "name": "Control.Concurrent.Execute" | |
| }, |
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 #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| -- | Show instance lexer and pretty-printer. | |
| module Lexx where | |
| import Control.Monad.State |