1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Define the terms for a language of tasks.

This commit is contained in:
Rob Rix 2017-05-29 11:42:21 -04:00
parent 6554b5e40f
commit 0888749f7c

View File

@ -7,6 +7,7 @@ module Semantic
) where
import qualified Control.Concurrent.Async as Async
import Control.Monad.Free.Freer
import Data.Functor.Both
import Data.Record
import Diff
@ -66,6 +67,14 @@ parseBlob decorator SourceBlob{..} = decorator source <$> runParser (parserForLa
type Decorator input output = Source -> input -> output
data TaskF output where
Parse :: Parser term -> Source -> TaskF term
Decorate :: Decorator term term' -> Source -> term -> TaskF term'
Render :: Monoid output => Renderer input output -> input -> TaskF output
type Task = Freer TaskF
-- Internal
renderConcurrently :: (Monoid output, StringConv output ByteString) => (input -> IO output) -> [input] -> IO ByteString