Permalink
Browse files

refactored to add a result type to the Parser so we can use callCC. S…

…ince we work parametrically in the monad in most places this didn't change many signatures.
  • Loading branch information...
1 parent b05f5e6 commit 00164704f17184b09457040982490ed3596f32bb @ekmett committed Sep 19, 2011
View
@@ -25,7 +25,7 @@
-------------------------------------------------------------------------------
module Text.Trifecta.CharSet
- (
+ (
-- * Set type
CharSet(..)
-- * Operators
@@ -36,7 +36,7 @@ module Text.Trifecta.CharSet
, member
, notMember
, overlaps, isSubsetOf
- , isComplemented
+ , isComplemented
-- * Construction
, build
, empty
@@ -76,8 +76,8 @@ import Data.Array.Unboxed hiding (range)
import Data.Data
import Data.Function (on)
import Data.IntSet (IntSet)
-import Text.Trifecta.ByteSet (ByteSet)
-import qualified Text.Trifecta.ByteSet as ByteSet
+import Text.Trifecta.Util.ByteSet (ByteSet)
+import qualified Text.Trifecta.Util.ByteSet as ByteSet
import Data.Bits hiding (complement)
import Data.Word
import Data.ByteString.Internal (c2w)
@@ -26,8 +26,6 @@ import Control.Monad.Trans.Reader
import Control.Monad.Trans.Identity
import Data.Monoid
import Text.Trifecta.Diagnostic.Prim
-import Text.Trifecta.Diagnostic.Level
-import Text.Trifecta.Diagnostic.Rendering.Prim
class Monad m => MonadDiagnostic e m | m -> e where
throwDiagnostic :: Diagnostic e -> m a
@@ -19,13 +19,11 @@ import Control.Applicative
import Control.Comonad
import Control.Monad (guard)
import Control.Exception
-import Control.Monad.Writer.Class
import Data.Functor.Apply
import Data.Foldable
import Data.Traversable
import Data.List.NonEmpty hiding (map)
import Data.Semigroup
-import Data.Semigroup.Reducer
import Data.Semigroup.Foldable
import Data.Semigroup.Traversable
import Text.Trifecta.Rope.Bytes
@@ -28,7 +28,7 @@ import Text.Trifecta.Rope.Delta
import Text.Trifecta.Diagnostic.Rendering.Prim
import Text.Trifecta.Diagnostic.Rendering.Span
import Text.Trifecta.Parser.Class
-import Text.Trifecta.Util
+import Text.Trifecta.Util.Combinators
import System.Console.Terminfo.Color
import System.Console.Terminfo.PrettyPrint
import Prelude hiding (span)
@@ -35,7 +35,7 @@ import Data.ByteString (ByteString)
import Text.Trifecta.Rope.Bytes
import Text.Trifecta.Rope.Delta
import Text.Trifecta.Diagnostic.Rendering.Prim
-import Text.Trifecta.Util
+import Text.Trifecta.Util.Combinators
import Text.Trifecta.Parser.Class
import Data.Array
import System.Console.Terminfo.Color
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, Rank2Types #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
@@ -42,7 +42,7 @@ import Text.Trifecta.Rope.Delta
import qualified Data.IntSet as IntSet
import Text.Trifecta.CharSet (CharSet(..))
import qualified Text.Trifecta.CharSet as CharSet
-import qualified Text.Trifecta.ByteSet as ByteSet
+import qualified Text.Trifecta.Util.ByteSet as ByteSet
import qualified Data.ByteString as Strict
import Data.ByteString.Internal (w2c,c2w)
import Data.ByteString.UTF8 as UTF8
@@ -49,8 +49,8 @@ import Control.Applicative
import Control.Monad (guard)
import Text.Trifecta.Parser.Class hiding (satisfy)
import Text.Trifecta.Rope.Delta
-import Text.Trifecta.ByteSet (ByteSet(..))
-import qualified Text.Trifecta.ByteSet as ByteSet
+import Text.Trifecta.Util.ByteSet (ByteSet(..))
+import qualified Text.Trifecta.Util.ByteSet as ByteSet
import qualified Data.ByteString as Strict
import Data.ByteString.Internal (w2c,c2w)
import qualified Data.ByteString.Char8 as Char8
@@ -37,7 +37,7 @@ import Text.Trifecta.Rope.Prim as Rope
import Text.Trifecta.Rope.Delta
import Text.Trifecta.Rope.Bytes
import Text.Trifecta.Parser.Step
-import Text.Trifecta.Util as Util
+import Text.Trifecta.Util.Combinators as Util
data It r a
= Pure a
@@ -30,7 +30,7 @@ import Data.FingerTree as FingerTree
import Data.Foldable (toList)
import Data.Hashable
import Data.Int (Int64)
-import Text.Trifecta.Util as Util
+import Text.Trifecta.Util.Combinators as Util
import Text.Trifecta.Rope.Bytes
import Text.Trifecta.Rope.Delta
Oops, something went wrong.

0 comments on commit 0016470

Please sign in to comment.