3 import StdEnv, StdGeneric
11 import Control.GenBimap
15 import Data.GenType.CType
16 import Data.GenType.CParser
18 derive gType Either, T, R, Frac, Tr, Fix, Odd, Even, SR, List, Enum, NT, Blurp, EnumList, ER, CP, RA, Nest
22 :: SR = {f1 :: Int, f2 :: Bool, f3 :: Tr Either Bool, f4 :: Enum}
23 :: R a = {f1 :: ? (R a), f2 :: Bool, f3 :: T a, f4 :: Char -> Dynamic,
24 f5 :: [([#Int], [#Int!], [!Int!], [!Int], [Int!])],
25 f6 :: ({!Int}, {R Bool}, {#Char}, {32#Int}),/*({!Int}, {#Char}, {R Bool})*/
27 :: Tr m b= Tr (m Int b) | TrBork
28 :: Frac a = (/.) infixl 7 a a | Flurp
29 :: Fix f = Fix (f (Fix f))
31 :: List a = Cons a (List a) | Nil
33 :: Blurp a = Blurp (List a) | Blorp
35 :: EnumList = ECons Enum EnumList | ENil
37 :: ER = {nat :: Int, bool :: Bool}
38 :: RA a = {a1 :: a, a2 :: Int}
40 :: CP = CLeft Int Bool | CRight Char Char
43 ////Start = foldr (\i c->print i ["\n":c]) [] $ catMaybes $ map gTypeToType $ flattenGType $ unBox t
44 //:: Pair a b = Pair a b
45 //instance == (Pair a b) | == a where (==) (Pair a1 _) (Pair a2 _) = a1 == a2
46 //instance < (Pair a b) | < a where (<) (Pair a1 _) (Pair a2 _) = a1 < a2
47 :: Odd a = Odd (Even a) | OddBlurp
48 :: Even a = Even (Odd a) | EvenBlurp
51 ( flatTypedef $ gTypeToType $ unBox t
52 , typedefs $ map (map gTypeToType) $ map (filter (not o isBasic)) $ flattenGType $ unBox t
53 , flatParser $ gTypeToType $ unBox t
54 , parsers $ map (map gTypeToType) $ map (filter (not o isBasic)) $ flattenGType $ unBox t
57 //Start = typedefs //$ (\x->[[gTypeToType x]])
58 // $ map (/*filter (not o isBuiltin) o*/ catMaybes o map gTypeToType)
60 // $ map (map gTypeToType)
61 // $ map (filter (not o isBasic))
65 :: Nest m = Nest (m (m (m Int))) | NestBlurp
67 //t :: Box GType (?# Int)
68 //t :: Box GType (Maybe [Maybe (Either Bool String)])
69 //t :: Box GType ([SR], Enum, T Int, NT, Blurp Int)
70 //t :: Box GType [EnumList]
71 t :: Box GType (Nest ?, Tr Either (?(Int, Enum)))
72 //t :: Box GType (Odd Int, (), [Either (R (T *World)) (Frac Real)], Tr Either Bool, Fix Maybe)