diff options
author | Gregor Kleen <aethoago@141.li> | 2017-02-15 15:10:51 +0100 |
---|---|---|
committer | Gregor Kleen <aethoago@141.li> | 2017-02-15 15:10:51 +0100 |
commit | ee09f262f9b8c7c6a4042071cdfff3e22adbef86 (patch) | |
tree | baeb1d9ee726881d25e0762c21f750850efb37f2 /lib/Postdelay/Utils.hs | |
parent | 8a24b41b333bce25e698d2e4b87f4b4f6548772c (diff) | |
download | postdelay-ee09f262f9b8c7c6a4042071cdfff3e22adbef86.tar postdelay-ee09f262f9b8c7c6a4042071cdfff3e22adbef86.tar.gz postdelay-ee09f262f9b8c7c6a4042071cdfff3e22adbef86.tar.bz2 postdelay-ee09f262f9b8c7c6a4042071cdfff3e22adbef86.tar.xz postdelay-ee09f262f9b8c7c6a4042071cdfff3e22adbef86.zip |
Establish framework
Diffstat (limited to 'lib/Postdelay/Utils.hs')
-rw-r--r-- | lib/Postdelay/Utils.hs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/lib/Postdelay/Utils.hs b/lib/Postdelay/Utils.hs deleted file mode 100644 index d716b4d..0000000 --- a/lib/Postdelay/Utils.hs +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | {-# LANGUAGE FlexibleContexts #-} | ||
2 | |||
3 | module Postdelay.Utils | ||
4 | ( hoistParsecT | ||
5 | ) where | ||
6 | |||
7 | import Control.Monad.Error.Class | ||
8 | |||
9 | import Data.Functor | ||
10 | import Data.Either | ||
11 | |||
12 | import Data.Functor.Identity | ||
13 | import Text.Parsec.Prim | ||
14 | import Text.Parsec.Error | ||
15 | |||
16 | hoistParsecT :: (Monad m, Stream s Identity t, Stream s m t) => ParsecT s u Identity a -> ParsecT s u m a | ||
17 | hoistParsecT p = do | ||
18 | st <- getParserState | ||
19 | let res = runParser p' undefined "" undefined | ||
20 | p' = setParserState st >> ((,) <$> getState <*> p) | ||
21 | either (fail . show) (\(st', res) -> putState st' $> res) $ res | ||