Skip to content

Commit

Permalink
Clean up after split
Browse files Browse the repository at this point in the history
  • Loading branch information
noughtmare committed Apr 10, 2023
1 parent c0b4a8b commit 3820172
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 30 deletions.
29 changes: 3 additions & 26 deletions examples/Main.hs
Original file line number Diff line number Diff line change
@@ -1,39 +1,16 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE DerivingVia #-}
import Gigaparsec ( Parser, reify, nt, parse, decode, char )

import Gigaparsec

import qualified Data.Set as Set
import Data.Set (Set)
import qualified Data.Map as Map
import Data.Map (Map)
import Data.List (intercalate)
import Unsafe.Coerce ( unsafeCoerce )
import Control.Applicative ( asum, Alternative((<|>)) )
import Data.Functor.Compose ( Compose(Compose) )
import Control.Monad ( void )
import Data.Reify ( reifyGraph, MuRef(..), Graph(Graph), Unique )
import GHC.Exts (Any)
import System.IO.Unsafe (unsafePerformIO)
-- import Debug.RecoverRTTI ( anythingToString )
import Data.Char (intToDigit)
import Data.Maybe (fromMaybe)
import Data.Char ( intToDigit )

many :: Parser a -> Parser [a]
many p = res where res = nt $ (:) <$> p <*> res <|> pure []

-- does not work: many p = nt $ (:) <$> p <*> many p <|> pure []

p1 :: Parser ()
p1 = void (a *> a) where
p1 = a *> a where
a = nt $ void (char 'a') <|> e
e = nt $ pure ()

Expand Down
5 changes: 1 addition & 4 deletions src/Gigaparsec.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
Expand All @@ -16,15 +15,13 @@ import Data.Set (Set)
import qualified Data.Map as Map
import Data.Map (Map)
import Data.List (intercalate)
import Control.Applicative (Alternative)
import Unsafe.Coerce ( unsafeCoerce )
import Control.Applicative ( asum, Alternative((<|>)) )
import Data.Functor.Compose ( Compose(Compose) )
import Control.Monad ( void )
import Data.Reify ( reifyGraph, MuRef(..), Graph(Graph), Unique )
import GHC.Exts (Any)
import System.IO.Unsafe (unsafePerformIO)
-- import Debug.RecoverRTTI ( anythingToString )
import Data.Char (intToDigit)
import Data.Maybe (fromMaybe)

data ActionF a f = AscendF a | MatchF Char (ActionF a f) | forall b. DescendF f (ActionF (b -> a) f) | FailF | ChooseF (ActionF a f) (ActionF a f)
Expand Down

0 comments on commit 3820172

Please sign in to comment.