diff options
| author | krasimir <krasimir@chalmers.se> | 2008-05-29 11:00:21 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2008-05-29 11:00:21 +0000 |
| commit | bc578a087112a2d6bb6216ad44dadd776bb1b349 (patch) | |
| tree | 482efffc58a3c068c6751e12fc5b366ebd2eac7e /src-3.0/GF/Formalism | |
| parent | 64d3a1226da712bcf3c2744bcc141ebd40acac27 (diff) | |
remove Symbol type
Diffstat (limited to 'src-3.0/GF/Formalism')
| -rw-r--r-- | src-3.0/GF/Formalism/Utilities.hs | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src-3.0/GF/Formalism/Utilities.hs b/src-3.0/GF/Formalism/Utilities.hs index ea1f1eeca..37e9d1577 100644 --- a/src-3.0/GF/Formalism/Utilities.hs +++ b/src-3.0/GF/Formalism/Utilities.hs @@ -25,25 +25,6 @@ import GF.Data.Utilities (sameLength, foldMerge, splitBy) import GF.Infra.PrintClass ------------------------------------------------------------ --- * symbols - -data Symbol c t = Cat c | Tok t - deriving (Eq, Ord, Show) - -symbol :: (c -> a) -> (t -> a) -> Symbol c t -> a -symbol fc ft (Cat cat) = fc cat -symbol fc ft (Tok tok) = ft tok - -mapSymbol :: (c -> d) -> (t -> u) -> Symbol c t -> Symbol d u -mapSymbol fc ft = symbol (Cat . fc) (Tok . ft) - -filterCats :: [Symbol c t] -> [c] -filterCats syms = [ cat | Cat cat <- syms ] - -filterToks :: [Symbol c t] -> [t] -filterToks syms = [ tok | Tok tok <- syms ] - ------------------------------------------------------------- -- * edges data Edge s = Edge Int Int s @@ -313,16 +294,6 @@ forest2trees (FMeta) = [TMeta] ------------------------------------------------------------ -- pretty-printing -instance (Print c, Print t) => Print (Symbol c t) where - prt = symbol prt (simpleShow . prt) - where simpleShow str = "\"" ++ concatMap mkEsc str ++ "\"" - mkEsc '\\' = "\\\\" - mkEsc '\"' = "\\\"" - mkEsc '\n' = "\\n" - mkEsc '\t' = "\\t" - mkEsc chr = [chr] - prtList = prtSep " " - instance Print t => Print (Input t) where prt input = "input " ++ prt (inputEdges input) |
