Add indent.
[haskell/symantic.git] / symantic-grammar / Language / Symantic / Grammar / EBNF.hs
index 351db7d8aa3e9b923684aa6b48a30c37705e3f04..9c414fae930d26dd6f55789cbe99ca318ccef355 100644 (file)
@@ -1,10 +1,8 @@
 module Language.Symantic.Grammar.EBNF where
 
 import Control.Applicative (Applicative(..))
-import Control.Monad
-import Data.Semigroup hiding (option)
+import Data.Semigroup
 import Data.Text (Text)
-import Prelude hiding (any)
 import qualified Data.Text as Text
 
 import Language.Symantic.Grammar.Meta
@@ -30,15 +28,15 @@ import Language.Symantic.Grammar.Fixity
 -- Synthetized attributes are:
 --
 -- * 'Text' of the 'EBNF' rendition.
-data EBNF a = EBNF { unEBNF :: RuleMode -> (Infix, Side) -> Text }
+newtype EBNF a = EBNF { unEBNF :: RuleMode -> (Infix, Side) -> Text }
 instance Gram_Reader st EBNF where
-       g_ask_before (EBNF e) = EBNF e
-       g_ask_after  (EBNF e) = EBNF e
+       askBefore (EBNF e) = EBNF e
+       askAfter  (EBNF e) = EBNF e
 instance Gram_State st EBNF where
-       g_state_before (EBNF e) = EBNF e
-       g_state_after  (EBNF e) = EBNF e
+       stateBefore (EBNF e) = EBNF e
+       stateAfter  (EBNF e) = EBNF e
 instance Gram_Error err EBNF where
-       g_catch (EBNF e) = EBNF e
+       catch (EBNF e) = EBNF e
 
 -- | Get textual rendition of given 'EBNF'.
 runEBNF :: EBNF a -> Text