forked from sozysozbot/akrantiain2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug2.hs
More file actions
41 lines (33 loc) · 907 Bytes
/
Copy pathdebug2.hs
File metadata and controls
41 lines (33 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{-# OPTIONS -Wall -fno-warn-unused-do-bind #-}
import Prelude hiding (undefined)
import Akrantiain.Pattern_match
import Akrantiain.Structure
import Akrantiain.Rule
import System.IO
import qualified Data.Set as S
env :: Environment
env = Env{pun=punct, bools=S.fromList[CASE_SENSITIVE]}
main :: IO ()
main = do
cook (env,rls) "a" >>>= putStrLn
cook (env,rls) "n" >>>= putStrLn
cook (env,rls) "an" >>>= putStrLn
cook (env,rls) "na" >>>= putStrLn
(>>>=) :: (Show a) => Either a b -> ( b -> IO ()) -> IO ()
Left a >>>= _ = hPrint stderr a
Right b >>>= f = f b
c :: a -> Choose a
c = Ch . (:[])
lift a = R{leftneg = Nothing, middle = a, rightneg = Nothing}
punct :: Punctuation
punct = ""
{-
"n" "a" "" -> $ $ //
"a" -> /a/; "n" -> //;
-}
rls :: [Rule]
rls = [
lift[Right(c"n",Dollar_),Right(c"a",Dollar_),Right(c"",W"")],
lift[Right(c"a",W"a")],
lift[Right(c"n",W"")]
]